[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190722134152.GA13013@ziepe.ca>
Date: Mon, 22 Jul 2019 10:41:52 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: "Paul E. McKenney" <paulmck@...ux.ibm.com>
Cc: "Michael S. Tsirkin" <mst@...hat.com>,
Matthew Wilcox <willy@...radead.org>, aarcange@...hat.com,
akpm@...ux-foundation.org, christian@...uner.io,
davem@...emloft.net, ebiederm@...ssion.com,
elena.reshetova@...el.com, guro@...com, hch@...radead.org,
james.bottomley@...senpartnership.com, jasowang@...hat.com,
jglisse@...hat.com, keescook@...omium.org, ldv@...linux.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-parisc@...r.kernel.org,
luto@...capital.net, mhocko@...e.com, mingo@...nel.org,
namit@...are.com, peterz@...radead.org,
syzkaller-bugs@...glegroups.com, viro@...iv.linux.org.uk,
wad@...omium.org
Subject: Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)
On Mon, Jul 22, 2019 at 04:51:49AM -0700, Paul E. McKenney wrote:
> > > > Would it make sense to have call_rcu() check to see if there are many
> > > > outstanding requests on this CPU and if so process them before returning?
> > > > That would ensure that frequent callers usually ended up doing their
> > > > own processing.
> > >
> > > Unfortunately, no. Here is a code fragment illustrating why:
That is only true in the general case though, kfree_rcu() doesn't have
this problem since we know what the callback is doing. In general a
caller of kfree_rcu() should not need to hold any locks while calling
it.
We could apply the same idea more generally and have some
'call_immediate_or_rcu()' which has restrictions on the caller's
context.
I think if we have some kind of problem here it would be better to
handle it inside the core code and only require that callers use the
correct RCU API.
I can think of many places where kfree_rcu() is being used under user
control..
Jason
Powered by blists - more mailing lists