[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1274424292.2439.6.camel@edumazet-laptop>
Date: Fri, 21 May 2010 08:44:52 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: npiggin@...e.de, paulmck@...ux.vnet.ibm.com,
torvalds@...ux-foundation.org, anton@...ba.org,
akpm@...ux-foundation.org, willy@...ux.intel.com,
benh@...nel.crashing.org, paulus@...ba.org,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2]: atomic_t: Remove volatile from atomic_t definition
Le jeudi 20 mai 2010 à 23:10 -0700, David Miller a écrit :
> From: Nick Piggin <npiggin@...e.de>
> Date: Fri, 21 May 2010 16:06:00 +1000
>
> > Actually, I bet we have a lot of bugs there with loading integers and
> > pointers atomically, where the code assumes the loaded value will not
> > be reloaded by the compiler, because it is an easy thing to assume.
>
> Alexey Kuznetsov was aware of this problem 8+ years ago when we were
> first adding fine-grained locking the the networking.
>
> > atomic_read_light could be useful though, for sure.
>
> I definitely think so. And every usage of it should have a big fat
> comment right next to it explaining how it's usage is valid in that
> spot :-)
> -
I really doubt a valid (and dully commented) usage of
atomic_read_light() will bring anything, but added complexity to API.
Generated code will be the same than atomic_read() in these cases,
unless some real factorization can be done inside a loop.
We still have some uneeded RMW atomic ops to remove, before even
thinking to optimise reads ;)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists