[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1288984371.2665.13.camel@edumazet-laptop>
Date: Fri, 05 Nov 2010 20:12:51 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: paulmck@...ux.vnet.ibm.com
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Christoph Lameter <cl@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>, Andi Kleen <andi@...stfloor.org>,
Nick Piggin <npiggin@...nel.dk>
Subject: Re: [PATCH] atomic: add atomic_inc_not_zero_hint()
Le vendredi 05 novembre 2010 à 11:40 -0700, Paul E. McKenney a écrit :
> OK, so I cannot resist the challenge... ;-)
>
I knew that ;)
> Suppose that the atomic_inc_not_zero_hint() is in common code that might
> be invoked from a cleanup path. On the cleanup path, perhaps within an
> RCU callback, if the reference is zero, we have the only reference and
> thus don't need to increment the reference count. On the other hand,
> if the reference is non-zero, we want to obtain a reference in order
> to safely attempt to encourage the other reference holder to let go
> more quickly.
>
> Perhaps a bit of a stretch, but why not just replace the above
> "return 0" with "atomic_inc_not_zero(v)"? It will usually be
> compiled out, right?
Yes indeed, thanks !
--
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