Re: [RFC 1/8] Introduce Peer-to-Peer memory (p2pmem) device

2017-03-31 Thread okaya
On 2017-03-31 21:57, Logan Gunthorpe wrote: On 31/03/17 05:51 PM, Sinan Kaya wrote: You can put a restriction with DMI/SMBIOS such that all devices from 2016 work else they belong to blacklist. How do you get a manufacturing date for a given device within the kernel? Is this actually somethin

Re: [RFC 1/8] Introduce Peer-to-Peer memory (p2pmem) device

2017-03-31 Thread Logan Gunthorpe
On 31/03/17 05:51 PM, Sinan Kaya wrote: > You can put a restriction with DMI/SMBIOS such that all devices from 2016 > work else they belong to blacklist. How do you get a manufacturing date for a given device within the kernel? Is this actually something generically available? Logan

Re: [RFC 1/8] Introduce Peer-to-Peer memory (p2pmem) device

2017-03-31 Thread Sinan Kaya
On 3/31/2017 6:42 PM, Logan Gunthorpe wrote: > > > On 31/03/17 03:38 PM, Sinan Kaya wrote: >> On 3/31/2017 5:23 PM, Logan Gunthorpe wrote: >>> What exactly would you white/black list? It can't be the NIC or the >>> disk. If it's going to be a white/black list on the switch or root port >>> then y

Re: [RFC 1/8] Introduce Peer-to-Peer memory (p2pmem) device

2017-03-31 Thread Logan Gunthorpe
On 31/03/17 03:38 PM, Sinan Kaya wrote: > On 3/31/2017 5:23 PM, Logan Gunthorpe wrote: >> What exactly would you white/black list? It can't be the NIC or the >> disk. If it's going to be a white/black list on the switch or root port >> then you'd need essentially the same code to ensure they are

Re: [RFC 1/8] Introduce Peer-to-Peer memory (p2pmem) device

2017-03-31 Thread Sinan Kaya
On 3/31/2017 5:23 PM, Logan Gunthorpe wrote: > What exactly would you white/black list? It can't be the NIC or the > disk. If it's going to be a white/black list on the switch or root port > then you'd need essentially the same code to ensure they are all behind > the same switch or root port. Wha

[PATCH 1/2] qla2xxx: Add fix to read correct register value for ISP82xx.

2017-03-31 Thread Himanshu Madhani
From: Sawan Chandak Add fix to read correct register value for ISP82xx, during check for register disconnect.ISP82xx has different base register. Fixes: a465537ad1a4 ("qla2xxx: Disable the adapter and skip error recovery in case of register disconnect") Signed-off-by: Sawan Chandak Signed-off-

[PATCH 2/2] qla2xxx: Fix typo in driver

2017-03-31 Thread Himanshu Madhani
From: Milan P Gandhi Signed-off-by: Milan P Gandhi Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_attr.c | 2 +- drivers/scsi/qla2xxx/qla_bsg.c | 2 +- drivers/scsi/qla2xxx/qla_gs.c | 2 +- drivers/scsi/qla2xxx/qla_init.c | 2 +- drivers/scsi/qla2xxx/qla_isr.c | 6 +++--- 5 f

[PATCH 0/2] qla2xxx: Bug Fixes for qla2xxx driver

2017-03-31 Thread Himanshu Madhani
Hi Martin, Couple bug fixes for the scsi-fixes branch please apply to 4.11/scsi-fixes. Thanks, Himanshu Milan P Gandhi (1): qla2xxx: Fix typo in driver Sawan Chandak (1): qla2xxx: Add fix to read correct register value for ISP82xx. drivers/scsi/qla2xxx/qla_attr.c | 2 +- drivers/scsi/ql

Re: [RFC 1/8] Introduce Peer-to-Peer memory (p2pmem) device

2017-03-31 Thread Logan Gunthorpe
On 31/03/17 12:49 PM, Sinan Kaya wrote: > Don't you need to clean up the p->pool here. See Patch 7 in the series. >> +put_device(&p->dev); >> +} >> +EXPORT_SYMBOL(p2pmem_unregister); >> + > > I don't like the ugliness around the switch port to be honest. > > Going to whitelist/blacklist

Re: [PATCH] tcmu: Skip Data-Out blocks before gathering Data-In buffer for BIDI case

2017-03-31 Thread Ilias Tsitsimpis
Hi Xiubo, On Fri, Mar 31, 2017 at 10:35AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > For the bidirectional case, the Data-Out buffer blocks will always at > the head of the tcmu_cmd's bitmap, and before gathering the Data-In > buffer, first of all it should skip the Data-Out ones,

Re: [PATCH] scsi: mpt3sas: fix hang on ata passthrough commands

