Re: [PATCHSET] mempool, percpu, blkcg: fix percpu stat allocationand remove stats_lock

From: Andrew Morton
Date: Wed Mar 07 2012 - 18:08:08 EST


On Wed, 7 Mar 2012 14:56:29 -0800
Tejun Heo <tj@xxxxxxxxxx> wrote:

> On Wed, Mar 07, 2012 at 02:42:29PM -0500, Vivek Goyal wrote:
> > blk-cgroup: Alloc per cpu stats from worker thread in a delayed manner
> >
> > Current per cpu stat allocation assumes GFP_KERNEL allocation flag. But in
> > IO path there are times when we want GFP_NOIO semantics. As there is no
> > way to pass the allocation flags to alloc_percpu(), this patch delays the
> > allocation of stats using a worker thread.
> >
> > v2-> tejun suggested following changes. Changed the patch accordingly.
> > - move alloc_node location in structure
> > - reduce the size of names of some of the fields
> > - Reduce the scope of locking of alloc_list_lock
> > - Simplified stat_alloc_fn() by allocating stats for all
> > policies in one go and then assigning these to a group.
> >
> > v3 -> Andrew suggested to put some comments in the code. Also raised
> > concerns about trying to allocate infinitely in case of allocation
> > failure. I have changed the logic to sleep for 10ms before retrying.
> > That should take care of non-preemptible UP kernels.
> >
> > v4 -> Tejun had more suggestions.
> > - drop list_for_each_entry_all()
> > - instead of msleep() use queue_delayed_work()
> > - Some cleanups realted to more compact coding.
> >
> > v5-> tejun suggested more cleanups leading to more compact code.
> >
> > Signed-off-by: Vivek Goyal <vgoyal@xxxxxxxxxx>
>
> Looks good to me. I'll roll it into the stats series. Andrew, if you
> still have objections, please scream.

Just the "msleep adds to load average" issue needs thinking about.

It's rather a miserable patch :(
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/