[PATCH 2/5] scsi: Change the type of the second last argument of scsi_execute()

2017-09-08 Thread Bart Van Assche
The second last argument of scsi_execute() is either 0 or RQF_PM. Change the type of that argument from req_flags_t into bool and update the callers that pass RQF_PM. This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Martin K. Petersen

[PATCH 4/5] block: Make SCSI device suspend work reliably

2017-09-08 Thread Bart Van Assche
Instead of allowing request allocation to succeed for suspended request queues and only to process power management requests, make blk_get_request() wait until the request queue is resumed for requests that are not power management requests. This patch avoids that resume does not occur if the

Re: [PATCH V4 05/14] blk-mq-sched: improve dispatching from sw queue

2017-09-08 Thread Omar Sandoval
On Sat, Sep 02, 2017 at 11:17:20PM +0800, Ming Lei wrote: > SCSI devices use host-wide tagset, and the shared > driver tag space is often quite big. Meantime > there is also queue depth for each lun(.cmd_per_lun), > which is often small. > > So lots of requests may stay in sw queue, and we >

[PATCH 3/5] block: Introduce REQ_PM and remove RQF_PM

2017-09-08 Thread Bart Van Assche
Tell the block layer at request allocation time whether or not a request will be used to change the power management state of a block device. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn

[PATCH 1/5] percpu-refcount: Introduce percpu_ref_switch_to_atomic_nowait()

2017-09-08 Thread Bart Van Assche
The blk-mq core keeps track of the number of request queue users through q->q_usage_count. Make it possible to switch this counter to atomic mode from the context of the block layer power management code by introducing percpu_ref_switch_to_atomic_nowait(). Signed-off-by: Bart Van Assche

[PATCH 0/5] Make SCSI device suspend work reliably

2017-09-08 Thread Bart Van Assche
Hello Jens, Recently it was reported on the block layer mailing list that suspend does not work reliably neither for the legacy block layer nor for blk-mq. The purpose of this patch series is to make device suspend work reliably without affecting the hot path significantly and without introducing

[PATCH 5/5] blk-mq: Implement power management support

2017-09-08 Thread Bart Van Assche
Implement the following approach for blk-mq: - Either make blk_get_request() wait or make it fail when a request queue is not in status RPM_ACTIVE. - While suspending, suspended or resuming, only process power management requests (REQ_PM). Reported-by: Oleksandr Natalenko

Re: block: directly insert blk-mq request from blk_insert_cloned_request()

2017-09-08 Thread Mike Snitzer
On Fri, Sep 08 2017 at 5:50pm -0400, Jens Axboe wrote: > On 09/08/2017 03:42 PM, Mike Snitzer wrote: > > diff --git a/block/blk-core.c b/block/blk-core.c > > index d709c0e..7a06b2b 100644 > > --- a/block/blk-core.c > > +++ b/block/blk-core.c > > @@ -2342,7 +2342,7 @@

Re: [PATCH] block: directly insert blk-mq request from blk_insert_cloned_request()

