Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1460244

Re: [PATCH v5 2/2] Add support for SCT Write Same

From Tom Yan <tom.ty89@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 2/2] Add support for SCT Write Same
Date 2016-08-11 10:10 +0200
Message-ID <s4TdU-1ek-11@gated-at.bofh.it> (permalink)
References (2 earlier) <s4Gqo-b4-133@gated-at.bofh.it> <s4Gqo-b4-135@gated-at.bofh.it> <s4Gqo-b4-137@gated-at.bofh.it> <s4Gqo-b4-139@gated-at.bofh.it> <s4Gqo-b4-131@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 11 August 2016 at 02:29, Shaun Tancheff <shaun.tancheff@seagate.com> wrote:
>>
>> You are talking about an AF 4Kn drive I suppose? For a 512e drive it
>> should be only ~2G.
>
> I stand corrected. Since all the kernel math is 512 byte sectors you are
> absolutely correct and this isn't an issue at all.
>
> We should report SD_MAX_WS16_BLOCKS when only SCT
> is available and 4194240 when TRIM is available.

Why would you come up with such decision/conclusion? I thought
SD_MAX_WS16_BLOCKS could even be too big for 512e drive (~4G per WRITE
SAME command)?

If 4194240 (~2G per command) isn't too big for SCT Write Same, then we
shoud probably stick with it in both cases (when only SCT Write Same
is available / when TRIM is also available) to maintain consistency.

Also Maximum Write Same Length should be multiplied by the actual
logical sector size of the drive, which would be 4096 in the case of
4Kn drives. (If the kernel isn't doing that, it's simply a bug.)

Therefore, if I haven't missed anything, we'll need to divide
ATA_MAX_TRIM_RNUM by (logical sector size / 512) anyway, otherwise
discard_max_bytes and write_same_max_bytes would overflow with 4Kn
drive (i.e. Maximum Write Same Length needs to be <= 0xffffffff /
4096). 4Kn SSDs may not be a thing on the market yet, but apparently
it's a different story for traditional HDDs, and SCT Write Same isn't
only available on SSDs. The division should not change the current
behaviour on drives with 512-byte logical sectors.

I'll be sending a patch on that.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 2/2] Add support for SCT Write Same Shaun Tancheff <shaun@tancheff.com> - 2016-08-10 03:10 +0200
  Re: [PATCH v5 2/2] Add support for SCT Write Same Shaun Tancheff <shaun.tancheff@seagate.com> - 2016-08-10 20:30 +0200
    Re: [PATCH v5 2/2] Add support for SCT Write Same Tom Yan <tom.ty89@gmail.com> - 2016-08-11 10:10 +0200
  Re: [PATCH v5 2/2] Add support for SCT Write Same Tom Yan <tom.ty89@gmail.com> - 2016-08-10 20:40 +0200
    Re: [PATCH v5 2/2] Add support for SCT Write Same "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-08-11 03:50 +0200
      Re: [PATCH v5 2/2] Add support for SCT Write Same Tom Yan <tom.ty89@gmail.com> - 2016-08-11 10:50 +0200
        Re: [PATCH v5 2/2] Add support for SCT Write Same "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-08-12 03:20 +0200
  Re: [PATCH v5 2/2] Add support for SCT Write Same Tom Yan <tom.ty89@gmail.com> - 2016-08-10 20:50 +0200
    Re: [PATCH v5 2/2] Add support for SCT Write Same Tom Yan <tom.ty89@gmail.com> - 2016-08-10 22:20 +0200
      Re: [PATCH v5 2/2] Add support for SCT Write Same Shaun Tancheff <shaun.tancheff@seagate.com> - 2016-08-10 23:30 +0200
        Re: [PATCH v5 2/2] Add support for SCT Write Same "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-08-11 03:40 +0200

csiph-web