Patchwork [RESEND,0/1] AHCI: Optimize interrupt processing

login
register
mail settings
Submitter Alexander Gordeev
Date Aug. 9, 2013, 3:07 p.m.
Message ID <20130809150744.GB25306@dhcp-26-207.brq.redhat.com>
Download mbox | patch
Permalink /patch/266083/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Alexander Gordeev - Aug. 9, 2013, 3:07 p.m.
On Fri, Aug 09, 2013 at 08:24:38AM -0600, Jens Axboe wrote:
> On 08/09/2013 02:23 AM, Alexander Gordeev wrote:
> > +	ap->qc_tags = blk_mq_init_tags(ATA_MAX_QUEUE, 1, NUMA_NO_NODE);
> > +	if (!ap->qc_tags) {
> > +		kfree(ap);
> > +		return NULL;
> > +	}
> 
> This should be blk_mq_init_tags(ATA_MAX_QUEUE - 1, 1, ...) since the
> total depth is normal_tags + reserved_tags.

Aha.. If blk_mq_init_tags() should be like this then?

> -- 
> Jens Axboe
Jens Axboe - Aug. 9, 2013, 3:52 p.m.
On 08/09/2013 09:07 AM, Alexander Gordeev wrote:
> On Fri, Aug 09, 2013 at 08:24:38AM -0600, Jens Axboe wrote:
>> On 08/09/2013 02:23 AM, Alexander Gordeev wrote:
>>> +	ap->qc_tags = blk_mq_init_tags(ATA_MAX_QUEUE, 1, NUMA_NO_NODE);
>>> +	if (!ap->qc_tags) {
>>> +		kfree(ap);
>>> +		return NULL;
>>> +	}
>>
>> This should be blk_mq_init_tags(ATA_MAX_QUEUE - 1, 1, ...) since the
>> total depth is normal_tags + reserved_tags.
> 
> Aha.. If blk_mq_init_tags() should be like this then?
> 
> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> index dcbc2a4..b131a48 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -468,10 +468,9 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags,
>  	 * Rest of the tags start at the queue list
>  	 */
>  	tags->nr_free = 0;
> -	while (nr_tags - tags->nr_reserved) {
> +	while (nr_tags--) {
>  		tags->freelist[tags->nr_free] = tags->nr_free +
>  							tags->nr_reserved;
> -		nr_tags--;
>  		tags->nr_free++;
>  	}

I misremembered, just checked the code. I think I used to have it like I
described, but changed it since I thought it would be more logical to
pass in full depth, and then what part of that is reserved. Looking at
the current code, your patch looks correct as-is.
Alexander Gordeev - Aug. 9, 2013, 4:46 p.m.
On Fri, Aug 09, 2013 at 09:52:19AM -0600, Jens Axboe wrote:
> On 08/09/2013 09:07 AM, Alexander Gordeev wrote:
> > diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> > index dcbc2a4..b131a48 100644
> > --- a/block/blk-mq-tag.c
> > +++ b/block/blk-mq-tag.c
> > @@ -468,10 +468,9 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags,
> >  	 * Rest of the tags start at the queue list
> >  	 */
> >  	tags->nr_free = 0;
> > -	while (nr_tags - tags->nr_reserved) {
> > +	while (nr_tags--) {
> >  		tags->freelist[tags->nr_free] = tags->nr_free +
> >  							tags->nr_reserved;
> > -		nr_tags--;
> >  		tags->nr_free++;
> >  	}
> 
> I misremembered, just checked the code. I think I used to have it like I
> described, but changed it since I thought it would be more logical to
> pass in full depth, and then what part of that is reserved. Looking at
> the current code, your patch looks correct as-is.

Ok, then a whole series "[PATCH 0/3] blk-mq: Avoid effects of a weird queue
depth" (I posted earlier in a separate thread) should make sense. Besides
the hunk above it limits the per-cpu cache size and sanity-checks total vs
reserved length. I can resubmit if you want.

> 
> -- 
> Jens Axboe
>
Jens Axboe - Aug. 9, 2013, 5:07 p.m.
On 08/09/2013 10:46 AM, Alexander Gordeev wrote:
> On Fri, Aug 09, 2013 at 09:52:19AM -0600, Jens Axboe wrote:
>> On 08/09/2013 09:07 AM, Alexander Gordeev wrote:
>>> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
>>> index dcbc2a4..b131a48 100644
>>> --- a/block/blk-mq-tag.c
>>> +++ b/block/blk-mq-tag.c
>>> @@ -468,10 +468,9 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags,
>>>  	 * Rest of the tags start at the queue list
>>>  	 */
>>>  	tags->nr_free = 0;
>>> -	while (nr_tags - tags->nr_reserved) {
>>> +	while (nr_tags--) {
>>>  		tags->freelist[tags->nr_free] = tags->nr_free +
>>>  							tags->nr_reserved;
>>> -		nr_tags--;
>>>  		tags->nr_free++;
>>>  	}
>>
>> I misremembered, just checked the code. I think I used to have it like I
>> described, but changed it since I thought it would be more logical to
>> pass in full depth, and then what part of that is reserved. Looking at
>> the current code, your patch looks correct as-is.
> 
> Ok, then a whole series "[PATCH 0/3] blk-mq: Avoid effects of a weird queue
> depth" (I posted earlier in a separate thread) should make sense. Besides
> the hunk above it limits the per-cpu cache size and sanity-checks total vs
> reserved length. I can resubmit if you want.

You don't have to resubmit, I'll get it reviewed and applied today.
Alexander Gordeev - Aug. 12, 2013, 3:21 p.m.
On Fri, Aug 09, 2013 at 11:07:37AM -0600, Jens Axboe wrote:
> You don't have to resubmit, I'll get it reviewed and applied today.

Hi Jens,

I limited the minimal queue depth to 4, which is apparently wrong
in case of libata. I will post a new series.

> -- 
> Jens Axboe
>

Patch

diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index dcbc2a4..b131a48 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -468,10 +468,9 @@  struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags,
 	 * Rest of the tags start at the queue list
 	 */
 	tags->nr_free = 0;
-	while (nr_tags - tags->nr_reserved) {
+	while (nr_tags--) {
 		tags->freelist[tags->nr_free] = tags->nr_free +
 							tags->nr_reserved;
-		nr_tags--;
 		tags->nr_free++;
 	}