[PATCH 15/27] nvme: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
But now for the real NVMe Write Zeroes yet, just to get rid of the discard abuse for zeroing. Also rename the quirk flag to be a bit more self-explanatory. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke

[PATCH 1/5] nvme: move ->retries setup to nvme_setup_cmd

2017-04-05 Thread Christoph Hellwig
This way we get the behavior right for the non-PCIe transports. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 5 + drivers/nvme/host/pci.c | 4 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/core.c

[PATCH 2/5] nvme: cleanup nvme_req_needs_retry

2017-04-05 Thread Christoph Hellwig
Don't pass the status explicitly but derive it from the requeust, and unwind the complex condition to be more readable. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git

->retries fixups

2017-04-05 Thread Christoph Hellwig
This series fixes a few lose bits in terms of how nvme uses ->retries, including fixing it for non-PCIe transports. While at it I noticed that nvme and scsi use the field in entirely different ways, and no other driver uses it at all. So I decided to move it into the nvme_request and

[PATCH 3/5] nvme: mark nvme_max_retries static

2017-04-05 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 3 +-- drivers/nvme/host/nvme.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index b225aacf4b89..933e67c60e33 100644 ---

[PATCH 5/5] block, scsi: move the retries field to struct scsi_request

2017-04-05 Thread Christoph Hellwig
Instead of bloating the generic struct request with it. Signed-off-by: Christoph Hellwig --- block/scsi_ioctl.c | 8 drivers/scsi/osd/osd_initiator.c | 2 +- drivers/scsi/osst.c| 2 +- drivers/scsi/scsi_error.c | 2 +-

[PATCH 4/5] nvme: move the retries count to struct nvme_request

2017-04-05 Thread Christoph Hellwig
The way NVMe uses this field is entirely different from the older SCSI/BLOCK_PC usage, so move it into struct nvme_request. Also reduce the size of the file to a unsigned char so that we leave space for additional smaller fields that will appear soon. Signed-off-by: Christoph Hellwig

Re: [PATCH] libiscsi: use vzalloc for large allocations in iscsi_pool_init

2017-04-05 Thread Kyle Fortin
On Apr 3, 2017, at 3:46 PM, Chet L wrote: > > On Mon, Apr 3, 2017 at 6:30 AM, Kyle Fortin wrote: > >> >>for (i = 0; i < q->max; i++) >>kfree(q->pool[i]); >> - kfree(q->pool); >> + if (q->is_pool_vmalloc) > >

Re: [lpfc 05/19] Fix driver unload/reload operation.

2017-04-05 Thread Mauricio Faria de Oliveira
Hi Dick, If you don't mind me being pedantic, I've noticed a couple of things. First, is your different email addresses in from/signed-off-by lines: On 04/04/2017 02:16 PM, Dick Kennedy wrote: From: Dick Kennedy [...] Signed-off-by: Dick Kennedy

Re: [PATCH] scsi: ses: don't get power status of SES device slot on probe