2017-03-31 Thread Greg Kroah-Hartman
On Fri, Mar 31, 2017 at 02:10:29PM -0400, Joe Korty wrote: > On Fri, Mar 31, 2017 at 04:50:52PM +0200, Greg Kroah-Hartman wrote: > > A: Because it messes up the order in which people normally read text. > > Q: Why is top-posting such a bad thing? > > A: Top-posting. > > Q: What is the most annoying

Re: [RFC 1/8] Introduce Peer-to-Peer memory (p2pmem) device

2017-03-31 Thread Sinan Kaya
Hi Logan, > +/** > + * p2pmem_unregister() - unregister a p2pmem device > + * @p: the device to unregister > + * > + * The device will remain until all users are done with it > + */ > +void p2pmem_unregister(struct p2pmem_dev *p) > +{ > + if (!p) > + return; > + > + dev_info(&p

Re: [PATCH v6 00/15] Replace PCI pool by DMA pool API

2017-03-31 Thread Romain Perier
ping Le 19/03/2017 à 18:03, Romain Perier a écrit : > The current PCI pool API are simple macro functions direct expanded to > the appropriate dma pool functions. The prototypes are almost the same > and semantically, they are very similar. I propose to use the DMA pool > API directly and get rid

problem with discard granularity in sd

2017-03-31 Thread David Buckley
Hello, Hopefully this is the right place for this, and apologies for the lengthy mail. I'm struggling with an issue with SCSI UNMAP/discard in newer kernels, and I'm hoping to find a resolution or at least to better understand why this has changed. Some background info: Our Linux boxes are prima

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

2017-03-31 Thread Christoph Hellwig
We'll always use the WRITE ZEROES code for zeroing now. Signed-off-by: Christoph Hellwig --- block/blk-lib.c | 4 1 file changed, 4 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index e5b853f2b8a2..2a8d638544a7 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -364,10 +36

[PATCH 06/25] dm io: discards don't take a payload

2017-03-31 Thread Christoph Hellwig
Fix up do_region to not allocate a bio_vec for discards. We've got rid of the discard payload allocated by the caller years ago. Obviously this wasn't actually harmful given how long it's been there, but it's still good to avoid the pointless allocation. Signed-off-by: Christoph Hellwig --- dr

[PATCH 04/25] sd: implement REQ_OP_WRITE_ZEROES

2017-03-31 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 31 ++- drivers/scsi/sd_zbc.c | 1 + 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index b853f91fb3da..d8d9c0bdd93c 100644 --- a/drivers/scsi/sd.c +++

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

2017-03-31 Thread Christoph Hellwig
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 would have become even more out of data with this change

[PATCH 15/25] nvme: implement REQ_OP_WRITE_ZEROES

2017-03-31 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 --- drivers/nvme/host/core.c | 10 +- drivers/nvme/host/nvme.h | 6 +++--- drivers/nvme/host/pci.

[PATCH 19/25] rbd: remove the discard_zeroes_data flag

2017-03-31 Thread Christoph Hellwig
rbd only supports discarding on large alignments, so the zeroing code would always fall back to explicit writings of zeroes. Signed-off-by: Christoph Hellwig --- drivers/block/rbd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 517838b65964..0

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

2017-03-31 Thread Christoph Hellwig
This gets us support for non-discard efficient write of zeroes (e.g. NVMe) and prepare for removing the discard_zeroes_data flag. Also remove a pointless discard support check, which is done in blkdev_issue_discard already. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 10 ++ 1

[PATCH 23/25] drbd: make intelligent use of blkdev_issue_zeroout

2017-03-31 Thread Christoph Hellwig
drbd always wants its discard wire operations to zero the blocks, so use blkdev_issue_zeroout with the BLKDEV_ZERO_UNMAP flag instead of reinventing it poorly. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_debugfs.c | 3 -- drivers/block/drbd/drbd_int.h | 6 --- drivers/

[PATCH 21/25] mmc: remove the discard_zeroes_data flag

2017-03-31 Thread Christoph Hellwig
mmc only supports discarding on large alignments, so the zeroing code would always fall back to explicit writings of zeroes. Signed-off-by: Christoph Hellwig --- drivers/mmc/core/queue.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c inde

[PATCH 17/25] loop: implement REQ_OP_WRITE_ZEROES

2017-03-31 Thread Christoph Hellwig
It's identical to discard as hole punches will always leave us with zeroes on reads. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 0ecb6461ed81..265cd2e33ff0 100644 --- a/drivers

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

2017-03-31 Thread Christoph Hellwig
Try to use a write same with unmap bit variant if the device supports it and the caller allows for it. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index d8d9c0bdd93c..001593ed0444 100644

[PATCH 24/25] drbd: implement REQ_OP_WRITE_ZEROES

2017-03-31 Thread Christoph Hellwig
It seems like DRBD assumes its on the wire TRIM request always zeroes data. Use that fact to implement REQ_OP_WRITE_ZEROES. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 3 ++- drivers/block/drbd/drbd_nl.c | 2 ++ drivers/block/drbd/drbd_receiver.c | 6 +++--- d

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

2017-03-31 Thread Christoph Hellwig
Now that we use the proper REQ_OP_WRITE_ZEROES operation everywhere we can kill this hack. Signed-off-by: Christoph Hellwig --- Documentation/ABI/testing/sysfs-block | 10 ++- Documentation/block/queue-sysfs.txt | 5 block/blk-lib.c | 7 + block/blk-setting

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

2017-03-31 Thread Christoph Hellwig
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. Signed-off-by: Christoph Hellwig --- block/blk-lib.c| 5 - include/linux/blkdev.h | 1 +

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

2017-03-31 Thread Christoph Hellwig
Now that we have REQ_OP_WRITE_ZEROES implemented for all devices that support efficient zeroing of devices we can remove the call to blkdev_issue_discard. This means we only have two ways of zeroing left and can simply the code. Signed-off-by: Christoph Hellwig --- block/blk-lib.c | 11 +---

[PATCH 16/25] zram: implement REQ_OP_WRITE_ZEROES

2017-03-31 Thread Christoph Hellwig
Just the same as discard if the block size equals the system page size. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index dceb5ed

[PATCH 18/25] brd: remove discard support

2017-03-31 Thread Christoph Hellwig
It's just a in-driver reimplementation of writing zeroes to the pages, which fails if the discards aren't page aligned. Signed-off-by: Christoph Hellwig --- drivers/block/brd.c | 54 - 1 file changed, 54 deletions(-) diff --git a/drivers/block

[PATCH 20/25] rsxx: remove the discard_zeroes_data flag

2017-03-31 Thread Christoph Hellwig
rsxx only supports discarding on large alignments, so the zeroing code would always fall back to explicit writings of zeroes. Signed-off-by: Christoph Hellwig --- drivers/block/rsxx/dev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/rsxx/dev.c b/drivers/block/rsxx/dev.c index

[PATCH 05/25] md: support REQ_OP_WRITE_ZEROES

2017-03-31 Thread Christoph Hellwig
Copy & paste from the REQ_OP_WRITE_SAME code. Signed-off-by: Christoph Hellwig --- drivers/md/linear.c| 1 + drivers/md/md.h| 7 +++ drivers/md/multipath.c | 1 + drivers/md/raid0.c | 2 ++ drivers/md/raid1.c | 4 +++- drivers/md/raid10.c| 1 + drivers/md/raid5.c

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

2017-03-31 Thread Christoph Hellwig
Turn the existin discard flag into a new BLKDEV_ZERO_UNMAP flag with similar semantics, but without referring to diѕcard. Signed-off-by: Christoph Hellwig --- block/blk-lib.c| 31 ++- block/ioctl.c | 2 +- drivers/block/drbd/d

[PATCH 07/25] dm: support REQ_OP_WRITE_ZEROES

2017-03-31 Thread Christoph Hellwig
Copy & paste from the REQ_OP_WRITE_SAME code. Signed-off-by: Christoph Hellwig --- drivers/md/dm-core.h | 1 + drivers/md/dm-io.c| 8 ++-- drivers/md/dm-linear.c| 1 + drivers/md/dm-mpath.c | 1 + drivers/md/dm-rq.c| 11 --- driver

[PATCH 08/25] dm kcopyd: switch to use REQ_OP_WRITE_ZEROES

2017-03-31 Thread Christoph Hellwig
It seems like the code currently passes whatever it was using for writes to WRITE SAME. Just switch it to WRITE ZEROES, although that doesn't need any payload. Untested, and confused by the code, maybe someone who understands it better than me can help.. Not-yet-signed-off-by: Christoph Hellwig

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

2017-03-31 Thread Christoph Hellwig
Copy and past the REQ_OP_WRITE_SAME code to prepare to implementations that limit the write zeroes size. Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 2afa2

always use REQ_OP_WRITE_ZEROES for zeroing offload

2017-03-31 Thread Christoph Hellwig
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 also switches WRITE SAME based zeroing in SCSI to this new me

[PATCH 01/25] ѕd: split sd_setup_discard_cmnd

2017-03-31 Thread Christoph Hellwig
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 the upcoming scsi implementation of the Write Zer

[PATCH 02/25] block: renumber REQ_OP_WRITE_ZEROES

2017-03-31 Thread Christoph Hellwig
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. Signed-off-by: Christoph Hellwig --- include/linux/blk_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/blk_types.h b/incl

Re: [PATCH 1/6] virtio: wrap find_vqs

2017-03-31 Thread Michael S. Tsirkin
On Fri, Mar 31, 2017 at 12:04:55PM +0800, Jason Wang wrote: > > > On 2017年03月30日 22:32, Michael S. Tsirkin wrote: > > On Thu, Mar 30, 2017 at 02:00:08PM +0800, Jason Wang wrote: > > > > > > On 2017年03月30日 04:48, Michael S. Tsirkin wrote: > > > > We are going to add more parameters to find_vqs, l

Re: [PATCH 0/3] Improve block device testing coverage

2017-03-31 Thread Darrick J. Wong
On Fri, Mar 31, 2017 at 03:11:28PM +, Bart Van Assche wrote: > On Fri, 2017-03-31 at 13:02 +0300, Dmitry Monakhov wrote: > > Another good example may be a bug with dirty page cache after blkdiscard > > https://lkml.org/lkml/2017/3/22/789 . This simple bug result in crappy > > fsimage if mkfs r

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-03-31 Thread Logan Gunthorpe
On 31/03/17 01:09 AM, Christoph Hellwig wrote: > You're calling memcpy_{to,from}_iomem on non-__iomem pointers. This > is a fundamental no-go as we keep I/O memory separate from kernel > pointers. Yes, that's true, however I don't know how we could get around that when the iomem is referenced b

Re: [PATCH 0/3] Improve block device testing coverage

2017-03-31 Thread Bart Van Assche
On Fri, 2017-03-31 at 13:02 +0300, Dmitry Monakhov wrote: > Another good example may be a bug with dirty page cache after blkdiscard > https://lkml.org/lkml/2017/3/22/789 . This simple bug result in crappy > fsimage if mkfs relay on discard_zeroes_data behaviour. > So IMHO basic blkdev test covera

Re: [PATCH] scsi: mpt3sas: fix hang on ata passthrough commands

2017-03-31 Thread Greg Kroah-Hartman
A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? A: No. Q: Should I include quotations after my reply? http://daringfireball.net/2007/07/on_top On Fri, Mar 31, 2017 at 10:1

Re: [PATCH] scsi: mpt3sas: fix hang on ata passthrough commands

2017-03-31 Thread Greg Kroah-Hartman
On Fri, Mar 31, 2017 at 09:50:30AM -0400, Joe Korty wrote: > [PATCH] scsi: mpt3sas: fix hang on ata passthrough commands > > commit 16236802bfecb1082144a48b7d6fa60997824662 upstream > commit ffb58456589443ca572221fabbdef3db8483a779 upstream > > Lockdep complains that the base level-only hctx->loc

Re: [PATCH 0/3] Improve block device testing coverage

2017-03-31 Thread Dmitry Monakhov
Eryu Guan writes: > On Fri, Mar 31, 2017 at 10:43:19AM +0300, Dmitry Monakhov wrote: >> Christoph Hellwig writes: >> >> > On Thu, Mar 30, 2017 at 05:19:01PM +0400, Dmitry Monakhov wrote: >> >> During LSFMM we have discussed how to test lower-backend of linux >> >> IO-stack. >> >> Common opinio

Re: [PATCH 0/3] Improve block device testing coverage

2017-03-31 Thread Eryu Guan
On Fri, Mar 31, 2017 at 10:43:19AM +0300, Dmitry Monakhov wrote: > Christoph Hellwig writes: > > > On Thu, Mar 30, 2017 at 05:19:01PM +0400, Dmitry Monakhov wrote: > >> During LSFMM we have discussed how to test lower-backend of linux IO-stack. > >> Common opinion was that xfstests is the most ob

Re: [PATCH 0/3] Improve block device testing coverage

2017-03-31 Thread Dmitry Monakhov
Christoph Hellwig writes: > On Thu, Mar 30, 2017 at 05:19:01PM +0400, Dmitry Monakhov wrote: >> During LSFMM we have discussed how to test lower-backend of linux IO-stack. >> Common opinion was that xfstests is the most obvious solution which cover >> most of use cases filesystem care about. >>

Re: [PATCH 12/23] sd: handle REQ_UNMAP

2017-03-31 Thread h...@lst.de
On Thu, Mar 30, 2017 at 10:19:55PM -0400, Martin K. Petersen wrote: > > If you manually change the provisioning mode to WS10 on a device that > > must use WRITE SAME (16) to be able to address all blocks you're already > > screwed right now, and with this patch you can screw yourself through > > th

Re: [PATCH 22/23] drbd: implement REQ_OP_WRITE_ZEROES

2017-03-31 Thread Christoph Hellwig
On Thu, Mar 30, 2017 at 07:15:50PM -0400, Mike Snitzer wrote: > I got pretty far along with implementing the DM thinp support for > WRITE_ZEROES in terms of thinp's DISCARD support (more of an > implementation detail.. or so I thought). > > But while discussing this effort with Jeff Moyer he asked

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-03-31 Thread Christoph Hellwig
You're calling memcpy_{to,from}_iomem on non-__iomem pointers. This is a fundamental no-go as we keep I/O memory separate from kernel pointers.