Thread (31 messages) 31 messages, 5 authors, 2025-01-29

Re: [PATCH v5 4/5] sd: limit to use write life hints

From: Christoph Hellwig <hch@lst.de>
Date: 2024-09-12 13:02:40
Also in: linux-f2fs-devel, linux-fsdevel, linux-nvme, linux-scsi

On Tue, Sep 10, 2024 at 08:31:59PM +0530, Kanchan Joshi wrote:
From: Nitesh Shetty <redacted>

The incoming hint value maybe either lifetime hint or placement hint.
.. may either be .. ?
quoted hunk ↗ jump to hunk
Make SCSI interpret only temperature-based write lifetime hints.

Signed-off-by: Nitesh Shetty <redacted>
Signed-off-by: Kanchan Joshi <redacted>
---
 drivers/scsi/sd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index dad3991397cf..82bd4b07314e 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1191,8 +1191,8 @@ static u8 sd_group_number(struct scsi_cmnd *cmd)
 	if (!sdkp->rscs)
 		return 0;
 
-	return min3((u32)rq->write_hint, (u32)sdkp->permanent_stream_count,
-		    0x3fu);
+	return min3((u32)WRITE_LIFETIME_HINT(rq->write_hint),
No fan of the screaming WRITE_LIFETIME_HINT.    Or the fact that multiple
things are multiplexed into the single rq->write_hint field to
start with.

This code could also use a bit of documentation already in the existing
version, but even more so now.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help