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

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

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

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

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

2017-03-26 Thread Julia Lawall
: Re: [PATCH] blkcg: allocate struct blkcg_gq outside request queue spinlock CC: kbuild-...@01.org In-Reply-To: <20170324215627.12831-1-tah...@google.com> TO: Tahsin Erdogan <tah...@google.com> CC: Tejun Heo <t...@kernel.org>, Jens Axboe <ax...@kernel.dk>, linux-bl...@vg

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: > >

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: > >

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

2017-03-24 Thread Tahsin Erdogan
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: pcpu_alloc+0x68f/0x710 __alloc_percpu_gfp+0xd/0x10

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

2017-03-24 Thread Tahsin Erdogan
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: pcpu_alloc+0x68f/0x710 __alloc_percpu_gfp+0xd/0x10

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

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

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

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

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

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

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

2017-02-27 Thread Tahsin Erdogan
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: pcpu_alloc+0x68f/0x710 __alloc_percpu_gfp+0xd/0x10

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

2017-02-27 Thread Tahsin Erdogan
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: pcpu_alloc+0x68f/0x710 __alloc_percpu_gfp+0xd/0x10