2017-09-08 Thread Jens Axboe
On 09/08/2017 03:42 PM, Mike Snitzer wrote: > diff --git a/block/blk-core.c b/block/blk-core.c > index d709c0e..7a06b2b 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -2342,7 +2342,7 @@ blk_status_t blk_insert_cloned_request(struct > request_queue *q, struct request * > if

Re: About btrfs on top of wb_throttle

2017-09-08 Thread Jens Axboe
On 08/30/2017 04:06 PM, Liu Bo wrote: > Hi, > > While playing with btrfs on top of wb_throttle, an interesting thing > is that writeback from btrfs always falls into %rwb->wb_background > even if there're no other writers. > > The peculiarity of btrfs is that, it owns the ability of mananging >

Re: [PATCH V4 01/14] blk-mq-sched: fix scheduler bad performance

2017-09-08 Thread Omar Sandoval
On Fri, Sep 08, 2017 at 01:54:48PM -0700, Omar Sandoval wrote: > On Fri, Sep 08, 2017 at 01:48:32PM -0700, Omar Sandoval wrote: > > On Sat, Sep 02, 2017 at 11:17:16PM +0800, Ming Lei wrote: > > > When hw queue is busy, we shouldn't take requests from > > > scheduler queue any more, otherwise it is

Re: [PATCH V4 01/14] blk-mq-sched: fix scheduler bad performance

2017-09-08 Thread Omar Sandoval
On Fri, Sep 08, 2017 at 01:48:32PM -0700, Omar Sandoval wrote: > On Sat, Sep 02, 2017 at 11:17:16PM +0800, Ming Lei wrote: > > When hw queue is busy, we shouldn't take requests from > > scheduler queue any more, otherwise it is difficult to do > > IO merge. > > > > This patch fixes the awful IO

Re: [PATCH V4 01/14] blk-mq-sched: fix scheduler bad performance

2017-09-08 Thread Omar Sandoval
On Sat, Sep 02, 2017 at 11:17:16PM +0800, Ming Lei wrote: > When hw queue is busy, we shouldn't take requests from > scheduler queue any more, otherwise it is difficult to do > IO merge. > > This patch fixes the awful IO performance on some > SCSI devices(lpfc, qla2xxx, ...) when

Re: [PATCH V4 02/14] sbitmap: introduce __sbitmap_for_each_set()

2017-09-08 Thread Omar Sandoval
On Sat, Sep 02, 2017 at 11:17:17PM +0800, Ming Lei wrote: > We need to iterate ctx starting from any ctx in round robin > way, so introduce this helper. > > Cc: Omar Sandoval A couple of comments below, once you address those you can add Reviewed-by: Omar Sandoval

Re: dm mpath: switch IO scheduler of underlying paths to "none" [was: Re: BFQ + dm-mpath]

2017-09-08 Thread Jens Axboe
On 09/08/2017 01:58 PM, Mike Snitzer wrote: > On Fri, Sep 08 2017 at 1:07pm -0400, > Mike Snitzer wrote: > >> On Fri, Sep 08 2017 at 12:48pm -0400, >> Jens Axboe wrote: >> Please see the following untested patch. All testing/review/comments/acks

Re: [PATCH V2] block: sed-opal: Set MBRDone on S3 resume path if TPER is MBREnabled

2017-09-08 Thread Jens Axboe
On 09/08/2017 01:36 PM, Scott Bauer wrote: > On Tue, Sep 05, 2017 at 04:51:51PM -0600, Jon Derrick wrote: > Jens, sorry to bother, can you take this? Or do you have any follow up > comments? > > RHEL Is starting to pull changes in for 7.5 I want to get this landed so they > can > pick it up. I

Re: dm mpath: switch IO scheduler of underlying paths to "none" [was: Re: BFQ + dm-mpath]

2017-09-08 Thread Mike Snitzer
On Fri, Sep 08 2017 at 1:07pm -0400, Mike Snitzer wrote: > On Fri, Sep 08 2017 at 12:48pm -0400, > Jens Axboe wrote: > > > > Please see the following untested patch. All > > > testing/review/comments/acks appreciated. > > > > > > I elected to use

Re: [PATCH V2] block: sed-opal: Set MBRDone on S3 resume path if TPER is MBREnabled

2017-09-08 Thread Scott Bauer
On Tue, Sep 05, 2017 at 04:51:51PM -0600, Jon Derrick wrote: Jens, sorry to bother, can you take this? Or do you have any follow up comments? RHEL Is starting to pull changes in for 7.5 I want to get this landed so they can pick it up. If it's already on your list, sorry for being impatient. >

Re: [GIT PULL] Followup block pull request for 4.14-rc1

2017-09-08 Thread Jens Axboe
On 09/08/2017 11:34 AM, Jens Axboe wrote: > Single merge conflict here, for nvme/rdma. Trivial to fixup, see my > for-next branch here: > > http://git.kernel.dk/cgit/linux-block/log/?h=for-next > > if you want to see how I resolved it. Note that the for-next branch is > missing one late bcache

Re: [PATCH 3/3] block/loop: make loop cgroup aware

2017-09-08 Thread Tejun Heo
Hello, Shaohua. On Fri, Sep 08, 2017 at 10:07:15AM -0700, Shaohua Li wrote: > > The fact that we're forwarding explicitly in loop still bothers me a > > bit. Can you please elaborate why we don't want to do this > > generically through aio? > > I think we must forward in loop, because each cmd

Re: [GIT PULL] First set of block changes for 4.14-rc1

2017-09-08 Thread Jens Axboe
On 09/07/2017 08:25 PM, Ming Lei wrote: > On Thu, Sep 07, 2017 at 01:47:44PM -0600, Jens Axboe wrote: >> On 09/07/2017 01:38 PM, Linus Torvalds wrote: >>> On Thu, Sep 7, 2017 at 12:27 PM, Jens Axboe wrote: Which was committed yesterday? It was not from my tree. I try to

[GIT PULL] Followup block pull request for 4.14-rc1

2017-09-08 Thread Jens Axboe
Hi Linus, I ended up splitting the main pull request for this series into two, mainly because of clashes between NVMe fixes that went into 4.13 after the for-4.14 branches were split off. This pull request is mostly NVMe, but not exclusively. In detail, it contains: - Two pull request for NVMe

Re: dm mpath: switch IO scheduler of underlying paths to "none" [was: Re: BFQ + dm-mpath]

2017-09-08 Thread Mike Snitzer
On Fri, Sep 08 2017 at 12:48pm -0400, Jens Axboe wrote: > On 09/08/2017 10:41 AM, Mike Snitzer wrote: > > On Fri, Sep 08 2017 at 5:13P -0400, > > Paolo Valente wrote: > > > >> > >>> Il giorno 07 set 2017, alle ore 17:52, Mike Snitzer

Re: [PATCH 3/3] block/loop: make loop cgroup aware

2017-09-08 Thread Shaohua Li
On Fri, Sep 08, 2017 at 07:48:09AM -0700, Tejun Heo wrote: > Hello, > > On Wed, Sep 06, 2017 at 07:00:53PM -0700, Shaohua Li wrote: > > diff --git a/drivers/block/loop.c b/drivers/block/loop.c > > index 9d4545f..9850b27 100644 > > --- a/drivers/block/loop.c > > +++ b/drivers/block/loop.c > > @@

Re: [PATCH V2 10/12] scsi: sd_zbc: Disable zone write locking with scsi-mq

2017-09-08 Thread Damien Le Moal
Ming, On 9/8/17 05:43, Ming Lei wrote: > Hi Damien, > > On Fri, Sep 08, 2017 at 01:16:38AM +0900, Damien Le Moal wrote: >> In the case of a ZBC disk used with scsi-mq, zone write locking does >> not prevent write reordering in sequential zones. Unlike the legacy >> case, zone locking can only be

Re: [PATCH 1/3] kthread: add a mechanism to store cgroup info

2017-09-08 Thread Shaohua Li
On Fri, Sep 08, 2017 at 07:35:37AM -0700, Tejun Heo wrote: > Hello, > > On Wed, Sep 06, 2017 at 07:00:51PM -0700, Shaohua Li wrote: > > +#ifdef CONFIG_CGROUPS > > +void kthread_set_orig_css(struct cgroup_subsys_state *css); > > +struct cgroup_subsys_state *kthread_get_orig_css(void); > > +void

Re: [PATCH] dm mpath: switch IO scheduler of underlying paths to "none" [was: Re: BFQ + dm-mpath]

2017-09-08 Thread Jens Axboe
On 09/08/2017 10:41 AM, Mike Snitzer wrote: > On Fri, Sep 08 2017 at 5:13P -0400, > Paolo Valente wrote: > >> >>> Il giorno 07 set 2017, alle ore 17:52, Mike Snitzer ha >>> scritto: >>> >>> On Tue, Sep 05 2017 at 10:15am -0400, >>> Bart Van Assche

[PATCH] dm mpath: switch IO scheduler of underlying paths to "none" [was: Re: BFQ + dm-mpath]

2017-09-08 Thread Mike Snitzer
On Fri, Sep 08 2017 at 5:13P -0400, Paolo Valente wrote: > > > Il giorno 07 set 2017, alle ore 17:52, Mike Snitzer ha > > scritto: > > > > On Tue, Sep 05 2017 at 10:15am -0400, > > Bart Van Assche wrote: > > > >> On

Re: [PATCH V2 00/12] scsi-mq support for ZBC disks

2017-09-08 Thread Damien Le Moal
Christoph, On 9/8/17 01:20, Christoph Hellwig wrote: > I'm really worried about how this is tied into the sd driver. > > From a quick look it seems like the only thing you really need in > the scheduler that is done through struct scsi_disk is the > offset + len -> zone number lookup - I'd much

Re: [PATCH 3/3] block/loop: make loop cgroup aware

2017-09-08 Thread Tejun Heo
Hello, On Wed, Sep 06, 2017 at 07:00:53PM -0700, Shaohua Li wrote: > diff --git a/drivers/block/loop.c b/drivers/block/loop.c > index 9d4545f..9850b27 100644 > --- a/drivers/block/loop.c > +++ b/drivers/block/loop.c > @@ -482,6 +482,8 @@ static void lo_rw_aio_complete(struct kiocb *iocb, long >

Re: [PATCH 2/3] block: make blkcg aware of kthread stored original cgroup info

2017-09-08 Thread Tejun Heo
Hello, On Wed, Sep 06, 2017 at 07:00:52PM -0700, Shaohua Li wrote: > From: Shaohua Li > > Several blkcg APIs are deprecated. After removing them, bio_blkcg is the > only API to get cgroup info for a bio. If bio_blkcg finds current task > is a kthread and has original css recorded,

Re: [PATCH 1/3] kthread: add a mechanism to store cgroup info

2017-09-08 Thread Tejun Heo
On Fri, Sep 08, 2017 at 07:38:46AM -0700, Tejun Heo wrote: > On Fri, Sep 08, 2017 at 07:35:37AM -0700, Tejun Heo wrote: > > * It's a bit weird to associate a kthread with a css without being > > specific. If what's needed is a generic association (this kthread > > is temporarily servicing

Re: [PATCH 1/3] kthread: add a mechanism to store cgroup info

2017-09-08 Thread Tejun Heo
On Fri, Sep 08, 2017 at 07:35:37AM -0700, Tejun Heo wrote: > * It's a bit weird to associate a kthread with a css without being > specific. If what's needed is a generic association (this kthread > is temporarily servicing this cgroup), it should be associated with > the cgroup. But, I

Re: [PATCH 1/3] kthread: add a mechanism to store cgroup info

2017-09-08 Thread Tejun Heo
Hello, On Wed, Sep 06, 2017 at 07:00:51PM -0700, Shaohua Li wrote: > +#ifdef CONFIG_CGROUPS > +void kthread_set_orig_css(struct cgroup_subsys_state *css); > +struct cgroup_subsys_state *kthread_get_orig_css(void); > +void kthread_reset_orig_css(void); * It's a bit weird to associate a kthread

Re: [PATCH] block: tolerate tracing of NULL bio

2017-09-08 Thread Jens Axboe
On 09/07/2017 06:36 PM, Greg Thelen wrote: > __get_request() can call trace_block_getrq() with bio=NULL which causes > block_get_rq::TP_fast_assign() to deref a NULL pointer and panic. > > Syzkaller fuzzer panics with > linux-next (1d53d908b79d7870d89063062584eead4cf83448): > kasan: GPF could

Re: [PATCH] lightnvm: prevent target type module removal when in use

2017-09-08 Thread Matias Bjørling
On 09/08/2017 02:35 PM, Rakesh Pandit wrote: If target type module e.g. pblk here is unloaded (rmmod) while module is in use (after creating target) system crashes. We fix this by using module API refcnt. Signed-off-by: Rakesh Pandit --- drivers/lightnvm/core.c | 4

Re: [PATCH V2 10/12] scsi: sd_zbc: Disable zone write locking with scsi-mq

2017-09-08 Thread Ming Lei
Hi Damien, On Fri, Sep 08, 2017 at 01:16:38AM +0900, Damien Le Moal wrote: > In the case of a ZBC disk used with scsi-mq, zone write locking does > not prevent write reordering in sequential zones. Unlike the legacy > case, zone locking can only be done after the command request is > removed from

[PATCH] lightnvm: prevent target type module removal when in use

2017-09-08 Thread Rakesh Pandit
If target type module e.g. pblk here is unloaded (rmmod) while module is in use (after creating target) system crashes. We fix this by using module API refcnt. Signed-off-by: Rakesh Pandit --- drivers/lightnvm/core.c | 4 drivers/lightnvm/pblk-init.c | 1 +

Re: [PATCH V2 09/12] scsi: sd_zbc: Limit zone write locking to sequential zones

2017-09-08 Thread Johannes Thumshirn
On Fri, Sep 08, 2017 at 11:48:09AM +0200, Christoph Hellwig wrote: > On Fri, Sep 08, 2017 at 10:39:25AM +0200, Johannes Thumshirn wrote: > > It's a shame we have all this overflow checking kcalloc() and > > kmalloc_array() functions but none of them is taking NUMA nodes into > > account. > >

Re: [PATCH] lightnvm: prevent bd removal if busy

2017-09-08 Thread Matias Bjørling
On 09/07/2017 03:58 PM, Rakesh Pandit wrote: Removal of virtual block device by "nvm lnvm remove..." undergoing IO and created by "nvme lnvm create... -t pblk" results in following and is annoying. 446416.309757] bdi-block not registered [446416.309773] [ cut here ]

[PATCH] block,bfq: Disable writeback throttling

2017-09-08 Thread Luca Miccio
Similarly to CFQ, BFQ has its write-throttling heuristics, and it is better not to combine them with further write-throttling heuristics of a different nature. So this commit disables write-back throttling for a device if BFQ is used as I/O scheduler for that device. Signed-off-by: Luca Miccio

Re: [PATCH V2 09/12] scsi: sd_zbc: Limit zone write locking to sequential zones

2017-09-08 Thread Christoph Hellwig
On Fri, Sep 08, 2017 at 10:39:25AM +0200, Johannes Thumshirn wrote: > It's a shame we have all this overflow checking kcalloc() and > kmalloc_array() functions but none of them is taking NUMA nodes into > account. Something that could be trivially fixed..

Re: BFQ + dm-mpath

2017-09-08 Thread Paolo Valente
> Il giorno 07 set 2017, alle ore 17:52, Mike Snitzer ha > scritto: > > On Tue, Sep 05 2017 at 10:15am -0400, > Bart Van Assche wrote: > >> On Tue, 2017-09-05 at 09:56 +0200, Paolo Valente wrote: >>> Ok, my suspects seem confirmed: the path

Re: [PATCH V2 09/12] scsi: sd_zbc: Limit zone write locking to sequential zones

2017-09-08 Thread Johannes Thumshirn
On Fri, Sep 08, 2017 at 01:16:37AM +0900, Damien Le Moal wrote: > +/* > + * Allocate a zone bitmap (one bit per zone). > + */ > +static inline unsigned long *sd_zbc_alloc_zone_bitmap(struct scsi_disk *sdkp) > +{ > + struct request_queue *q = sdkp->disk->queue; > + > + return

Re: [PATCH V2 00/12] scsi-mq support for ZBC disks

2017-09-08 Thread Christoph Hellwig
I'm really worried about how this is tied into the sd driver. >From a quick look it seems like the only thing you really need in the scheduler that is done through struct scsi_disk is the offset + len -> zone number lookup - I'd much rather expose this from sd upwards and keep the scheduler in

Re: [PATCH V2 08/12] scsi: sd_zbc: Fix sd_zbc_read_zoned_characteristics()

2017-09-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

Re: [PATCH V2 07/12] scsi: sd_zbc.c: Use well defined macros

2017-09-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

Re: [PATCH V2 06/12] scsi: sd_zbc: Rearrange code

2017-09-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

Re: [PATCH] block: tolerate tracing of NULL bio

2017-09-08 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH V2 05/12] scsi: sd_zbc: Fix comments and indentation

2017-09-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

Re: [PATCH V2 04/12] scsi: sd_zbc: Move zbc disk declarations to sd_zbc.h

2017-09-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

Re: [PATCH V2 03/12] scsi: sd_zbc: Move ZBC declarations to scsi_proto.h

2017-09-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

Re: [PATCH V2 02/12] block: Fix declaration of blk-mq scheduler functions

2017-09-08 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

Re: [PATCH V2 01/12] block: Fix declaration of blk-mq debugfs functions

2017-09-08 Thread Johannes Thumshirn
On Fri, Sep 08, 2017 at 01:16:29AM +0900, Damien Le Moal wrote: > __blk_mq_debugfs_rq_show() and blk_mq_debugfs_rq_show() are exported > symbols but ar eonly declared in the block internal file are only Otherwise this looks good to me, Reviewed-by: Johannes Thumshirn