lkml.org 
[lkml]   [2021]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/rmap: convert anon_vma.refcount from atomic_t to refcount_t
On Thu, 11 Mar 2021 13:56:15 +0800 Yejune Deng <yejune.deng@gmail.com> wrote:

> refcount_t type should be used instead of atomic_t when the variable
> is used as a reference counter. This is because the implementation of
> refcount_t can prevent overflows and detect possible use-after-free.

The use of refcount_t comes at a cost:

q:/usr/src/25> size mm/rmap.o
text data bss dec hex filename
31114 2147 32 33293 820d mm/rmap.o
31558 2147 32 33737 83c9 mm/rmap.o

That's a bunch more instructions to execute on some fairly hot
code paths.

I guess the debugging/checking features are nice, but this is pretty
mature code. I'm quite unsure that this tradeoff is a favorable one.

\
 
 \ /
  Last update: 2021-03-11 22:59    [W:0.027 / U:2.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site