2017-04-05 Thread Mauricio Faria de Oliveira
Hi Dan, Thanks for reviewing. On 04/04/2017 06:07 PM, Dan Williams wrote: @@ -594,6 +594,10 @@ static ssize_t get_component_power_status(struct device *cdev, if (edev->cb->get_power_status) edev->cb->get_power_status(edev, ecomp); + + if (ecomp->power_status ==

Re: [PATCH 4/4] mtd: nand: nandsim: convert to memalloc_noreclaim_*()

2017-04-05 Thread Michal Hocko
On Wed 05-04-17 13:39:16, Vlastimil Babka wrote: > On 04/05/2017 01:36 PM, Richard Weinberger wrote: > > Michal, > > > > Am 05.04.2017 um 13:31 schrieb Michal Hocko: > >> On Wed 05-04-17 09:47:00, Vlastimil Babka wrote: > >>> Nandsim has own functions set_memalloc() and clear_memalloc() for

Re: always use REQ_OP_WRITE_ZEROES for zeroing offload

2017-04-05 Thread Christoph Hellwig
On Wed, Apr 05, 2017 at 07:40:36AM -0400, Martin K. Petersen wrote: > > This series makes REQ_OP_WRITE_ZEROES the only zeroing offload > > supported by the block layer, and switches existing implementations > > of REQ_OP_DISCARD that correctly set discard_zeroes_data to it, > > removes incorrect

Re: [PATCH 25/25] block: remove the discard_zeroes_data flag

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > Now that we use the proper REQ_OP_WRITE_ZEROES operation everywhere we > can kill this hack. Oh yeah! Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 22/25] block: stop using discards for zeroing

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > Now that we have REQ_OP_WRITE_ZEROES implemented for all devices that > support efficient zeroing of devices we can remove the call to s/of devices/ > blkdev_issue_discard. This means we only have two ways of zeroing > left and can simply the code.

Re: [PATCH 15/25] nvme: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > But now for the real NVMe Write Zeroes yet, just to get rid of the > discard abuse for zeroing. Also rename the quirk flag to be a bit > more self-explanatory. Reviewed-by: Martin K. Petersen -- Martin K. Petersen

Re: [PATCH 12/25] block: add a new BLKDEV_ZERO_NOFALLBACK flag

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > This avoids fallbacks to explicit zeroing in (__)blkdev_issue_zeroout > if the caller doesn't want them. > > Also clean up the convoluted check for the return condition that this > new flag is added to. Reviewed-by: Martin K. Petersen

Re: [PATCH 13/25] block_dev: use blkdev_issue_zerout for hole punches

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > This gets us support for non-discard efficient write of zeroes > (e.g. NVMe) and prepare for removing the discard_zeroes_data flag. s Reviewed-by: Martin K. Petersen -- Martin K. Petersen

Re: [PATCH 14/25] sd: implement unmapping Write Zeroes

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > Try to use a write same with unmap bit variant if the device supports it > and the caller allows for it. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 04/25] sd: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 09/25] block: stop using blkdev_issue_write_same for zeroing

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > We'll always use the WRITE ZEROES code for zeroing now. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 11/25] block: add a REQ_UNMAP flag for REQ_OP_WRITE_ZEROES

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > If this flag is set logical provisioning capable device should > release space for the zeroed blocks if possible, if it is not set > devices should keep the blocks anchored. > > Also remove an out of sync kerneldoc comment for a static function > that

Re: [PATCH 10/25] block: add a flags argument to (__)blkdev_issue_zeroout

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > Turn the existin discard flag into a new BLKDEV_ZERO_UNMAP flag with g > similar semantics, but without referring to diѕcard. s Reviewed-by: Martin K. Petersen

Re: [PATCH 03/25] block: implement splitting of REQ_OP_WRITE_ZEROES bios

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > Copy and past the REQ_OP_WRITE_SAME code to prepare to implementations > that limit the write zeroes size. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 02/25] block: renumber REQ_OP_WRITE_ZEROES

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > Make life easy for implementations that needs to send a data buffer > to the device (e.g. SCSI) by numbering it as a data out command. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

[PATCH 2/2] scsi: sd: Remove LBPRZ dependency for discards

2017-04-05 Thread Martin K. Petersen
Separating discards and zeroout operations allows us to remove the LBPRZ block zeroing constraints from discards and honor the device preferences for UNMAP commands. If supported by the device, we'll also choose UNMAP over one of the WRITE SAME variants for discards. Cc: Christoph Hellwig

[PATCH 1/2] scsi: sd: Separate zeroout and discard command choices

2017-04-05 Thread Martin K. Petersen
Now that zeroout and discards are distinct operations we need to separate the policy of choosing the appropriate command. Create a zeroing_mode which can be one of: write: Zeroout assist not present, use regular WRITE writesame: Allow WRITE SAME(10/16) with a zeroed

Re: [PATCH 01/25] ѕd: split sd_setup_discard_cmnd

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: > Split sd_setup_discard_cmnd into one function per provisioning type. While > this creates some very slight duplication of boilerplate code it keeps the > code modular for additions of new provisioning types, and for reusing the > write same functions for

Re: always use REQ_OP_WRITE_ZEROES for zeroing offload

2017-04-05 Thread Martin K. Petersen
Christoph Hellwig writes: Christoph, > This series makes REQ_OP_WRITE_ZEROES the only zeroing offload > supported by the block layer, and switches existing implementations > of REQ_OP_DISCARD that correctly set discard_zeroes_data to it, > removes incorrect discard_zeroes_data, and

Re: [PATCH 1/4] mm: prevent potential recursive reclaim due to clearing PF_MEMALLOC

2017-04-05 Thread Andrey Ryabinin
On 04/05/2017 10:46 AM, Vlastimil Babka wrote: > The function __alloc_pages_direct_compact() sets PF_MEMALLOC to prevent > deadlock during page migration by lock_page() (see the comment in > __unmap_and_move()). Then it unconditionally clears the flag, which can clear > a > pre-existing

Re: [PATCH 4/4] mtd: nand: nandsim: convert to memalloc_noreclaim_*()

2017-04-05 Thread Richard Weinberger
Michal, Am 05.04.2017 um 13:31 schrieb Michal Hocko: > On Wed 05-04-17 09:47:00, Vlastimil Babka wrote: >> Nandsim has own functions set_memalloc() and clear_memalloc() for robust >> setting and clearing of PF_MEMALLOC. Replace them by the new generic helpers. >> No functional change. > > This

Re: [PATCH 4/4] mtd: nand: nandsim: convert to memalloc_noreclaim_*()

2017-04-05 Thread Michal Hocko
On Wed 05-04-17 09:47:00, Vlastimil Babka wrote: > Nandsim has own functions set_memalloc() and clear_memalloc() for robust > setting and clearing of PF_MEMALLOC. Replace them by the new generic helpers. > No functional change. This one smells like an abuser. Why the hell should read/write path

Re: [PATCH 2/4] mm: introduce memalloc_noreclaim_{save,restore}

2017-04-05 Thread Michal Hocko
On Wed 05-04-17 09:46:58, Vlastimil Babka wrote: > The previous patch has shown that simply setting and clearing PF_MEMALLOC in > current->flags can result in wrongly clearing a pre-existing PF_MEMALLOC flag > and potentially lead to recursive reclaim. Let's introduce helpers that > support >

Re: [PATCH 3/4] treewide: convert PF_MEMALLOC manipulations to new helpers

2017-04-05 Thread Michal Hocko
On Wed 05-04-17 09:46:59, Vlastimil Babka wrote: > We now have memalloc_noreclaim_{save,restore} helpers for robust setting and > clearing of PF_MEMALLOC. Let's convert the code which was using the generic > tsk_restore_flags(). No functional change. It would be really great to revisit why those

Re: [PATCH 1/4] mm: prevent potential recursive reclaim due to clearing PF_MEMALLOC

2017-04-05 Thread Michal Hocko
On Wed 05-04-17 09:46:57, Vlastimil Babka wrote: > The function __alloc_pages_direct_compact() sets PF_MEMALLOC to prevent > deadlock during page migration by lock_page() (see the comment in > __unmap_and_move()). Then it unconditionally clears the flag, which can clear > a > pre-existing

[PATCH v2 1/1] aacraid: pci_alloc_consistent() failures on ARM64

2017-04-05 Thread Mahesh Rajashekhara
There were pci_alloc_consistent() failures on ARM64 platform. Use dma_alloc_coherent() with GFP_KERNEL flag DMA memory allocations. Signed-off-by: Mahesh Rajashekhara --- v2: - Removed platform specific MACRO and call dma_*_coherent routines directly. -

Re: [PATCH v2] lsscsi: Fix truncation of 128-bit wwn

2017-04-05 Thread Gris Ge
On Fri, Mar 17, 2017 at 05:31:40PM +0530, Vaibhav Jain wrote: > --- > Change-log: > > v2..v1 > - Introduces macro DISK_WWN_MAX_LEN that defines the maximum length of > wwn read from devfs. (Gris Ge) > - Fix the indentation using space instead of '\t' (Gris Ge) Patch looks good to me and tested:

[PATCH v2] scsi: sd: Fix capacity calculation with 32-bit sector_t

2017-04-05 Thread Martin K. Petersen
We previously made sure that the reported disk capacity was less than 0x blocks when the kernel was not compiled with large sector_t support (CONFIG_LBDAF). However, this check assumed that the capacity was reported in units of 512 bytes. Add a sanity check function to ensure that we only

[PATCH 0/4] more robust PF_MEMALLOC handling

2017-04-05 Thread Vlastimil Babka
Hi, this series aims to unify the setting and clearing of PF_MEMALLOC, which prevents recursive reclaim. There are some places that clear the flag unconditionally from current->flags, which may result in clearing a pre-existing flag. This already resulted in a bug report that Patch 1 fixes

[PATCH 4/4] mtd: nand: nandsim: convert to memalloc_noreclaim_*()

2017-04-05 Thread Vlastimil Babka
Nandsim has own functions set_memalloc() and clear_memalloc() for robust setting and clearing of PF_MEMALLOC. Replace them by the new generic helpers. No functional change. Signed-off-by: Vlastimil Babka Cc: Boris Brezillon Cc: Richard

[PATCH 2/4] mm: introduce memalloc_noreclaim_{save,restore}

2017-04-05 Thread Vlastimil Babka
The previous patch has shown that simply setting and clearing PF_MEMALLOC in current->flags can result in wrongly clearing a pre-existing PF_MEMALLOC flag and potentially lead to recursive reclaim. Let's introduce helpers that support proper nesting by saving the previous stat of the flag, similar

[PATCH 3/4] treewide: convert PF_MEMALLOC manipulations to new helpers

2017-04-05 Thread Vlastimil Babka
We now have memalloc_noreclaim_{save,restore} helpers for robust setting and clearing of PF_MEMALLOC. Let's convert the code which was using the generic tsk_restore_flags(). No functional change. Signed-off-by: Vlastimil Babka Cc: Josef Bacik Cc: Lee Duncan

[PATCH 1/4] mm: prevent potential recursive reclaim due to clearing PF_MEMALLOC

2017-04-05 Thread Vlastimil Babka
The function __alloc_pages_direct_compact() sets PF_MEMALLOC to prevent deadlock during page migration by lock_page() (see the comment in __unmap_and_move()). Then it unconditionally clears the flag, which can clear a pre-existing PF_MEMALLOC flag and result in recursive reclaim. This was not a

Re: [lpfc 05/19] Fix driver unload/reload operation.

2017-04-05 Thread Johannes Thumshirn
On Tue, Apr 04, 2017 at 10:16:58AM -0700, Dick Kennedy wrote: > From: Dick Kennedy > > Two issues: (1) driver could not be unloaded and > reloaded without some Oops or Panic occurring. (2) The > driver was panicking because of a corruption in the Memory >

Re: [lpfc 04/19] Fix PRLI ACC rsp for NVME

2017-04-05 Thread Johannes Thumshirn
On Tue, Apr 04, 2017 at 10:16:57AM -0700, Dick Kennedy wrote: > From: Dick Kennedy > > PRLI ACC from target is FCP oriented > > > Signed-off-by: Dick Kennedy > Signed-off-by: James Smart > --- Please

Re: [lpfc 03/19] Fix spelling in comments.

2017-04-05 Thread Johannes Thumshirn
On Tue, Apr 04, 2017 at 10:16:56AM -0700, Dick Kennedy wrote: > From: Dick Kennedy > > Signed-off-by: Dick Kennedy > Signed-off-by: James Smart > --- So 3rd patch in the series and still no changelog.

Re: [lpfc 02/19] Fixes after reviewing last set of patches. Minor fixes to previous patches

2017-04-05 Thread Johannes Thumshirn
On Tue, Apr 04, 2017 at 10:16:55AM -0700, Dick Kennedy wrote: > From: Dick Kennedy > > Signed-off-by: Dick Kennedy > Signed-off-by: James Smart > --- NAK. This patch contains _five_ different changes

Re: [lpfc 01/19] Fix advertised max_sgl_segment count for NVMET

2017-04-05 Thread Johannes Thumshirn
On Tue, Apr 04, 2017 at 10:16:54AM -0700, Dick Kennedy wrote: > From: Dick Kennedy > > Signed-off-by: Dick Kennedy > Signed-off-by: James Smart > --- This could benefit from a slightly more verbose

Re: [PATCH] csiostor: switch to pci_alloc_irq_vectors

2017-04-05 Thread Christoph Hellwig
On Tue, Apr 04, 2017 at 01:49:44PM +0530, Varun Prakash wrote: > On Tue, Apr 04, 2017 at 08:46:14AM +0200, Christoph Hellwig wrote: > > Does this one work better? > > > > csiostor driver is triggering following warning during module unload. Looks like we need to explicitly ignore the

[PATCH v5 2/2] tcmu: Add global data block pool support

2017-04-05 Thread lixiubo
From: Xiubo Li For each target there will be one ring, when the target number grows larger and larger, it could eventually runs out of the system memories. In this patch for each target ring, currently for the cmd area the size will be fixed to 8MB and for the data

[PATCH v5 0/2] tcmu: Dynamic growing data area support

2017-04-05 Thread lixiubo
From: Xiubo Li Changed for V5: - Rebase to the newest target-pending repository. - Add as many comments as possbile to make the patch more readable. - Move tcmu_handle_completions() in timeout handler to unmap thread and then replace the spin lock with mutex

[PATCH v5 1/2] tcmu: Add dynamic growing data area feature support

2017-04-05 Thread lixiubo
From: Xiubo Li Currently for the TCMU, the ring buffer size is fixed to 64K cmd area + 1M data area, and this will be bottlenecks for high iops. The struct tcmu_cmd_entry {} size is fixed about 112 bytes with iovec[N] & N <= 4, and the size of struct iovec is about

<    1   2