1 Dec 2009 01:01
[PATCH] percpu: explain quick paths in pcpu_[de]populate_chunk()
Tejun Heo <tj <at> kernel.org>
2009-12-01 00:01:45 GMT
2009-12-01 00:01:45 GMT
pcpu_[de]populate_chunk() check whether there's actually any work to do at the beginning and exit early if not. This checking is done by seeing whether the first iteration of pcpu_for_each_[un]pop_region() covers the whole requested region. The resulting code is a bit unusual in that it's loop-like but never loops which apparently confuses people. Add comments to explain it. Signed-off-by: Tejun Heo <tj <at> kernel.org> Reported-by: Amerigo Wang <amwang <at> redhat.com> Cc: Christoph Lameter <cl <at> linux-foundation.org> --- Added to percpu#for-next. This should be clear enough, right? mm/percpu.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c index 442010c..c264315 100644 --- a/mm/percpu.c +++ b/mm/percpu.c <at> <at> -912,10 +912,15 <at> <at> static void pcpu_depopulate_chunk(struct pcpu_chunk *chunk, int off, int size) unsigned long *populated; int rs, re; - /* quick path, check whether it's empty already */ + /* + * Quick path, check whether it's already empty. If the + * region is completely empty, the first iteration will cover + * the whole region. + */(Continue reading)
RSS Feed