On Wed, Mar 29, 2023 at 09:24:11PM +0900, Damien Le Moal wrote: > On 3/29/23 19:41, Nitesh Shetty wrote: > >>> +What: /sys/block/<disk>/queue/copy_max_bytes > >>> +Date: November 2022 > >>> +Contact: linux-block@xxxxxxxxxxxxxxx > >>> +Description: > >>> + [RW] While 'copy_max_bytes_hw' is the hardware limit for the > >>> + device, 'copy_max_bytes' setting is the software limit. > >>> + Setting this value lower will make Linux issue smaller size > >>> + copies from block layer. > >> > >> This is the maximum number of bytes that the block > >> layer will allow for a copy request. Must be smaller than > >> or equal to the maximum size allowed by the hardware indicated > > > > Looks good. Will update in next version. We took reference from discard. > > > >> by copy_max_bytes_hw. Write 0 to use the default kernel > >> settings. > >> > > > > Nack, writing 0 will not set it to default value. (default value is > > copy_max_bytes = copy_max_bytes_hw) > > It is trivial to make it work that way, which would match how max_sectors_kb > works. Write 0 to return copy_max_bytes being equal to the default > copy_max_bytes_hw. > > The other possibility that is also interesting is "write 0 to disable copy > offload and use emulation". This one may actually be more useful. > We were following discard implementation. I feel now both options are good. We can finalize based on community feedback. > > > >>> + > >>> + > >>> +What: /sys/block/<disk>/queue/copy_max_bytes_hw > >>> +Date: November 2022 > >>> +Contact: linux-block@xxxxxxxxxxxxxxx > >>> +Description: > >>> + [RO] Devices that support offloading copy functionality may have > >>> + internal limits on the number of bytes that can be offloaded > >>> + in a single operation. The `copy_max_bytes_hw` > >>> + parameter is set by the device driver to the maximum number of > >>> + bytes that can be copied in a single operation. Copy > >>> + requests issued to the device must not exceed this limit. > >>> + A value of 0 means that the device does not > >>> + support copy offload. > >> > >> [RO] This is the maximum number of kilobytes supported in a > >> single data copy offload operation. A value of 0 means that the > >> device does not support copy offload. > >> > > > > Nack, value is in bytes. Same as discard. > > Typo. I meant Bytes. Your text is too long an too convoluted, so unclear. > Acked, will update in next version > -- > Damien Le Moal > Western Digital Research > >