Re: [PATCH percpu/for-3.17 1/2] percpu: implement percpu_pool

From: Andrew Morton
Date: Thu Jul 31 2014 - 18:03:34 EST

On Fri, 18 Jul 2014 16:08:04 -0400 Tejun Heo <tj@xxxxxxxxxx> wrote:

> percpu allocator requires sleepable context for allocations. Most use
> cases are fine with the requirement but blk-throttle currently
> implements its own asynchronous allocation mechanism to allow
> initiating allocation from atomic contexts and there are expected to
> be more similar use cases.
> It'd be best to make percpu allocator take GFP mask like other
> allocators but its entanglement with kernel virtual address management
> makes it very cumbersome. Also, percpu allocations from atomic
> contexts are likely to remain highly restricted.
> This patch implements a simple asynchronous allocation pool, named
> percpu_pool, which can be used from any context and is refilled
> automatically. A pool is initialized with the size and alignment of
> the percpu areas to serve and the low an high watermarks. When the
> number of cached areas fall below the low watermark, a work item is
> kicked off to fill it up to the high mark. A pool can be statically
> defined and can be manually filled and emptied.

I don't think we should add facilities such as this. Because if we do,
people will use them and thereby make the kernel less reliable, for
obvious reasons.

It would be better to leave the nasty hack localized within
blk-throttle.c and hope that someone finds a way of fixing it.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at