Re: [PATCH] mm/rmap: convert anon_vma.refcount from atomic_t to refcount_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 11 Mar 2021 13:56:15 +0800 Yejune Deng <yejune.deng@xxxxxxxxx> 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.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux