lkml.org 
[lkml]   [2020]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 11/24] rcu/tree: Maintain separate array for vmalloc ptrs
> > @@ -3072,21 +3105,34 @@ static inline bool queue_kfree_rcu_work(struct kfree_rcu_cpu *krcp)
> > krwp = &(krcp->krw_arr[i]);
> >
> > /*
> > - * Try to detach bhead or head and attach it over any
> > + * Try to detach bkvhead or head and attach it over any
> > * available corresponding free channel. It can be that
> > * a previous RCU batch is in progress, it means that
> > * immediately to queue another one is not possible so
> > * return false to tell caller to retry.
> > */
> > - if ((krcp->bhead && !krwp->bhead_free) ||
> > + if ((krcp->bkvhead[0] && !krwp->bkvhead_free[0]) ||
> > + (krcp->bkvhead[1] && !krwp->bkvhead_free[1]) ||
> > (krcp->head && !krwp->head_free)) {
> > - /* Channel 1. */
> > - if (!krwp->bhead_free) {
> > - krwp->bhead_free = krcp->bhead;
> > - krcp->bhead = NULL;
> > + /*
> > + * Channel 1 corresponds to SLAB ptrs.
> > + */
> > + if (!krwp->bkvhead_free[0]) {
> > + krwp->bkvhead_free[0] = krcp->bkvhead[0];
> > + krcp->bkvhead[0] = NULL;
> > }
> >
> > - /* Channel 2. */
> > + /*
> > + * Channel 2 corresponds to vmalloc ptrs.
> > + */
> > + if (!krwp->bkvhead_free[1]) {
> > + krwp->bkvhead_free[1] = krcp->bkvhead[1];
> > + krcp->bkvhead[1] = NULL;
> > + }
>
> Why not a "for" loop here? Duplicate code is most certainly not what
> we want, as it can cause all sorts of trouble down the road.
>
Agree. Can be done. Thanks :)

--
Vlad Rezki


\
 
 \ /
  Last update: 2020-05-04 16:26    [W:1.516 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site