Re: [PATCH] sd: fix uninitialized variable access in error handling

2016-10-21 Thread Shaun Tancheff
- if (ret) > + if (ret) { > + zone_blocks = 0; > goto out; > + } > > same = buf[4] & 0x0f; > if (same > 0) { > -- > 2.9.0 > Reviewed-by: Shaun Tancheff <shaun.tanch...@seagate.com> -- Shaun Tancheff

Re: [PATCH] sd: fix uninitialized variable access in error handling

2016-10-21 Thread Shaun Tancheff
zone_blocks = 0; > goto out; > + } > > same = buf[4] & 0x0f; > if (same > 0) { > -- > 2.9.0 > Reviewed-by: Shaun Tancheff -- Shaun Tancheff

Re: [PATCH] block: zoned: fix harmless maybe-uninitialized warning

2016-10-21 Thread Shaun Tancheff
s(struct block_device *bdev, > > } > > + *nr_zones = nz; > out: > bio_for_each_segment_all(bv, bio, i) > __free_page(bv->bv_page); > bio_put(bio); > > - if (ret == 0) > - *nr_zones = nz; > - > return r

Re: [PATCH] block: zoned: fix harmless maybe-uninitialized warning

2016-10-21 Thread Shaun Tancheff
gt; + *nr_zones = nz; > out: > bio_for_each_segment_all(bv, bio, i) > __free_page(bv->bv_page); > bio_put(bio); > > - if (ret == 0) > - *nr_zones = nz; > - > return ret; > } > EXPORT_SYMBOL_G

Re: [PATCH v5 2/4] fusion: remove iopriority handling

2016-10-13 Thread Shaun Tancheff
On Thu, Oct 13, 2016 at 6:00 PM, Adam Manzanares wrote: > The request priority is now by default coming from the ioc. It was not > clear what this code was trying to do based upon the iopriority class or > data. The driver should check that a device supports priorities

Re: [PATCH v5 2/4] fusion: remove iopriority handling

2016-10-13 Thread Shaun Tancheff
On Thu, Oct 13, 2016 at 6:00 PM, Adam Manzanares wrote: > The request priority is now by default coming from the ioc. It was not > clear what this code was trying to do based upon the iopriority class or > data. The driver should check that a device supports priorities and use > them according to

[PATCH v6 7/7] blk-zoned: implement ioctls

2016-09-30 Thread Shaun Tancheff
. The zone information result is passed as an array of struct blk_zone identical to the structure used internally for processing the REQ_OP_ZONE_REPORT operation. The BLKRESETZONE ioctl maps to a single call of the blkdev_reset_zones function. Signed-off-by: Shaun Tancheff <shaun.tanch...@seagate.

[PATCH v6 7/7] blk-zoned: implement ioctls

2016-09-30 Thread Shaun Tancheff
. The zone information result is passed as an array of struct blk_zone identical to the structure used internally for processing the REQ_OP_ZONE_REPORT operation. The BLKRESETZONE ioctl maps to a single call of the blkdev_reset_zones function. Signed-off-by: Shaun Tancheff Signed-off-by: Damien Le

[PATCH v6 5/7] block: Implement support for zoned block devices

2016-09-30 Thread Shaun Tancheff
n 512B sectors) of the zones of the device. Signed-off-by: Hannes Reinecke <h...@suse.de> [Damien: * Removed the zone cache * Implement report zones operation based on earlier proposal by Shaun Tancheff <shaun.tanch...@seagate.com>] Signed-off-by: Damien Le Moal <d

[PATCH v6 6/7] sd: Implement support for ZBC devices

2016-09-30 Thread Shaun Tancheff
t-processing based on code from Shaun Tancheff <shaun.tanch...@seagate.com> * Removed confusing use of 512B sector units in functions interface] Signed-off-by: Damien Le Moal <damien.lem...@hgst.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-b

[PATCH v6 5/7] block: Implement support for zoned block devices

2016-09-30 Thread Shaun Tancheff
) of the zones of the device. Signed-off-by: Hannes Reinecke [Damien: * Removed the zone cache * Implement report zones operation based on earlier proposal by Shaun Tancheff ] Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed

[PATCH v6 6/7] sd: Implement support for ZBC devices

2016-09-30 Thread Shaun Tancheff
Shaun Tancheff * Removed confusing use of 512B sector units in functions interface] Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Shaun Tancheff Tested-by: Shaun Tancheff --- Changes from v5: * Rebased on Jens' for-4.9/block branch (v5 is based

[PATCH v6 4/7] block: Define zoned block device operations

2016-09-30 Thread Shaun Tancheff
From: Shaun Tancheff <shaun.tanch...@seagate.com> Define REQ_OP_ZONE_REPORT and REQ_OP_ZONE_RESET for handling zones of host-managed and host-aware zoned block devices. With with these two new operations, the total number of operations defined reaches 8 and still fits with the 3 bits defi

[PATCH v6 4/7] block: Define zoned block device operations

