public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Discard performance regression after "scsi: sd: Remove LBPRZ dependency for discards"
@ 2021-07-06  3:11 Wang Jianchao
  2021-07-08  3:23 ` Martin K. Petersen
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Jianchao @ 2021-07-06  3:11 UTC (permalink / raw)
  To: martin.petersen; +Cc: jejb, linux-scsi

Hi Martin

We have a sata ssd with following parameters,

  max_ws_blocks = 0
  max_unmap_blocks = 262143
  lbprz = 1
  lbpu = 1
  unmap_limit_for_ws = 0

But the discard performance is very different on 3.10 and 4.18 series,
On 3.10 series, the bw of discard is ~60G/s, but on 4.18, it is only ~2.7G/s
The reason is the discard_max_bytes,
3.10 series : 4294966784
4.18 series : 134217216

This difference happen after commit 
commit bcd069bb250acf6088b60d189ab3ec3ae8dd11a5 (scsi: sd: Remove LBPRZ dependency for discards)

@@ -2842,7 +2829,7 @@ static void sd_read_block_limits(struct scsi_disk *sdkp)
                                sd_config_discard(sdkp, SD_LBP_WS16);
 
                } else {        /* LBP VPD page tells us what to use */
-                       if (sdkp->lbpu && sdkp->max_unmap_blocks && !sdkp->lbprz)
+                       if (sdkp->lbpu && sdkp->max_unmap_blocks)
                                sd_config_discard(sdkp, SD_LBP_UNMAP);
                        else if (sdkp->lbpws)
                                sd_config_discard(sdkp, SD_LBP_WS16);

Before this commit, it enters SD_LBP_WS16 case, but after the patch, it enters SD_LBP_UNMAP.

Which should be the correct case ?

Thanks and Best regards
Jianchao

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-08  6:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-06  3:11 Discard performance regression after "scsi: sd: Remove LBPRZ dependency for discards" Wang Jianchao
2021-07-08  3:23 ` Martin K. Petersen
2021-07-08  6:05   ` Wang Jianchao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox