Re: [PATCH] blkcg: allocate struct blkcg_gq outside request queue spinlock

2017-03-28 Thread Tejun Heo
On Fri, Mar 24, 2017 at 04:04:32PM -0600, Jens Axboe wrote: > On 03/24/2017 03:56 PM, 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 caus

Re: [PATCH] blkcg: allocate struct blkcg_gq outside request queue spinlock

2017-03-27 Thread Tahsin Erdogan
On Sun, Mar 26, 2017 at 3:54 AM, Julia Lawall wrote: > Is an unlock needed before line 848? Or does blkg_lookup_check take care > of it? Unlock is not needed. On success, function returns with locks held. It is documented at line 805: "... This function returns with RCU read * lock and queue l

Re: [PATCH] blkcg: allocate struct blkcg_gq outside request queue spinlock

2017-03-26 Thread Julia Lawall
Is an unlock needed before line 848? Or does blkg_lookup_check take care of it? julia -- Forwarded message -- Date: Sun, 26 Mar 2017 07:50:17 +0800 From: kbuild test robot To: kbu...@01.org Cc: Julia Lawall Subject: Re: [PATCH] blkcg: allocate struct blkcg_gq outside request

Re: [PATCH] blkcg: allocate struct blkcg_gq outside request queue spinlock

2017-03-24 Thread Jens Axboe
On 03/24/2017 03:56 PM, 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: > > pc

Re: [PATCH] blkcg: allocate struct blkcg_gq outside request queue spinlock

2017-03-01 Thread Tejun Heo
Hello, On Tue, Feb 28, 2017 at 03:51:27PM -0800, Tahsin Erdogan wrote: > On Tue, Feb 28, 2017 at 2:47 PM, Tejun Heo wrote: > >> + if (!blkcg_policy_enabled(q, pol)) { > >> + ret = -EOPNOTSUPP; > >> + goto fail; > > > > Pulling this out of the queue_lock doesn't seem sa

Re: [PATCH] blkcg: allocate struct blkcg_gq outside request queue spinlock

2017-02-28 Thread Tahsin Erdogan
On Tue, Feb 28, 2017 at 2:47 PM, Tejun Heo wrote: >> + if (!blkcg_policy_enabled(q, pol)) { >> + ret = -EOPNOTSUPP; >> + goto fail; > > Pulling this out of the queue_lock doesn't seem safe to me. This > function may end up calling into callbacks of disabled policies th

Re: [PATCH] blkcg: allocate struct blkcg_gq outside request queue spinlock

2017-02-28 Thread Tejun Heo
Hello, Overall, the approach looks good to me but please see below. On Mon, Feb 27, 2017 at 06:49:57PM -0800, Tahsin Erdogan wrote: > @@ -806,44 +807,99 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct > blkcg_policy *pol, > if (!disk) > return -ENODEV; > if (par