2016-09-30 Thread Shaun Tancheff
From: Shaun Tancheff Define REQ_OP_ZONE_REPORT and REQ_OP_ZONE_RESET for handling zones of host-managed and host-aware zoned block devices. With with these two new operations, the total number of operations defined reaches 8 and still fits with the 3 bits definition of REQ_OP_BITS. Signed-off

[PATCH v6 3/7] block: update chunk_sectors in blk_stack_limits()

2016-09-30 Thread Shaun Tancheff
From: Hannes Reinecke <h...@suse.de> Signed-off-by: Hannes Reinecke <h...@suse.com> Signed-off-by: Damien Le Moal <damien.lem...@hgst.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> Reviewed-b

[PATCH v6 3/7] block: update chunk_sectors in blk_stack_limits()

2016-09-30 Thread Shaun Tancheff
From: Hannes Reinecke Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Shaun Tancheff Tested-by: Shaun Tancheff --- block/blk-settings.c | 4 1 file changed, 4 insertions(+) diff --git a/block

[PATCH v6 2/7] blk-sysfs: Add 'chunk_sectors' to sysfs attributes

2016-09-30 Thread Shaun Tancheff
lem...@hgst.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> Reviewed-by: Shaun Tancheff <shaun.tanch...@seagate.com> Tested-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- Documentation/ABI/testing/sysfs-b

[PATCH v6 2/7] blk-sysfs: Add 'chunk_sectors' to sysfs attributes

2016-09-30 Thread Shaun Tancheff
. Petersen Reviewed-by: Shaun Tancheff Tested-by: Shaun Tancheff --- Documentation/ABI/testing/sysfs-block | 13 + block/blk-sysfs.c | 11 +++ 2 files changed, 24 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing

[PATCH v6 1/7] block: Add 'zoned' queue limit

2016-09-30 Thread Shaun Tancheff
as "host-managed". Signed-off-by: Damien Le Moal <damien.lem...@hgst.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> Reviewed-by: Shaun Tancheff <shaun.tanch...@seagate.com> Tested-by: Shaun Tancheff <s

[PATCH v6 1/7] block: Add 'zoned' queue limit

2016-09-30 Thread Shaun Tancheff
Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Shaun Tancheff Tested-by: Shaun Tancheff --- Documentation/ABI/testing/sysfs-block | 16 block/blk-settings.c | 1 + block/blk-sysfs.c | 18

[PATCH v6 0/7] ZBC / Zoned block device support

2016-09-30 Thread Shaun Tancheff
This series introduces support for zoned block devices. It integrates earlier submissions by Hannes Reinecke, Damien Le Moal and Shaun Tancheff. Compared to the previous series version, the code was significantly simplified by limiting support to zoned devices satisfying the following conditions

[PATCH v6 0/7] ZBC / Zoned block device support

2016-09-30 Thread Shaun Tancheff
This series introduces support for zoned block devices. It integrates earlier submissions by Hannes Reinecke, Damien Le Moal and Shaun Tancheff. Compared to the previous series version, the code was significantly simplified by limiting support to zoned devices satisfying the following conditions

Re: BUG Re: mm: vma_merge: fix vm_page_prot SMP race condition against rmap_walk

2016-09-27 Thread Shaun Tancheff
Confirmed: - Removing DEBUG_VM_RB fixes the hang. Also confirmed: - Above patch fixes the hang when DEBUG_VM_RB is re-enabled. Thanks! On Tue, Sep 27, 2016 at 11:05 AM, Andrea Arcangeli <aarca...@redhat.com> wrote: > Hello, > > On Tue, Sep 27, 2016 at 05:16:15AM -0500, Shaun

Re: BUG Re: mm: vma_merge: fix vm_page_prot SMP race condition against rmap_walk

2016-09-27 Thread Shaun Tancheff
Confirmed: - Removing DEBUG_VM_RB fixes the hang. Also confirmed: - Above patch fixes the hang when DEBUG_VM_RB is re-enabled. Thanks! On Tue, Sep 27, 2016 at 11:05 AM, Andrea Arcangeli wrote: > Hello, > > On Tue, Sep 27, 2016 at 05:16:15AM -0500, Shaun Tancheff wrote: >

BUG Re: mm: vma_merge: fix vm_page_prot SMP race condition against rmap_walk

2016-09-27 Thread Shaun Tancheff
is a solid hang after boot and switch to starting gnome session. Hang at about 35s. kdbg traceback is all null entries. Let me know what additional information I can provide. Regards, Shaun Tancheff

BUG Re: mm: vma_merge: fix vm_page_prot SMP race condition against rmap_walk

2016-09-27 Thread Shaun Tancheff
is a solid hang after boot and switch to starting gnome session. Hang at about 35s. kdbg traceback is all null entries. Let me know what additional information I can provide. Regards, Shaun Tancheff

Re: UFS API in the kernel

2016-09-26 Thread Shaun Tancheff
-nebmJJ0Kp8A=Wg5NqlNlVTT7Ugl8V50qIHLe856QW0qfG3WVYGOrWzA=vJFB6pCywWtdvkgHz9Vc0jQz0xzeyZlr-7eCWYu88nM=yiQLPFpqmMrbqLZz1Jb3aNqOje2dRMLJHEzUDobwcXc= -- Shaun Tancheff

Re: UFS API in the kernel

2016-09-26 Thread Shaun Tancheff
send the line "unsubscribe linux-scsi" in > the body of a message to majord...@vger.kernel.org > More majordomo info at > https://urldefense.proofpoint.com/v2/url?u=http-3A__vger.kernel.org_majordomo-2Dinfo.html=DQICaQ=IGDlg0lD0b-nebmJJ0Kp8A=Wg5NqlNlVTT7Ugl8V50qIHLe856QW0qfG3WVYGOrWzA=vJFB6pC

Re: [PATCH v8 1/2 RESEND] Add bio/request flags to issue ZBC/ZAC commands

2016-08-25 Thread Shaun Tancheff
On Thu, Aug 25, 2016 at 9:31 PM, Damien Le Moal <damien.lem...@hgst.com> wrote: > > Shaun, > > On 8/25/16 05:24, Shaun Tancheff wrote: >> >> (RESENDING to include f2fs, fs-devel and dm-devel) >> >> Add op flags to access to zone information

Re: [PATCH v8 1/2 RESEND] Add bio/request flags to issue ZBC/ZAC commands

2016-08-25 Thread Shaun Tancheff
On Thu, Aug 25, 2016 at 9:31 PM, Damien Le Moal wrote: > > Shaun, > > On 8/25/16 05:24, Shaun Tancheff wrote: >> >> (RESENDING to include f2fs, fs-devel and dm-devel) >> >> Add op flags to access to zone information as well as open, close >> and reset zon

Re: [PATCH v6 3/4 RESEND] SCT Write Same / DSM Trim

2016-08-25 Thread Shaun Tancheff
On Thu, Aug 25, 2016 at 2:01 AM, Tom Yan wrote: > Really please just drop this patch. There is no rational reason for > you to associate the maximum payload size to the logical sector size. Been over this many, many times now. It has to do with the size of the buffer setup

Re: [PATCH v6 3/4 RESEND] SCT Write Same / DSM Trim

2016-08-25 Thread Shaun Tancheff
On Thu, Aug 25, 2016 at 2:01 AM, Tom Yan wrote: > Really please just drop this patch. There is no rational reason for > you to associate the maximum payload size to the logical sector size. Been over this many, many times now. It has to do with the size of the buffer setup through WRITE SAME in

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

2016-08-25 Thread Shaun Tancheff
On Thu, Aug 25, 2016 at 1:23 AM, Tom Yan wrote: > You only fill the bytes that you want to to set explicitly: > > + put_unaligned_le16(0x0002, [0]); /* SCT_ACT_WRITE_SAME */ > + put_unaligned_le16(0x0101, [1]); /* WRITE PTRN FG */ > +

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

2016-08-25 Thread Shaun Tancheff
On Thu, Aug 25, 2016 at 1:23 AM, Tom Yan wrote: > You only fill the bytes that you want to to set explicitly: > > + put_unaligned_le16(0x0002, [0]); /* SCT_ACT_WRITE_SAME */ > + put_unaligned_le16(0x0101, [1]); /* WRITE PTRN FG */ > + put_unaligned_le64(lba, [2]); > +

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-25 Thread Shaun Tancheff
On Thu, Aug 25, 2016 at 1:31 AM, Tom Yan <tom.t...@gmail.com> wrote: > On 25 August 2016 at 05:28, Shaun Tancheff <shaun.tanch...@seagate.com> wrote: >> On Wed, Aug 24, 2016 at 12:31 AM, Tom Yan <tom.t...@gmail.com> wrote: >>> On 24 August 2016 at 11:33,

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-25 Thread Shaun Tancheff
On Thu, Aug 25, 2016 at 1:31 AM, Tom Yan wrote: > On 25 August 2016 at 05:28, Shaun Tancheff wrote: >> On Wed, Aug 24, 2016 at 12:31 AM, Tom Yan wrote: >>> On 24 August 2016 at 11:33, Martin K. Petersen >>> wrote: >>>>>>>>> "To

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

2016-08-24 Thread Shaun Tancheff
On Wed, Aug 24, 2016 at 1:10 AM, Tom Yan wrote: > Btw, I wonder if you need to memset your buffer with 0 first, like > what is done in ata_scsi_rbuf_get. It is not necessary as the defined buffer is completely filled out here. Are you thinking as a sort of future proofing?

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

2016-08-24 Thread Shaun Tancheff
On Wed, Aug 24, 2016 at 1:10 AM, Tom Yan wrote: > Btw, I wonder if you need to memset your buffer with 0 first, like > what is done in ata_scsi_rbuf_get. It is not necessary as the defined buffer is completely filled out here. Are you thinking as a sort of future proofing? Ex: In the unlikely

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-24 Thread Shaun Tancheff
mplete however many bytes the command acted upon. Unlike reads >> and writes there is not a 1:1 mapping between the transfer length and >> the affected area. So we do a bit of magic after the buffer has been >> mapped to ensure that the completion byte count matches the number of >> blocks that were affected by the command rather than the size of the >> data buffer in bytes. >> >> -- >> Martin K. Petersen Oracle Linux Engineering -- Shaun Tancheff

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-24 Thread Shaun Tancheff
rites there is not a 1:1 mapping between the transfer length and >> the affected area. So we do a bit of magic after the buffer has been >> mapped to ensure that the completion byte count matches the number of >> blocks that were affected by the command rather than the size of the >> data buffer in bytes. >> >> -- >> Martin K. Petersen Oracle Linux Engineering -- Shaun Tancheff

Re: [PATCH 1/2] f2fs: detect host-managed SMR by feature flag

2016-08-24 Thread Shaun Tancheff
es, so once I can retrieve the zone information from the device, surely I'll > add that. I have posted some patches that will allow you to retrieve the zone information for both HA and HM drives. Can you see if this would meet your needs? The data is returned to the BIO is in the same (drive) format as SG_IO. >> Also, I think that the DISCARD option must be enabled by default for >> HMSMR disks. Otherwise, zones write pointer will never get reset. >> The same applies to HASMR devices mounted with the LFS mode. >> (In any case, the discard handling does not look like it will always >> align to the device zone size, which will fail on a zoned disk (discard >> granularity is the zone size). I may be missing something though. Still >> checking.) > > Yup, will do. BTW, I remember I fixed zone-aligned discard issue before. > Could you please check the latest dev-test branch in f2fs.git? > I'm used to rebase that branch occasionally when I changed the previous > patches. I think you will need to have the have access to the zone information. Regards, Shaun Tancheff

Re: [PATCH 1/2] f2fs: detect host-managed SMR by feature flag

2016-08-24 Thread Shaun Tancheff
he device, surely I'll > add that. I have posted some patches that will allow you to retrieve the zone information for both HA and HM drives. Can you see if this would meet your needs? The data is returned to the BIO is in the same (drive) format as SG_IO. >> Also, I think that the DISCARD option must be enabled by default for >> HMSMR disks. Otherwise, zones write pointer will never get reset. >> The same applies to HASMR devices mounted with the LFS mode. >> (In any case, the discard handling does not look like it will always >> align to the device zone size, which will fail on a zoned disk (discard >> granularity is the zone size). I may be missing something though. Still >> checking.) > > Yup, will do. BTW, I remember I fixed zone-aligned discard issue before. > Could you please check the latest dev-test branch in f2fs.git? > I'm used to rebase that branch occasionally when I changed the previous > patches. I think you will need to have the have access to the zone information. Regards, Shaun Tancheff

[PATCH v8 2/2 RESEND] Add ioctl to issue ZBC/ZAC commands via block layer

2016-08-24 Thread Shaun Tancheff
(RESENDING to include f2fs, fs-devel and dm-devel) Add support for ZBC ioctl's BLKREPORT - Issue Report Zones to device. BLKZONEACTION - Issue a Zone Action (Close, Finish, Open, or Reset) Signed-off-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- v8: - Changed ioctl fo

[PATCH v8 2/2 RESEND] Add ioctl to issue ZBC/ZAC commands via block layer

2016-08-24 Thread Shaun Tancheff
(RESENDING to include f2fs, fs-devel and dm-devel) Add support for ZBC ioctl's BLKREPORT - Issue Report Zones to device. BLKZONEACTION - Issue a Zone Action (Close, Finish, Open, or Reset) Signed-off-by: Shaun Tancheff --- v8: - Changed ioctl for zone actions to a single ioctl

[PATCH v8 1/2 RESEND] Add bio/request flags to issue ZBC/ZAC commands

2016-08-24 Thread Shaun Tancheff
-off-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- v8: - Added Finish Zone op - Fixed report zones copy to user to work when HARDENED_USERCOPY is enabled v6: - Added GFP_DMA to gfp mask. v5: - In sd_setup_zone_action_cmnd, remove unused vars and fix switch indent - In blk-l

[PATCH v8 1/2 RESEND] Add bio/request flags to issue ZBC/ZAC commands

2016-08-24 Thread Shaun Tancheff
-off-by: Shaun Tancheff --- v8: - Added Finish Zone op - Fixed report zones copy to user to work when HARDENED_USERCOPY is enabled v6: - Added GFP_DMA to gfp mask. v5: - In sd_setup_zone_action_cmnd, remove unused vars and fix switch indent - In blk-lib fix documentation v4: - Rebase on linux

[PATCH v8 0/2 RESEND] Block layer support ZAC/ZBC commands

2016-08-24 Thread Shaun Tancheff
sepeartion of bio op from flags. - Fixed memory leak in blkdev_issue_zone_report failing to put_bio(). - Documented opt in blkdev_issue_zone_report. - Moved include/uapi/linux/fs.h changes to patch 3 - Fixed commit message for first patch in series. Shaun Tancheff (2): Add bio/request flags

[PATCH v8 0/2 RESEND] Block layer support ZAC/ZBC commands

2016-08-24 Thread Shaun Tancheff
sepeartion of bio op from flags. - Fixed memory leak in blkdev_issue_zone_report failing to put_bio(). - Documented opt in blkdev_issue_zone_report. - Moved include/uapi/linux/fs.h changes to patch 3 - Fixed commit message for first patch in series. Shaun Tancheff (2): Add bio/request flags

[PATCH v6 3/4 RESEND] SCT Write Same / DSM Trim

2016-08-24 Thread Shaun Tancheff
accordingly. The ACS-2 specification is quite clear that the DSM command payload is sized as number of 512 byte transfers so a 4Kn device will operate correctly without this patch. Signed-off-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- v5: - Reshuffled descripton. - Added s

[PATCH v6 3/4 RESEND] SCT Write Same / DSM Trim

2016-08-24 Thread Shaun Tancheff
accordingly. The ACS-2 specification is quite clear that the DSM command payload is sized as number of 512 byte transfers so a 4Kn device will operate correctly without this patch. Signed-off-by: Shaun Tancheff --- v5: - Reshuffled descripton. - Added support for a sector_size descriptor other than 512

Re: [PATCH v2 2/4] On Discard either do Reset WP or Write Same

2016-08-23 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 8:25 PM, Damien Le Moal <damien.lem...@hgst.com> wrote: > > Shaun, > > On 8/23/16 09:22, Shaun Tancheff wrote: >> On Mon, Aug 22, 2016 at 6:57 PM, Damien Le Moal <damien.lem...@hgst.com> >> wrote: >> Also you may note

Re: [PATCH v2 2/4] On Discard either do Reset WP or Write Same

2016-08-23 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 8:25 PM, Damien Le Moal wrote: > > Shaun, > > On 8/23/16 09:22, Shaun Tancheff wrote: >> On Mon, Aug 22, 2016 at 6:57 PM, Damien Le Moal >> wrote: >> Also you may note that in my patch to get Host Aware working >> with the zone

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

