From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul E. McKenney" Subject: Re: [patch] fs: aio fix rcu lookup Date: Fri, 21 Jan 2011 13:22:45 -0800 Message-ID: <20110121212245.GN17752@linux.vnet.ibm.com> References: <20110120040308.GD8476@linux.vnet.ibm.com> <20110120200237.GC17752@linux.vnet.ibm.com> <1295554555.2613.15.camel@edumazet-laptop> Reply-To: paulmck@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Nick Piggin , Jeff Moyer , Jan Kara , Andrew Morton , linux-fsdevel , linux-kernel@vger.kernel.org To: Eric Dumazet Return-path: Content-Disposition: inline In-Reply-To: <1295554555.2613.15.camel@edumazet-laptop> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Jan 20, 2011 at 09:15:55PM +0100, Eric Dumazet wrote: > Le jeudi 20 janvier 2011 =E0 12:02 -0800, Paul E. McKenney a =E9crit = : > > On Fri, Jan 21, 2011 at 05:31:53AM +1100, Nick Piggin wrote: > > > call_rcu() is the obvious alternative, yes. > > >=20 > > > Basically, once we give in to synchronize_rcu() we're basically g= iving > > > up. That's certainly a very good tradeoff for something like file= system > > > unregistration or module unload, it buys big simplifications in r= eal > > > fastpaths. But I just don't think it should be taken lightly. > >=20 > > Makes sense to me! > >=20 > > BTW, on your earlier usage classification: > >=20 > > > I think synchronize_rcu should firstly not be used unless it give= s a good > > > simplification, or speedup in fastpath. > > > > > > When that is satified, then it is a question of exactly what kind= of slow > > > path it should be used in. I don't think it should be used in pro= cess- > > > synchronous code (eg syscalls) except for error cases, resource > > > exhaustion, management syscalls (like module unload). > >=20 > > I don't have any feedback either way on your guidance to where > > synchronize_rcu() should be used, as I believe that it depends a lo= t > > on the details of usage, and would vary from one part of the kernel > > to another, and possibly also over time. > >=20 >=20 > Sometime, a mixture of call_rcu() and synchronize_rcu() is used, to h= ave > a limit on pending callbacks (eating too much memory) >=20 > net/ipv4/fib_trie.c for example issues call_rcu() most of the time, b= ut > is able to trigger one synchronize_rcu() if more than XXX (128) pages= of > memory were queued in rcu queues. >=20 > For details, check commit c3059477fce2d956 > (ipv4: Use synchronize_rcu() during trie_rebalance()) Good point! Thanx, Paul