diff mbox series

block: Make write_hints[] big enough

Message ID 1539795081-2394-1-git-send-email-avri.altman@wdc.com (mailing list archive)
State New, archived
Headers show
Series block: Make write_hints[] big enough | expand

Commit Message

Avri Altman Oct. 17, 2018, 4:51 p.m. UTC
Just stumbled over this.
Looks like the write hints array in the request queue is not allotted
with the required space to accommodate all the write hint types.

fixes: f793dfd3f39a (blk-mq: expose write hints through debugfs)

Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
 include/linux/blkdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe Oct. 18, 2018, 2:37 p.m. UTC | #1
On 10/17/18 10:51 AM, Avri Altman wrote:
> Just stumbled over this.
> Looks like the write hints array in the request queue is not allotted
> with the required space to accommodate all the write hint types.
> 
> fixes: f793dfd3f39a (blk-mq: expose write hints through debugfs)

Your commit message doesn't really explain what you think the issue
is. We have 4 write hint types, with a fifth being "none". Where
are we exceeding these 5 hints?
Avri Altman Oct. 18, 2018, 3:30 p.m. UTC | #2
> -----Original Message-----
> From: Jens Axboe <axboe@kernel.dk>
> Sent: Thursday, October 18, 2018 5:38 PM
> To: Avri Altman <Avri.Altman@wdc.com>; linux-block@vger.kernel.org
> Cc: Avi Shchislowski <Avi.Shchislowski@wdc.com>; Alex Lemberg
> <Alex.Lemberg@wdc.com>
> Subject: Re: [PATCH] block: Make write_hints[] big enough
> 
> On 10/17/18 10:51 AM, Avri Altman wrote:
> > Just stumbled over this.
> > Looks like the write hints array in the request queue is not allotted
> > with the required space to accommodate all the write hint types.
> >
> > fixes: f793dfd3f39a (blk-mq: expose write hints through debugfs)
> 
> Your commit message doesn't really explain what you think the issue
> is. We have 4 write hint types, with a fifth being "none". Where
> are we exceeding these 5 hints?
WRITE_LIFE_EXTREME = RWH_WRITE_LIFE_EXTREME = 5,
will be ignored by queue_write_hint_{show_store}.

Thanks,
Avri

> 
> --
> Jens Axboe
Jens Axboe Oct. 18, 2018, 5:34 p.m. UTC | #3
On 10/18/18 9:30 AM, Avri Altman wrote:
>> -----Original Message-----
>> From: Jens Axboe <axboe@kernel.dk>
>> Sent: Thursday, October 18, 2018 5:38 PM
>> To: Avri Altman <Avri.Altman@wdc.com>; linux-block@vger.kernel.org
>> Cc: Avi Shchislowski <Avi.Shchislowski@wdc.com>; Alex Lemberg
>> <Alex.Lemberg@wdc.com>
>> Subject: Re: [PATCH] block: Make write_hints[] big enough
>>
>> On 10/17/18 10:51 AM, Avri Altman wrote:
>>> Just stumbled over this.
>>> Looks like the write hints array in the request queue is not allotted
>>> with the required space to accommodate all the write hint types.
>>>
>>> fixes: f793dfd3f39a (blk-mq: expose write hints through debugfs)
>>
>> Your commit message doesn't really explain what you think the issue
>> is. We have 4 write hint types, with a fifth being "none". Where
>> are we exceeding these 5 hints?
> WRITE_LIFE_EXTREME = RWH_WRITE_LIFE_EXTREME = 5,
> will be ignored by queue_write_hint_{show_store}.

Hmm, wonder how that got broken. But we should just bundle NONE
and NOT_SET, since they end up in the same bucket on the
driver side. Making the array larger is not necessary, we
only have effectively 5 hints.
Avri Altman Oct. 18, 2018, 7:44 p.m. UTC | #4
>>> Your commit message doesn't really explain what you think the issue
>>> is. We have 4 write hint types, with a fifth being "none". Where
>>> are we exceeding these 5 hints?
>> WRITE_LIFE_EXTREME = RWH_WRITE_LIFE_EXTREME = 5,
>> will be ignored by queue_write_hint_{show_store}.

>Hmm, wonder how that got broken. But we should just bundle NONE
>and NOT_SET, since they end up in the same bucket on the
>driver side. Making the array larger is not necessary, we
>only have effectively 5 hints.
Done.

Thanks,
Avri

>--
>Jens Axboe
diff mbox series

Patch

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d6869e0..0c8010d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -665,7 +665,7 @@  struct request_queue {
 
 	struct work_struct	release_work;
 
-#define BLK_MAX_WRITE_HINTS	5
+#define BLK_MAX_WRITE_HINTS	6
 	u64			write_hints[BLK_MAX_WRITE_HINTS];
 };