2016-08-23 Thread Shaun Tancheff
On Tue, Aug 23, 2016 at 5:37 AM, Tom Yan <tom.t...@gmail.com> wrote: > On 22 August 2016 at 04:23, Shaun Tancheff <sh...@tancheff.com> wrote: >> +/** >> + * ata_format_dsm_trim_descr() - SATL Write Same to ATA SCT Write Same >> + * @cmd: SCSI command being transl

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

2016-08-23 Thread Shaun Tancheff
On Tue, Aug 23, 2016 at 5:37 AM, Tom Yan wrote: > On 22 August 2016 at 04:23, Shaun Tancheff wrote: >> +/** >> + * ata_format_dsm_trim_descr() - SATL Write Same to ATA SCT Write Same >> + * @cmd: SCSI command being translated >> + * @lba: Starting sector >> +

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-23 Thread Shaun Tancheff
On Tue, Aug 23, 2016 at 2:53 AM, Tom Yan <tom.t...@gmail.com> wrote: > On 23 August 2016 at 06:20, Shaun Tancheff <shaun.tanch...@seagate.com> wrote: >> On Tue, Aug 23, 2016 at 12:26 AM, Tom Yan <tom.t...@gmail.com> wrote: >> >>> It is always 1 merely

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-23 Thread Shaun Tancheff
On Tue, Aug 23, 2016 at 2:53 AM, Tom Yan wrote: > On 23 August 2016 at 06:20, Shaun Tancheff wrote: >> On Tue, Aug 23, 2016 at 12:26 AM, Tom Yan wrote: >> >>> It is always 1 merely because we prefer sticking to that. Say we want >>> to enable multi-block p

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-23 Thread Shaun Tancheff
as a payload of a single logical sector. > Also note that the payload is NOT always fully-filled. Oh, I was considering filling the remainder of the buffer with 0's using memset() as you described to be "filly-filled" in this case. Sorry for the confusion. -- Shaun Tancheff

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-23 Thread Shaun Tancheff
ogical sector. > Also note that the payload is NOT always fully-filled. Oh, I was considering filling the remainder of the buffer with 0's using memset() as you described to be "filly-filled" in this case. Sorry for the confusion. -- Shaun Tancheff

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

2016-08-23 Thread Shaun Tancheff
t; (Didn't we come to an conclusion on that as well?) I had thought the conclusion was leave b0 as is and let the WS10 limit take effect per Martin. -- Shaun Tancheff

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

2016-08-23 Thread Shaun Tancheff
n conclusion on that as well?) I had thought the conclusion was leave b0 as is and let the WS10 limit take effect per Martin. -- Shaun Tancheff

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-22 Thread Shaun Tancheff
let it be. > So I don't think it makes any sense to check ATA_SCSI_RBUF_SIZE > against 512 here. Again, not sure I agree, but I don't really care on that point. Just many years of defensive coding. > On 22 August 2016 at 22:00, Shaun Tancheff <shaun.tanch...@seagate.com> wro

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-22 Thread Shaun Tancheff
; So I don't think it makes any sense to check ATA_SCSI_RBUF_SIZE > against 512 here. Again, not sure I agree, but I don't really care on that point. Just many years of defensive coding. > On 22 August 2016 at 22:00, Shaun Tancheff wrote: >> Because this is re-using the response buffer

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

2016-08-22 Thread Shaun Tancheff
ack. The SATL code being used to emulating SCSI Write Same which does have a limited number of sectors .. so falling back to the SCSI limit seems reasonable. So the limit that is being applied is either the current TRIM limit, or the SCSI Write Same limit. -- Shaun Tancheff

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

2016-08-22 Thread Shaun Tancheff
sed to emulating SCSI Write Same which does have a limited number of sectors .. so falling back to the SCSI limit seems reasonable. So the limit that is being applied is either the current TRIM limit, or the SCSI Write Same limit. -- Shaun Tancheff

Re: [PATCH v2 2/4] On Discard either do Reset WP or Write Same

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 6:57 PM, Damien Le Moal <damien.lem...@hgst.com> wrote: > > Shaun, > > On 8/22/16 13:31, Shaun Tancheff wrote: > [...] >> -int sd_zbc_setup_discard(struct scsi_disk *sdkp, struct request *rq, >> - sector_t sector,

Re: [PATCH v2 2/4] On Discard either do Reset WP or Write Same

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 6:57 PM, Damien Le Moal wrote: > > Shaun, > > On 8/22/16 13:31, Shaun Tancheff wrote: > [...] >> -int sd_zbc_setup_discard(struct scsi_disk *sdkp, struct request *rq, >> - sector_t sector, unsigned int num_sectors) >>

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

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 3:14 PM, Tom Yan <tom.t...@gmail.com> wrote: > On 23 August 2016 at 03:43, Shaun Tancheff <shaun.tanch...@seagate.com> wrote: >> >> Why would we enforce upper level limits on something that doesn't >> have any? > > If we advertise a li

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

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 3:14 PM, Tom Yan wrote: > On 23 August 2016 at 03:43, Shaun Tancheff wrote: >> >> Why would we enforce upper level limits on something that doesn't >> have any? > > If we advertise a limit in our SATL, it makes sense that we should > make su

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 4:20 PM, Tom Yan <tom.t...@gmail.com> wrote: > On 22 August 2016 at 04:23, Shaun Tancheff <sh...@tancheff.com> wrote: >> Safely overwriting the attached page to ATA format from the SCSI formatted >> variant. >> >> Signed-off-by: Sha

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 4:20 PM, Tom Yan wrote: > On 22 August 2016 at 04:23, Shaun Tancheff wrote: >> Safely overwriting the attached page to ATA format from the SCSI formatted >> variant. >> >> Signed-off-by: Shaun Tancheff >> --- >> v6: >> - Fix

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 2:27 PM, Tom Yan <tom.t...@gmail.com> wrote: > On 22 August 2016 at 12:23, Shaun Tancheff <sh...@tancheff.com> wrote: >> Safely overwriting the attached page to ATA format from the SCSI formatted >> variant. >> >> Signed-off-by: Sha

Re: [PATCH v6 1/4] libata: Safely overwrite attached page in WRITE SAME xlat

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 2:27 PM, Tom Yan wrote: > On 22 August 2016 at 12:23, Shaun Tancheff wrote: >> Safely overwriting the attached page to ATA format from the SCSI formatted >> variant. >> >> Signed-off-by: Shaun Tancheff >> --- >> v6: >> - Fix

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

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 2:20 PM, Tom Yan <tom.t...@gmail.com> wrote: > On 22 August 2016 at 12:23, Shaun Tancheff <sh...@tancheff.com> wrote: >> SATA drives may support write same via SCT. This is useful >> for setting the drive contents to a specific pattern (0's). &

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

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 2:20 PM, Tom Yan wrote: > On 22 August 2016 at 12:23, Shaun Tancheff wrote: >> SATA drives may support write same via SCT. This is useful >> for setting the drive contents to a specific pattern (0's). >> >> Translate a SCSI WRITE SAME 16 comm

Re: [PATCH v6 3/4] SCT Write Same / DSM Trim

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 12:02 PM, Tom Yan <tom.t...@gmail.com> wrote: > On 22 August 2016 at 15:04, Shaun Tancheff <shaun.tanch...@seagate.com> wrote: >> On Mon, Aug 22, 2016 at 3:33 AM, Tom Yan <tom.t...@gmail.com> wrote: >>> On 22 August 2016 at 08:31

Re: [PATCH v6 3/4] SCT Write Same / DSM Trim

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 12:02 PM, Tom Yan wrote: > On 22 August 2016 at 15:04, Shaun Tancheff wrote: >> On Mon, Aug 22, 2016 at 3:33 AM, Tom Yan wrote: >>> On 22 August 2016 at 08:31, Tom Yan wrote: > Since I have no experience with SCT Write Same at all, and neither do

Re: [PATCH 2/2] Migrate zone cache from RB-Tree to arrays of descriptors

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 2:11 AM, Hannes Reinecke <h...@suse.de> wrote: > On 08/22/2016 06:34 AM, Shaun Tancheff wrote: >> Currently the RB-Tree zone cache is fast and flexible. It does >> use a rather largish amount of ram. This model reduces the ram >> required from 120

Re: [PATCH 2/2] Migrate zone cache from RB-Tree to arrays of descriptors

2016-08-22 Thread Shaun Tancheff
On Mon, Aug 22, 2016 at 2:11 AM, Hannes Reinecke wrote: > On 08/22/2016 06:34 AM, Shaun Tancheff wrote: >> Currently the RB-Tree zone cache is fast and flexible. It does >> use a rather largish amount of ram. This model reduces the ram >> required from 120 bytes per zone

Re: [PATCH v6 3/4] SCT Write Same / DSM Trim

2016-08-22 Thread Shaun Tancheff
Trim faster than they can Write Same, However the internal implementation is opaque so I can't say if Write Same is often implemented in terms of TRIM or not. I mean that's how _I_ do it [Write 1 block and map N blocks to it], But not every FTL will have come to the same conclusion. I also suspect that given the choice for most use casess that TRIM is preferred over WS when TRIM supports returning zeroed blocks. -- Shaun Tancheff

Re: [PATCH v6 3/4] SCT Write Same / DSM Trim

2016-08-22 Thread Shaun Tancheff
er the internal implementation is opaque so I can't say if Write Same is often implemented in terms of TRIM or not. I mean that's how _I_ do it [Write 1 block and map N blocks to it], But not every FTL will have come to the same conclusion. I also suspect that given the choice for most use casess that TRIM is preferred over WS when TRIM supports returning zeroed blocks. -- Shaun Tancheff

Re: [PATCH 2/2] Migrate zone cache from RB-Tree to arrays of descriptors

2016-08-21 Thread Shaun Tancheff
On Sun, Aug 21, 2016 at 11:34 PM, Shaun Tancheff <sh...@tancheff.com> wrote: > Currently the RB-Tree zone cache is fast and flexible. It does > use a rather largish amount of ram. This model reduces the ram > required from 120 bytes per zone to 16 bytes per zone with a > moder

Re: [PATCH 2/2] Migrate zone cache from RB-Tree to arrays of descriptors

2016-08-21 Thread Shaun Tancheff
On Sun, Aug 21, 2016 at 11:34 PM, Shaun Tancheff wrote: > Currently the RB-Tree zone cache is fast and flexible. It does > use a rather largish amount of ram. This model reduces the ram > required from 120 bytes per zone to 16 bytes per zone with a > moderate transformation of the blk

[PATCH 2/2] Migrate zone cache from RB-Tree to arrays of descriptors

2016-08-21 Thread Shaun Tancheff
. Signed-off-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- block/blk-core.c |2 +- block/blk-sysfs.c | 31 +- block/blk-zoned.c | 103 +++-- drivers/scsi/sd.c |5 +- drivers/scsi/sd.h |4 +- drivers/scsi/sd_zbc.c

[PATCH 2/2] Migrate zone cache from RB-Tree to arrays of descriptors

2016-08-21 Thread Shaun Tancheff
. Signed-off-by: Shaun Tancheff --- block/blk-core.c |2 +- block/blk-sysfs.c | 31 +- block/blk-zoned.c | 103 +++-- drivers/scsi/sd.c |5 +- drivers/scsi/sd.h |4 +- drivers/scsi/sd_zbc.c | 1025 +++- include

[PATCH 1/2] Move ZBC core setup to sd_zbc

2016-08-21 Thread Shaun Tancheff
Move the remaining ZBC specific code to sd_zbc.c Signed-off-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- drivers/scsi/sd.c | 65 +-- drivers/scsi/sd.h | 20 ++ drivers/scsi/sd_zbc.c | 170 +++--- 3 files c

[PATCH 1/2] Move ZBC core setup to sd_zbc

2016-08-21 Thread Shaun Tancheff
Move the remaining ZBC specific code to sd_zbc.c Signed-off-by: Shaun Tancheff --- drivers/scsi/sd.c | 65 +-- drivers/scsi/sd.h | 20 ++ drivers/scsi/sd_zbc.c | 170 +++--- 3 files changed, 126 insertions(+), 129

[PATCH 0/2] Change zone cache format to use less memory

2016-08-21 Thread Shaun Tancheff
. Shaun Tancheff (2): Move ZBC core setup to sd_zbc Migrate zone cache from RB-Tree to arrays of descriptors block/blk-core.c |2 +- block/blk-sysfs.c | 31 +- block/blk-zoned.c | 103 +++-- drivers/scsi/sd.c | 66 +-- drivers/scsi/sd.h | 20 +- drivers

[PATCH 0/2] Change zone cache format to use less memory

2016-08-21 Thread Shaun Tancheff
. Shaun Tancheff (2): Move ZBC core setup to sd_zbc Migrate zone cache from RB-Tree to arrays of descriptors block/blk-core.c |2 +- block/blk-sysfs.c | 31 +- block/blk-zoned.c | 103 +++-- drivers/scsi/sd.c | 66 +-- drivers/scsi/sd.h | 20 +- drivers

[PATCH v2 4/4] Integrate ZBC command requests with zone cache.

2016-08-21 Thread Shaun Tancheff
and Finish zones having no other analog are sent directly to the device. On successful completion each zone action will update the zone cache as appropriate. Signed-off-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- block/blk-lib.c | 16 -- drivers/scsi/sd.c | 42 +++- driver

[PATCH v2 4/4] Integrate ZBC command requests with zone cache.

2016-08-21 Thread Shaun Tancheff
and Finish zones having no other analog are sent directly to the device. On successful completion each zone action will update the zone cache as appropriate. Signed-off-by: Shaun Tancheff --- block/blk-lib.c | 16 -- drivers/scsi/sd.c | 42 +++- drivers/scsi/sd.h | 22 +- drivers

[PATCH v2 2/4] On Discard either do Reset WP or Write Same

2016-08-21 Thread Shaun Tancheff
when the WP indicates that 2000 blocks in the zone are in use and the discard indicated 1000 blocks can be unmapped the discard should fail as a Reset WP will unmap all the 2000 blocks in the zone. Signed-off-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- drivers/scsi/sd.c

[PATCH v2 3/4] Merge ZBC constants

2016-08-21 Thread Shaun Tancheff
Dedupe ZBC/ZAC constants used for reporting options, same code, zone condition and zone type. These are all useful to programs consuming zone information from user space as well so include them in a uapi header. Signed-off-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- block/blk

[PATCH v2 2/4] On Discard either do Reset WP or Write Same

2016-08-21 Thread Shaun Tancheff
when the WP indicates that 2000 blocks in the zone are in use and the discard indicated 1000 blocks can be unmapped the discard should fail as a Reset WP will unmap all the 2000 blocks in the zone. Signed-off-by: Shaun Tancheff --- drivers/scsi/sd.c | 45 ++--- drivers/scsi/sd.h

[PATCH v2 3/4] Merge ZBC constants

2016-08-21 Thread Shaun Tancheff
Dedupe ZBC/ZAC constants used for reporting options, same code, zone condition and zone type. These are all useful to programs consuming zone information from user space as well so include them in a uapi header. Signed-off-by: Shaun Tancheff --- block/blk-lib.c | 4

[PATCH v2 0/4] Integrate bio/request ZBC ops with zone cache

2016-08-21 Thread Shaun Tancheff
-rc2%2Bbiof.v9 g...@github.com:stancheff/linux.git v4.8-rc2+biof.v9 v2: - Fully integrated bio <-> zone cache [<-> device] - Added discard -> write same for conventional zones. - Merged disparate constants into a canonical set. Shaun Tancheff (4): Enable support for Se

[PATCH v2 0/4] Integrate bio/request ZBC ops with zone cache

2016-08-21 Thread Shaun Tancheff
-rc2%2Bbiof.v9 g...@github.com:stancheff/linux.git v4.8-rc2+biof.v9 v2: - Fully integrated bio <-> zone cache [<-> device] - Added discard -> write same for conventional zones. - Merged disparate constants into a canonical set. Shaun Tancheff (4): Enable support for Se

[PATCH v2 1/4] Enable support for Seagate HostAware drives

2016-08-21 Thread Shaun Tancheff
Seagate drives report a SAME code of 0 due to having: - Zones of different types (CMR zones at the low LBA space). - Zones of different size (A terminating 'runt' zone in the high lba space). Support loading the zone topology into the zone cache. Signed-off-by: Shaun Tancheff

[PATCH v2 1/4] Enable support for Seagate HostAware drives

2016-08-21 Thread Shaun Tancheff
Seagate drives report a SAME code of 0 due to having: - Zones of different types (CMR zones at the low LBA space). - Zones of different size (A terminating 'runt' zone in the high lba space). Support loading the zone topology into the zone cache. Signed-off-by: Shaun Tancheff

[PATCH v6 4/4] SCT Write Same handle ATA_DFLAG_PIO

2016-08-21 Thread Shaun Tancheff
Use non DMA write log when ATA_DFLAG_PIO is set. Signed-off-by: Shaun Tancheff <shaun.tanch...@seagate.com> --- v6: Added check for ATA_DFLAG_PIO and fallback to non DMA write log for SCT Write Same drivers/ata/libata-scsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drive

[PATCH v6 4/4] SCT Write Same handle ATA_DFLAG_PIO

2016-08-21 Thread Shaun Tancheff
Use non DMA write log when ATA_DFLAG_PIO is set. Signed-off-by: Shaun Tancheff --- v6: Added check for ATA_DFLAG_PIO and fallback to non DMA write log for SCT Write Same drivers/ata/libata-scsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata

  1   2   >