lkml.org 
[lkml]   [2020]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 15/16] rcu/tree: Allocate a page when caller is preemptible
On Wed, Nov 04, 2020 at 12:39:31PM +0100, Uladzislau Rezki wrote:
[..]
> > > - if (!krcp->bkvhead[idx] ||
> > > - krcp->bkvhead[idx]->nr_records == KVFREE_BULK_MAX_ENTR) {
> > > - bnode = get_cached_bnode(krcp);
> > > - /* Switch to emergency path. */
> > > + if (!(*krcp)->bkvhead[idx] ||
> > > + (*krcp)->bkvhead[idx]->nr_records == KVFREE_BULK_MAX_ENTR) {
> > > + bnode = get_cached_bnode(*krcp);
> > > + if (!bnode && can_alloc_page) {
> >
> > I think you can directly put preemptible() here with a comment saying
> > allocate only if preemptible and get rid of can_alloc_page.
> >
> Not really. We check preemtable() before acquiring the internal lock,
> otherwise it will always return "false". Thus, it is checked on the
> entry in the beginning.

You are right. Sorry. Sounds good to me.

- Joel

\
 
 \ /
  Last update: 2020-11-04 15:37    [W:0.120 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site