Re: [PATCH 03/17] block: provide a direct_make_request helper

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > This helper allows reinserting a bio into a new queue without much > overhead, but requires all queue limits to be the same for the upper > and lower queues, and it does not provide any recursion preventions. > > Signed-off-by: Christoph Hellwig

Re: [PATCH 04/17] block: add a blk_steal_bios helper

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > This helpers allows to bounce steal the uncompleted bios from a request so > that they can be reissued on another path. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Sagi Grimberg > --- > block/blk-core.c | 20 >

Re: [PATCH 05/17] block: don't look at the struct device dev_t in disk_devt

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > The hidden gendisks introduced in the next patch need to keep the dev > field in their struct device empty so that udev won't try to create > block device nodes for them. To support that rewrite disk_devt to > look at the major and first_minor fie

Re: [PATCH 06/17] block: introduce GENHD_FL_HIDDEN

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > With this flag a driver can create a gendisk that can be used for I/O > submission inside the kernel, but which is not registered as user > facing block device. This will be useful for the NVMe multipath > implementation. > > Signed-off-by: Chris

Re: [PATCH 07/17] block: add a poll_fn callback to struct request_queue

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > That we we can also poll non blk-mq queues. Mostly needed for > the NVMe multipath code, but could also be useful elsewhere. > > Signed-off-by: Christoph Hellwig > --- > block/blk-core.c | 11 +++ > block/blk-mq.c

Re: [PATCH 08/17] nvme: use kref_get_unless_zero in nvme_find_get_ns

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > For kref_get_unless_zero to protect against lookup vs free races we need > to use it in all places where we aren't guaranteed to already hold a > reference. There is no such guarantee in nvme_find_get_ns, so switch to > kref_get_unless_zero in thi

Re: [PATCH 09/17] nvme: simplify nvme_open

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > Now that we are protected against lookup vs free races for the namespace > by using kref_get_unless_zero we don't need the hack of NULLing out the > disk private data during removal. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Sagi Grimbe

Re: [PATCH 10/17] nvme: switch controller refcounting to use struct device

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > Instead of allocating a separate struct device for the character device > handle embedd it into struct nvme_ctrl and use it for the main controller > refcounting. This removes double refcounting and gets us an automatic > reference for the charact

Re: [PATCH 11/17] nvme: get rid of nvme_ctrl_list

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > Use the core chrdev code to set up the link between the character device > and the nvme controller. This allows us to get rid of the global list > of all controllers, and also ensures that we have both a reference to > the controller and the trans

Re: [PATCH 12/17] nvme: check for a live controller in nvme_dev_open

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > This is a much more sensible check than just the admin queue. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Sagi Grimberg > Reviewed-by: Johannes Thumshirn > --- > drivers/nvme/host/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 dele

Re: [PATCH 14/17] nvme: introduce a nvme_ns_ids structure

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > This allows us to manage the various uniqueue namespace identifiers > together instead needing various variables and arguments. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Keith Busch > Reviewed-by: Sagi Grimberg > --- > drivers/nvme/h

Re: [PATCH 13/17] nvme: track subsystems

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > This adds a new nvme_subsystem structure so that we can track multiple > controllers that belong to a single subsystem. For now we only use it > to store the NQN, and to check that we don't have duplicate NQNs unless > the involved subsystems supp

Re: [PATCH 15/17] nvme: track shared namespaces

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > Introduce a new struct nvme_ns_head that holds information about an actual > namespace, unlike struct nvme_ns, which only holds the per-controller > namespace information. For private namespaces there is a 1:1 relation of > the two, but for shared

Re: [PATCH V8 00/14] mmc: Add Command Queue support

2017-10-24 Thread Ulf Hansson
[...] >> However, you have completely ignored mine, Linus and Bartlomiej's >> comments about that we want the blkmq port being a separate patch(es) >> and then make the CMDQ patches on top. This worries me, because it >> seems like our messages don't reach you. > > Rubbish! I gave a very good rea

Re: [PATCH 16/17] nvme: implement multipath access to nvme subsystems

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > This patch adds native multipath support to the nvme driver. For each > namespace we create only single block device node, which can be used > to access that namespace through any of the controllers that refer to it. > The gendisk for each control

Re: [PATCH 17/17] nvme: also expose the namespace identification sysfs files for mpath nodes

2017-10-24 Thread Hannes Reinecke
On 10/23/2017 04:51 PM, Christoph Hellwig wrote: > We do this by adding a helper that returns the ns_head for a device that > can belong to either the per-controller or per-subsystem block device > nodes, and otherwise reuse all the existing code. > > Signed-off-by: Christoph Hellwig > Reviewed-b

Re: [PATCH 04/17] block: add a blk_steal_bios helper

2017-10-24 Thread Max Gurtovoy
On 10/23/2017 5:51 PM, Christoph Hellwig wrote: This helpers allows to bounce steal the uncompleted bios from a request so that they can be reissued on another path. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg --- block/blk-core.c | 20 include/l

[PATCH V12 2/5] mmc: block: Add blk-mq support

2017-10-24 Thread Adrian Hunter
Define and use a blk-mq queue. Discards and flushes are processed synchronously, but reads and writes asynchronously. In order to support slow DMA unmapping, DMA unmapping is not done until after the next request is started. That means the request is not completed until then. If there is no next re

[PATCH V12 4/5] mmc: cqhci: support for command queue enabled host

2017-10-24 Thread Adrian Hunter
From: Venkat Gopalakrishnan This patch adds CMDQ support for command-queue compatible hosts. Command queue is added in eMMC-5.1 specification. This enables the controller to process upto 32 requests at a time. Adrian Hunter contributed renaming to cqhci, recovery, suspend and resume, cqhci_off,

[PATCH V12 5/5] mmc: sdhci-pci: Add CQHCI support for Intel GLK

2017-10-24 Thread Adrian Hunter
Add CQHCI initialization and implement CQHCI operations for Intel GLK. Signed-off-by: Adrian Hunter --- drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-pci-core.c | 155 +- 2 files changed, 155 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH V12 3/5] mmc: block: Add CQE support

2017-10-24 Thread Adrian Hunter
Add CQE support to the block driver, including: - optionally using DCMD for flush requests - "manually" issuing discard requests - issuing read / write requests to the CQE - supporting block-layer timeouts - handling recovery - supporting re-tuning CQE offers 25% - 50% bett

[PATCH V12 1/5] mmc: core: Add parameter use_blk_mq

2017-10-24 Thread Adrian Hunter
Until mmc has blk-mq support fully implemented and tested, add a parameter use_blk_mq, default to false unless config option MMC_MQ_DEFAULT is selected. Signed-off-by: Adrian Hunter --- drivers/mmc/Kconfig | 11 +++ drivers/mmc/core/core.c | 7 +++ drivers/mmc/core/core.h |

[PATCH V12 0/5] mmc: Add Command Queue support

2017-10-24 Thread Adrian Hunter
Hi Here is V12 of the hardware command queue patches without the software command queue patches, now using blk-mq and now with blk-mq support for non-CQE I/O. HW CMDQ offers 25% - 50% better random multi-threaded I/O. I see a slight 2% drop in sequential read speed but no change to sequential wr

[PATCH] update bucket_in_use in real time

2017-10-24 Thread tang . junhui
From: Tang Junhui bucket_in_use is updated in gc thread which triggered by invalidating or writing sectors_to_gc dirty data, It's a long interval. Therefore, when we use it to compare with the threshold, it is often not timely, which leads to inaccurate judgment and often results in bucket deplet

Re: [PATCH V8 00/14] mmc: Add Command Queue support

2017-10-24 Thread Adrian Hunter
On 24/10/17 10:39, Ulf Hansson wrote: > [...] > >>> However, you have completely ignored mine, Linus and Bartlomiej's >>> comments about that we want the blkmq port being a separate patch(es) >>> and then make the CMDQ patches on top. This worries me, because it >>> seems like our messages don't r

[PATCH v3 0/8] cross-release: enhence performance and fix false positives

2017-10-24 Thread Byungchul Park
Changes from v2 - Combine 2 serises, fixing false positives and enhance performance - Add Christoph Hellwig's patch simplifying submit_bio_wait() code - Add 2 more 'init with lockdep map' macros for completionm - Rename init_completion_with_map() to init_completion_map() Changes from v1 - Fix kcon

[PATCH v3 4/8] lockdep: Add a kernel parameter, crossrelease_fullstack

2017-10-24 Thread Byungchul Park
Make whether to allow recording full stack, in cross-release feature, switchable at boot time via a kernel parameter, 'crossrelease_fullstack'. In case of a splat with no stack trace, one could just reboot and set the kernel parameter to get the full data without having to recompile the kernel. Ch

[PATCH v3 3/8] lockdep: Remove BROKEN flag of LOCKDEP_CROSSRELEASE

2017-10-24 Thread Byungchul Park
Now the performance regression was fixed, re-enable CONFIG_LOCKDEP_CROSSRELEASE and CONFIG_LOCKDEP_COMPLETIONS. Signed-off-by: Byungchul Park --- lib/Kconfig.debug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 90ea784..fe8fceb

[PATCH v3 5/8] completion: Add support for initializing completion with lockdep_map

2017-10-24 Thread Byungchul Park
Sometimes, we want to initialize completions with sparate lockdep maps to assign lock classes as desired. For example, the workqueue code needs to directly manage lockdep maps, since only the code is aware of how to classify lockdep maps properly. Provide additional macros initializing completions

[PATCH v3 2/8] lockdep: Introduce CROSSRELEASE_STACK_TRACE and make it not unwind as default

2017-10-24 Thread Byungchul Park
Johan Hovold reported a performance regression by crossrelease like: > Boot time (from "Linux version" to login prompt) had in fact doubled > since 4.13 where it took 17 seconds (with my current config) compared to > the 35 seconds I now see with 4.14-rc4. > > I quick bisect pointed to lockdep and

[PATCH v3 8/8] block: Assign a lock_class per gendisk used for wait_for_completion()

2017-10-24 Thread Byungchul Park
Darrick and Dave Chinner posted the following warning: > == > WARNING: possible circular locking dependency detected > 4.14.0-rc1-fixes #1 Tainted: GW > -- > loop0/31693 is trying to acq

[PATCH v3 7/8] genhd.h: Remove trailing white space

2017-10-24 Thread Byungchul Park
Trailing white space is not accepted in kernel coding style. Remove them. Signed-off-by: Byungchul Park --- include/linux/genhd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/genhd.h b/include/linux/genhd.h index ea652bf..6d85a75 100644 --- a/include/linu

[PATCH v3 6/8] lockdep: Remove unnecessary acquisitions wrt workqueue flush

2017-10-24 Thread Byungchul Park
The workqueue added manual acquisitions to catch deadlock cases. Now crossrelease was introduced, some of those are redundant, since wait_for_completion() already includes the acquisition for itself. Removed it. Signed-off-by: Byungchul Park --- include/linux/workqueue.h | 4 ++-- kernel/workqu

[PATCH v3 1/8] block: use DECLARE_COMPLETION_ONSTACK in submit_bio_wait

2017-10-24 Thread Byungchul Park
From: Christoph Hellwig Simplify the code by getting rid of the submit_bio_ret structure. Signed-off-by: Christoph Hellwig --- block/bio.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/block/bio.c b/block/bio.c index 101c2a9..5e901bf 100644 --- a/bloc

Re: [PATCH 1/1] [RFC] blk-mq: fix queue stalling on shared hctx restart

2017-10-24 Thread Ming Lei
On Mon, Oct 23, 2017 at 06:12:29PM +0200, Roman Penyaev wrote: > Hi Ming, > > On Fri, Oct 20, 2017 at 3:39 PM, Ming Lei wrote: > > On Wed, Oct 18, 2017 at 12:22:06PM +0200, Roman Pen wrote: > >> Hi all, > >> > >> the patch below fixes queue stalling when shared hctx marked for restart > >> (BLK_M

Re: [PATCH v3 2/8] lockdep: Introduce CROSSRELEASE_STACK_TRACE and make it not unwind as default

2017-10-24 Thread Ingo Molnar
* Byungchul Park wrote: > Johan Hovold reported a performance regression by crossrelease like: Pplease add Reported-by and Analyzed-by tags - you didn't even Cc: Johan! Thanks, Ingo

Re: [PATCH v3 3/8] lockdep: Remove BROKEN flag of LOCKDEP_CROSSRELEASE

2017-10-24 Thread Ingo Molnar
better changelog: > Subject: locking/lockdep: Remove the BROKEN flag from CONFIG_LOCKDEP_CROSSRELEASE and CONFIG_LOCKDEP_COMPLETIONS From: Byungchul Park Date: Tue, 24 Oct 2017 18:38:04 +0900 Now that the performance regression is fixed, re-enable CONFIG_LOCKDEP_CROSSRELEASE=y

Re: [PATCH v3 2/8] lockdep: Introduce CROSSRELEASE_STACK_TRACE and make it not unwind as default

2017-10-24 Thread Ingo Molnar
Cannot pick up this series yet, but I have enhanced the changelog to: => Subject: locking/lockdep: Introduce CONFIG_CROSSRELEASE_STACK_TRACE and make it not unwind by default From: Byungchul Park Date: Tue, 24 Oct 2017 18:38:03 +0900 Johan Hovold reported a heavy performance regres

Re: [PATCH v3 7/8] genhd.h: Remove trailing white space

2017-10-24 Thread Ingo Molnar
* Byungchul Park wrote: > Trailing white space is not accepted in kernel coding style. Remove > them. > > Signed-off-by: Byungchul Park > --- > include/linux/genhd.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > i

Re: [PATCH v3 4/8] lockdep: Add a kernel parameter, crossrelease_fullstack

2017-10-24 Thread Ingo Molnar
* Byungchul Park wrote: > Make whether to allow recording full stack, in cross-release feature, > switchable at boot time via a kernel parameter, 'crossrelease_fullstack'. > In case of a splat with no stack trace, one could just reboot and set > the kernel parameter to get the full data without

Re: [PATCH v3 8/8] block: Assign a lock_class per gendisk used for wait_for_completion()

2017-10-24 Thread Ingo Molnar
* Byungchul Park wrote: > Darrick and Dave Chinner posted the following warning: > > > == > > WARNING: possible circular locking dependency detected > > 4.14.0-rc1-fixes #1 Tainted: GW > > --

Re: [PATCH] update bucket_in_use in real time

2017-10-24 Thread Coly Li
On 2017/10/24 下午4:57, tang.jun...@zte.com.cn wrote: > From: Tang Junhui > > bucket_in_use is updated in gc thread which triggered by invalidating or > writing sectors_to_gc dirty data, It's a long interval. Therefore, when we > use it to compare with the threshold, it is often not timely, which l

Re: [PATCH] virtio_blk: Fix an SG_IO regression

2017-10-24 Thread Jens Axboe
On 10/24/2017 12:04 AM, Bart Van Assche wrote: > Avoid that submitting an SG_IO ioctl triggers a kernel oops that > is preceded by: > > usercopy: kernel memory overwrite attempt detected to (null) () (6 > bytes) > kernel BUG at mm/usercopy.c:72! > > Additionally, make it easier to diagnose crash

fix pblk testing leftover

2017-10-24 Thread Javier González
Hi Jens, I just noticed a testing leftover that made it in one of this window's patches. Can you pick this up (and eventually squash it)? Thanks, Javier Javier González (1): lightnvm: pblk: remove testing leftover drivers/lightnvm/pblk.h | 5 - 1 file changed, 5 deletions(-) -- 2.7.4

[PATCH] lightnvm: pblk: remove testing leftover

2017-10-24 Thread Javier González
fixes: 8bd400204bd5 ("lightnvm: pblk: cleanup unused and static functions") Signed-off-by: Javier González --- drivers/lightnvm/pblk.h | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 6b64288de6f7..90961033a79f 100644 --- a/drivers/li

Re: [PATCH] lightnvm: pblk: remove testing leftover

2017-10-24 Thread Jens Axboe
On 10/24/2017 07:56 AM, Javier González wrote: > fixes: 8bd400204bd5 ("lightnvm: pblk: cleanup unused and static functions") > Signed-off-by: Javier González Added, thanks. -- Jens Axboe

Re: [PATCH v2] block: fix peeking requests during PM

2017-10-24 Thread Christoph Hellwig
On Mon, Oct 23, 2017 at 06:43:16PM +0800, Ming Lei wrote: > On Fri, Oct 20, 2017 at 04:45:23PM +0200, Christoph Hellwig wrote: > > We need to look for an active PM request until the next softbarrier > > instead of looking for the first non-PM request. Otherwise any cause > > of request reordering

[PATCH] lightnvm: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Matias Bjorling Cc: linux-block@vger.kernel.org Signed-off-by: Kees Cook --- drivers/lightnvm/pblk-co

Re: [PATCH 9/9] bsg: split handling of SCSI CDBs vs transport requeues

2017-10-24 Thread Benjamin Block
> +static int bsg_transport_complete_rq(struct request *rq, struct sg_io_v4 > *hdr) > +{ > + struct bsg_job *job = blk_mq_rq_to_pdu(rq); > + int ret = 0; > + > + /* > + * The assignments below don't make much sense, but are kept for > + * bug by bug backwards compatibility: >

Re: [PATCH 9/9] bsg: split handling of SCSI CDBs vs transport requeues

2017-10-24 Thread Jens Axboe
On 10/23/2017 01:17 AM, Martin K. Petersen wrote: > > Christoph, > >>> Yes, I expected the bsg bits to go through Jens' tree. >> >> Ok, then I misremembered it, and we'll have to delay the remaining >> patches until the next merge window, as they depend on the previous >> ones. > > I don't mind

Re: [PATCH 03/17] block: provide a direct_make_request helper

2017-10-24 Thread Javier González
> On 23 Oct 2017, at 16.51, Christoph Hellwig wrote: > > This helper allows reinserting a bio into a new queue without much > overhead, but requires all queue limits to be the same for the upper > and lower queues, and it does not provide any recursion preventions. > > Signed-off-by: Christoph H

Re: [PATCH] update bucket_in_use in real time

2017-10-24 Thread Michael Lyle
Hi--- On 10/24/2017 01:57 AM, tang.jun...@zte.com.cn wrote: > From: Tang Junhui > > bucket_in_use is updated in gc thread which triggered by invalidating or > writing sectors_to_gc dirty data, It's a long interval. Therefore, when we > use it to compare with the threshold, it is often not timely

[PATCH] nbd: handle interrupted sendmsg with a sndtimeo set

2017-10-24 Thread Josef Bacik
From: Josef Bacik If you do not set sk_sndtimeo you will get -ERESTARTSYS if there is a pending signal when you enter sendmsg, which we handle properly. However if you set a timeout for your commands we'll set sk_sndtimeo to that timeout, which means that sendmsg will start returning -EINTR inste

Re: [PATCH] block: Invalidate cache on discard v2

2017-10-24 Thread Omar Sandoval
On Wed, Mar 22, 2017 at 11:29:25PM +0400, Dmitry Monakhov wrote: > It is reasonable drop page cache on discard, otherwise that pages may > be written by writeback second later, so thin provision devices will > not be happy. This seems to be a security leak in case of secure discard > case. > > A

Re: [PATCH 06/17] block: introduce GENHD_FL_HIDDEN

2017-10-24 Thread Mike Snitzer
On Mon, Oct 23 2017 at 10:51am -0400, Christoph Hellwig wrote: > With this flag a driver can create a gendisk that can be used for I/O > submission inside the kernel, but which is not registered as user > facing block device. This will be useful for the NVMe multipath > implementation. Having t

Re: [PATCH v3 4/8] lockdep: Add a kernel parameter, crossrelease_fullstack

2017-10-24 Thread Byungchul Park
On Tue, Oct 24, 2017 at 12:08:58PM +0200, Ingo Molnar wrote: > This is really unnecessarily complex. I mis-understood your suggestion. I will change it. > The proper logic is to introduce the crossrelease_fullstack boot parameter, > and to > also have a Kconfig option that enables it: > >

Re: [PATCH v3 8/8] block: Assign a lock_class per gendisk used for wait_for_completion()

2017-10-24 Thread Byungchul Park
On Tue, Oct 24, 2017 at 12:15:51PM +0200, Ingo Molnar wrote: > > @@ -1409,9 +1403,12 @@ struct gendisk *alloc_disk_node(int minors, int > > node_id) > > disk_to_dev(disk)->type = &disk_type; > > device_initialize(disk_to_dev(disk)); > > } > > + > > + lockdep_init_map(

Re: [PATCH] update bucket_in_use in real time

2017-10-24 Thread Coly Li
On 2017/10/25 上午2:50, Michael Lyle wrote: > Hi--- > > On 10/24/2017 01:57 AM, tang.jun...@zte.com.cn wrote: >> From: Tang Junhui >> >> bucket_in_use is updated in gc thread which triggered by invalidating or >> writing sectors_to_gc dirty data, It's a long interval. Therefore, when we >> use it t

[PATCH] elevator: lookup mq vs non-mq elevators

2017-10-24 Thread Jens Axboe
If an IO scheduler is selected via elevator= and it doesn't match the driver in question wrt blk-mq support, then we fail to boot. The elevator= parameter is deprecated and only supported for non-mq devices. Augment the elevator lookup API so that we pass in if we're looking for an mq capable sche

Re: [PATCH] block: Invalidate cache on discard v2

2017-10-24 Thread Jens Axboe
On 10/24/2017 03:33 PM, Omar Sandoval wrote: > On Wed, Mar 22, 2017 at 11:29:25PM +0400, Dmitry Monakhov wrote: >> It is reasonable drop page cache on discard, otherwise that pages may >> be written by writeback second later, so thin provision devices will >> not be happy. This seems to be a secur

Re: [PATCH] nbd: handle interrupted sendmsg with a sndtimeo set

2017-10-24 Thread Jens Axboe
On 10/24/2017 01:57 PM, Josef Bacik wrote: > From: Josef Bacik > > If you do not set sk_sndtimeo you will get -ERESTARTSYS if there is a > pending signal when you enter sendmsg, which we handle properly. > However if you set a timeout for your commands we'll set sk_sndtimeo to > that timeout, whi

Re: [PATCH v3 2/8] lockdep: Introduce CROSSRELEASE_STACK_TRACE and make it not unwind as default

2017-10-24 Thread Byungchul Park
On Tue, Oct 24, 2017 at 12:05:16PM +0200, Ingo Molnar wrote: > > * Byungchul Park wrote: > > > Johan Hovold reported a performance regression by crossrelease like: > > Pplease add Reported-by and Analyzed-by tags - you didn't even Cc: Johan! Excuse me but, I am sure, whom is the issue analyzed

Re: Re: [PATCH] update bucket_in_use in real time

2017-10-24 Thread tang . junhui
From: Tang Junhui Thanks to Mike and Coly's comments. >> + if(ca->set->avail_nbuckets > 0) { >> + ca->set->avail_nbuckets--; >> + bch_update_bucket_in_use(ca->set); >> + } >> + > > I am not sure this needs an atomic

Re: Re: [PATCH] update bucket_in_use in real time

2017-10-24 Thread Michael Lyle
On Tue, Oct 24, 2017 at 6:21 PM, wrote: >>> static void bch_btree_gc_finish(struct cache_set *c) >> available should be removed and this function should return 0. > I have changed this function to a void type, so nothing need return. Sorry, I misread that. :) >>> + stats.in_use

[PATCH] [PATCH V2] bcache: update bucket_in_use in real time

2017-10-24 Thread tang . junhui
From: Tang Junhui bucket_in_use is updated in gc thread which triggered by invalidating or writing sectors_to_gc dirty data, It's a long interval. Therefore, when we use it to compare with the threshold, it is often not timely, which leads to inaccurate judgment and often results in bucket deplet

Re: [PATCH] [PATCH V2] bcache: update bucket_in_use in real time

2017-10-24 Thread Michael Lyle
Hi Junhui--- I have applied the patch [with a small whitespace edit] to my tree. I will try to get some test mileage on it. Reviewed-by: Michael Lyle Thanks-- Mike On 10/24/2017 07:26 PM, tang.jun...@zte.com.cn wrote: > From: Tang Junhui > > bucket_in_use is updated in gc thread which trig

[PATCH v4 0/7] cross-release: Enhence performance and fix false positives

2017-10-24 Thread Byungchul Park
There are two things I didn't apply as Ingo suggested, since I didn't understand his intention exactly: 1. Adding 'Analyzed-by' tag at the 2nd patch 2. Using a inline function instead #define at the 7th patch Let me know if the above should still be applied. Changes from v3 - Exclude a pat

[PATCH v4 3/7] locking/lockdep: Remove the BROKEN flag from CONFIG_LOCKDEP_CROSSRELEASE and CONFIG_LOCKDEP_COMPLETIONS

2017-10-24 Thread Byungchul Park
Now that the performance regression is fixed, re-enable CONFIG_LOCKDEP_CROSSRELEASE=y and CONFIG_LOCKDEP_COMPLETIONS=y. Signed-off-by: Byungchul Park --- lib/Kconfig.debug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 3db9167.

[PATCH v4 5/7] completion: Add support for initializing completion with lockdep_map

2017-10-24 Thread Byungchul Park
Sometimes, we want to initialize completions with sparate lockdep maps to assign lock classes as desired. For example, the workqueue code needs to directly manage lockdep maps, since only the code is aware of how to classify lockdep maps properly. Provide additional macros initializing completions

[PATCH v4 2/7] locking/lockdep: Add a boot parameter allowing unwind in cross-release and disable it by default

2017-10-24 Thread Byungchul Park
Johan Hovold reported a heavy performance regression caused by lockdep cross-release: > Boot time (from "Linux version" to login prompt) had in fact doubled > since 4.13 where it took 17 seconds (with my current config) compared to > the 35 seconds I now see with 4.14-rc4. > > I quick bisect

[PATCH v4 1/7] block: use DECLARE_COMPLETION_ONSTACK in submit_bio_wait

2017-10-24 Thread Byungchul Park
From: Christoph Hellwig Simplify the code by getting rid of the submit_bio_ret structure. Signed-off-by: Christoph Hellwig --- block/bio.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/block/bio.c b/block/bio.c index 5f5472e..99d0ca5 100644 --- a/bloc

[PATCH v4 6/7] workqueue: Remove unnecessary acquisitions wrt workqueue flush

2017-10-24 Thread Byungchul Park
The workqueue added manual acquisitions to catch deadlock cases. Now crossrelease was introduced, some of those are redundant, since wait_for_completion() already includes the acquisition for itself. Removed it. Signed-off-by: Byungchul Park --- include/linux/workqueue.h | 4 ++-- kernel/workqu

[PATCH v4 4/7] locking/lockdep: Introduce CONFIG_BOOTPARAM_LOCKDEP_CROSSRELEASE_FULLSTACK

2017-10-24 Thread Byungchul Park
The boot parameter, crossrelease_fullstack, was introduced to control whether to enable unwind in cross-release or not. Add a Kconfig doing the same thing. Suggested-by: Ingo Molnar Signed-off-by: Byungchul Park --- kernel/locking/lockdep.c | 4 lib/Kconfig.debug| 15 +

[PATCH v4 7/7] block: Assign a lock_class per gendisk used for wait_for_completion()

2017-10-24 Thread Byungchul Park
Darrick posted the following warning and Dave Chinner analyzed it: > == > WARNING: possible circular locking dependency detected > 4.14.0-rc1-fixes #1 Tainted: GW > -- > loop0/31693 is t

Re: [PATCH v3 2/8] lockdep: Introduce CROSSRELEASE_STACK_TRACE and make it not unwind as default

2017-10-24 Thread Ingo Molnar
* Byungchul Park wrote: > On Tue, Oct 24, 2017 at 12:05:16PM +0200, Ingo Molnar wrote: > > > > * Byungchul Park wrote: > > > > > Johan Hovold reported a performance regression by crossrelease like: > > > > Pplease add Reported-by and Analyzed-by tags - you didn't even Cc: Johan! > > Excuse

Re: [PATCH v3 8/8] block: Assign a lock_class per gendisk used for wait_for_completion()

2017-10-24 Thread Ingo Molnar
* Byungchul Park wrote: > > Isn't lockdep_map a zero size structure that is always defined? If yes then > > there's no need for an #ifdef. > > No, a zero size structure for lockdep_map is not provided yet. > There are two options I can do: > > 1. Add a zero size structure for lockdep_map and

Re: [PATCH v4 7/7] block: Assign a lock_class per gendisk used for wait_for_completion()

2017-10-24 Thread Ingo Molnar
* Byungchul Park wrote: > Darrick posted the following warning and Dave Chinner analyzed it: > > > == > > WARNING: possible circular locking dependency detected > > 4.14.0-rc1-fixes #1 Tainted: GW > > --

Re: [PATCH v3 0/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-24 Thread Ilya Dryomov
On Mon, Oct 16, 2017 at 3:59 PM, Ilya Dryomov wrote: > Hi Christoph, Martin, > > blkdev_issue_zeroout() now checks for any error. This required a minor > refactor, so I dropped the stable tag, Jens can add it back if needed. > > v2 -> v3: > - another code flow change in blkdev_issue_zeroout() sug

Re: [PATCH] block: move CAP_SYS_ADMIN check in blkdev_roset()

2017-10-24 Thread Ilya Dryomov
On Thu, Oct 19, 2017 at 2:14 AM, Al Viro wrote: > On Wed, Oct 18, 2017 at 02:38:38PM +0200, Ilya Dryomov wrote: >> Check for CAP_SYS_ADMIN before calling into the driver, similar to >> blkdev_flushbuf(). This is safer and can spare a check in the driver. >> >> (Currently BLKROSET is overridden by

Re: [PATCH v4 7/7] block: Assign a lock_class per gendisk used for wait_for_completion()

2017-10-24 Thread Byungchul Park
On Wed, Oct 25, 2017 at 08:01:24AM +0200, Ingo Molnar wrote: > Beyond the #ifdef reduction I mentioned in the other thread, there's four > other > things I noticed that need to be fixed in this patch: > > - Please write out 'minor' instead of the 'm' abbreviation that is > meaningless. >'

Re: [PATCH v4 6/7] workqueue: Remove unnecessary acquisitions wrt workqueue flush

2017-10-24 Thread Ingo Molnar
* Byungchul Park wrote: > The workqueue added manual acquisitions to catch deadlock cases. > Now crossrelease was introduced, some of those are redundant, since > wait_for_completion() already includes the acquisition for itself. > Removed it. > > Signed-off-by: Byungchul Park > --- > include