diff mbox series

scsi: scsi_debug: Reduce DEF_ATOMIC_WR_MAX_LENGTH

Message ID 20250501100241.930071-1-john.g.garry@oracle.com
State New
Headers show
Series scsi: scsi_debug: Reduce DEF_ATOMIC_WR_MAX_LENGTH | expand

Commit Message

John Garry May 1, 2025, 10:02 a.m. UTC
The default atomic write max length in DEF_ATOMIC_WR_MAX_LENGTH is
excessively large.

For 512B LBS, we would get a 4MB max, but due to block layer atomic write
restrictions this is limited to 512KB.

Reduce DEF_ATOMIC_WR_MAX_LENGTH to a value which would be more
realistic (for a real device supporting atomic writes), 64KB.

Signed-off-by: John Garry <john.g.garry@oracle.com>

Comments

Bart Van Assche May 4, 2025, 3:13 a.m. UTC | #1
On 5/1/25 3:02 AM, John Garry wrote:
> -#define DEF_ATOMIC_WR_MAX_LENGTH 8192
> +#define DEF_ATOMIC_WR_MAX_LENGTH 128

Shouldn't a comment be added next to this constant that mentions the
unit of this constant?

Bart.
John Garry May 4, 2025, 7:36 a.m. UTC | #2
On 04/05/2025 04:13, Bart Van Assche wrote:
> On 5/1/25 3:02 AM, John Garry wrote:
>> -#define DEF_ATOMIC_WR_MAX_LENGTH 8192
>> +#define DEF_ATOMIC_WR_MAX_LENGTH 128
> 
> Shouldn't a comment be added next to this constant that mentions the
> unit of this constant?
> 
It is implied that all these values which correspond to VPD page 
parameters are in logical blocks.
Martin K. Petersen May 6, 2025, 2:10 a.m. UTC | #3
John,

> The default atomic write max length in DEF_ATOMIC_WR_MAX_LENGTH is
> excessively large.

Applied to 6.16/scsi-staging, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 241a76761db8..160b7488baf1 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -163,7 +163,7 @@  static const char *sdebug_version_date = "20210520";
 #define DEF_VPD_USE_HOSTNO 1
 #define DEF_WRITESAME_LENGTH 0xFFFF
 #define DEF_ATOMIC_WR 1
-#define DEF_ATOMIC_WR_MAX_LENGTH 8192
+#define DEF_ATOMIC_WR_MAX_LENGTH 128
 #define DEF_ATOMIC_WR_ALIGN 2
 #define DEF_ATOMIC_WR_GRAN 2
 #define DEF_ATOMIC_WR_MAX_LENGTH_BNDRY (DEF_ATOMIC_WR_MAX_LENGTH)