Re: [PATCH v5] blkcg: allocate struct blkcg_gq outside request queue spinlock
From: Tejun Heo
Date: Thu Mar 09 2017 - 13:27:34 EST
On Thu, Mar 09, 2017 at 12:05:31AM -0800, Tahsin Erdogan wrote:
> blkg_conf_prep() currently calls blkg_lookup_create() while holding
> request queue spinlock. This means allocating memory for struct
> blkcg_gq has to be made non-blocking. This causes occasional -ENOMEM
> failures in call paths like below:
> In the code path above, percpu allocator cannot call vmalloc() due to
> queue spinlock.
> A failure in this call path gives grief to tools which are trying to
> configure io weights. We see occasional failures happen shortly after
> reboots even when system is not under any memory pressure. Machines
> with a lot of cpus are more vulnerable to this condition.
> Update blkg_create() function to temporarily drop the rcu and queue
> locks when it is allowed by gfp mask.
> Suggested-by: Tejun Heo <tj@xxxxxxxxxx>
> Signed-off-by: Tahsin Erdogan <tahsin@xxxxxxxxxx>
Acked-by: Tejun Heo <tj@xxxxxxxxxx>