Re: [PATCH resend] audit: fix mark refcounting

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

 



On Thu, Dec 15, 2011 at 2:28 PM, Eric Paris <eparis@xxxxxxxxxx> wrote:
>
> How expensive is an atomic_inc()/atomic_dec() combo?  If it's mostly
> free we can do it in the right place.

It's pretty expensive, but it depends a lot on cache details etc. It
involves a memory barrier on x86 too, and depending on architecture it
might be anything from 150 cycles (P4 - but by now probably nobody
cares) to "a few tens" of cycles (roughly 10-35 on modern x86).

The cache miss itself - if it happens - is not counted in the above cost.

A totally uncontended spinlock is actually cheaper than a pair of
atomic ops. So if it's a hot path it probably should be moved
elsewhere if possible.

                       Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux