mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-05 05:15:23 +02:00
rcu/kvfree: Refactor kvfree_rcu_queue_batch()
Improve readability of kvfree_rcu_queue_batch() function
in away that, after a first batch queuing, the loop is break
and success value is returned to a caller.
There is no reason to loop and check batches further as all
outstanding objects have already been picked and attached to
a certain batch to complete an offloading.
Fixes: 2b55d6a42d
("rcu/kvfree: Add kvfree_rcu_barrier() API")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Closes: https://lore.kernel.org/lkml/ZvWUt2oyXRsvJRNc@pc636/T/
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
This commit is contained in:
parent
77ced98f0f
commit
3c5d61ae91
|
@ -3607,11 +3607,12 @@ kvfree_rcu_queue_batch(struct kfree_rcu_cpu *krcp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// One work is per one batch, so there are three
|
// One work is per one batch, so there are three
|
||||||
// "free channels", the batch can handle. It can
|
// "free channels", the batch can handle. Break
|
||||||
// be that the work is in the pending state when
|
// the loop since it is done with this CPU thus
|
||||||
// channels have been detached following by each
|
// queuing an RCU work is _always_ success here.
|
||||||
// other.
|
|
||||||
queued = queue_rcu_work(system_unbound_wq, &krwp->rcu_work);
|
queued = queue_rcu_work(system_unbound_wq, &krwp->rcu_work);
|
||||||
|
WARN_ON_ONCE(!queued);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user