All of lore.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

* Re: Discard performance regression after "scsi: sd: Remove LBPRZ dependency for discards"
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Martin K. Petersen @ 2021-07-08  3:23 UTC (permalink / raw)
  To: Wang Jianchao; +Cc: martin.petersen, jejb, linux-scsi


Wang,

> 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

The device is explicitly asking for us to use UNMAP so the older kernel
choosing WRITE SAME(16) was not correct.

I have been working on an update to the discard/zeroing heuristics that
I'll post when 5.15 opens next week. But based on what's reported it by
your device we would still choose UNMAP for discards. LBPRZ only affects
which command we use for zeroing.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: Discard performance regression after "scsi: sd: Remove LBPRZ dependency for discards"
  2021-07-08  3:23 ` Martin K. Petersen
@ 2021-07-08  6:05   ` Wang Jianchao
  0 siblings, 0 replies; 3+ messages in thread
From: Wang Jianchao @ 2021-07-08  6:05 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: jejb, linux-scsi

Thanks so much for your comment, Martin ;)
That's really helpful.

Jianchao

On 2021/7/8 11:23 AM, Martin K. Petersen wrote:
> 
> Wang,
> 
>> 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
> 
> The device is explicitly asking for us to use UNMAP so the older kernel
> choosing WRITE SAME(16) was not correct.
> 
> I have been working on an update to the discard/zeroing heuristics that
> I'll post when 5.15 opens next week. But based on what's reported it by
> your device we would still choose UNMAP for discards. LBPRZ only affects
> which command we use for zeroing.
> 

^ 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.