[PATCH 2/3] lightnvm: pblk: allow allocation of new lines during shutdown

2018-02-21 Thread hans . ml . holmberg
From: Hans Holmberg When shutting down pblk the write buffer is flushed and if the current line can't fit the data in the write buffer we need to allocate a new line, so remove the check that prevents this. Signed-off-by: Hans Holmberg

[PATCH 1/3] lightnvm: pblk: delete writer kick timer before stopping thread

2018-02-21 Thread hans . ml . holmberg
From: Hans Holmberg Unless we delete the timer that wakes up the write thread before we stop the thread we risk re-starting the thread, so delete the timer first. Signed-off-by: Hans Holmberg --- drivers/lightnvm/pblk-init.c | 2 +- 1

[PATCH] lightnvm: pblk: don't recover unwritten lines

2018-02-21 Thread hans . ml . holmberg
From: Hans Holmberg If the line has not been written to, we should not try to recover any data from it, so check the state of the chunks in the line before attempting to read smeta. Signed-off-by: Hans Holmberg Signed-off-by: Javier

[PATCH 04/20] lightnvm: add minor version to generic geometry

2018-02-21 Thread Javier González
Separate the version between major and minor on the generic geometry. Also, add a "subversion" entry to sysfs to expose the minor version without breaking user space. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 4 ++-- drivers/nvme/host/lightnvm.c |

[PATCH 02/20] lightnvm: add controller capabilities to 2.0

2018-02-21 Thread Javier González
Assign missing mccap value on 2.0 path Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index c81e64cc20d7..969bb874850c 100644 ---

Re: [PATCH] blk: optimization for classic polling

2018-02-21 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 12:37:07PM -1000, Jens Axboe wrote: > On 2/20/18 3:21 AM, Peter Zijlstra wrote: > > On Sun, May 30, 2083 at 09:51:06AM +0530, Nitesh Shetty wrote: > >> This removes the dependency on interrupts to wake up task. Set task > >> state as TASK_RUNNING, if need_resched() returns

[PATCH 18/20] lightnvm: pblk: implement get log report chunk

2018-02-21 Thread Javier González
From: Javier González In preparation of pblk supporting 2.0, implement the get log report chunk in pblk. This patch only replicates de bad block functionality as the rest of the metadata requires new pblk functionality (e.g., wear-index to implement wear-leveling). This

[PATCH 20/20] lightnvm: pblk: implement 2.0 support

2018-02-21 Thread Javier González
Implement 2.0 support in pblk. This includes the address formatting and mapping paths, as well as the sysfs entries for them. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 57 ++-- drivers/lightnvm/pblk-sysfs.c | 36 ++--

Re: [PATCH 0/3] pblk bugfixes

2018-02-21 Thread Javier González
> On 21 Feb 2018, at 09.09, Matias Bjørling wrote: > > On 02/21/2018 09:02 AM, hans.ml.holmb...@owltronix.com wrote: >> From: Hans Holmberg >> This is a slew of generic bugfixes to pblk >> The patches apply on top of: >>

[PATCH 08/20] lightnvm: complete geo structure with maxoc*

2018-02-21 Thread Javier González
Complete the generic geometry structure with the maxoc and maxocpu felds, present in the 2.0 spec. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 4 include/linux/lightnvm.h | 2 ++ 2 files changed, 6 insertions(+) diff --git

[PATCH 05/20] lightnvm: rename number of channels and luns

2018-02-21 Thread Javier González
Normalize nomenclature for naming number of channels and number of luns in order to improve readability. Use num_ch and num_lun. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 69 ++-- drivers/lightnvm/pblk-core.c |

[PATCH 01/20] lightnvm: simplify geometry structure.

2018-02-21 Thread Javier González
Currently, the device geometry is stored redundantly in the nvm_id and nvm_geo structures at a device level. Moreover, when instantiating targets on a specific number of LUNs, these structures are replicated and manually modified to fit the instance channel and LUN partitioning. Instead, create a

[PATCH 06/20] lightnvm: add shorten OCSSD version in geo

2018-02-21 Thread Javier González
Create a shorten version to use in the generic geometry. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 6 ++ include/linux/lightnvm.h | 8 2 files changed, 14 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c

[PATCH 09/20] lightnvm: use generic identify structure

2018-02-21 Thread Javier González
Create a generic identify structure to collect the identify information before knowing the spec. version. This forces different version paths to cast the structure to their spec structure, thus making the code less error prone and more maintainable. Signed-off-by: Javier González

[PATCH 0/3] pblk bugfixes

2018-02-21 Thread hans . ml . holmberg
From: Hans Holmberg This is a slew of generic bugfixes to pblk The patches apply on top of: https://github.com/OpenChannelSSD/linux branch for-4.17/core Hans Holmberg (3): lightnvm: pblk: delete writer kick timer before stopping thread lightnvm: pblk: allow

[PATCH 13/20] lightnvm: add support for 2.0 address format

2018-02-21 Thread Javier González
Add support for 2.0 address format. Also, align address bits for 1.2 and 2.0 to be able to operate on channel and luns without requiring a format conversion. Use a generic address format for this purpose. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 20

[PATCH 16/20] lightnvm: implement get log report chunk helpers

2018-02-21 Thread Javier González
From: Javier González The 2.0 spec provides a report chunk log page that can be retrieved using the stangard nvme get log page. This replaces the dedicated get/put bad block table in 1.2. This patch implements the helper functions to allow targets retrieve the chunk metadata

[PATCH 15/20] nvme: make nvme_get_log_ext available

2018-02-21 Thread Javier González
Make nvme_get_log_ext available outside of core.c. This is in preparation for using it in lightnvm.c Signed-off-by: Javier González --- drivers/nvme/host/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index

Re: [PATCH 0/3] pblk bugfixes

2018-02-21 Thread Matias Bjørling
On 02/21/2018 09:02 AM, hans.ml.holmb...@owltronix.com wrote: From: Hans Holmberg This is a slew of generic bugfixes to pblk The patches apply on top of: https://github.com/OpenChannelSSD/linux branch for-4.17/core Hans Holmberg (3): lightnvm: pblk: delete

[PATCH 19/20] lightnvm: pblk: refactor init/exit sequences

2018-02-21 Thread Javier González
Refactor init and exit sequences to improve readability. In the way, fix bad free ordering on the init error path. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 503 ++- 1 file changed, 254 insertions(+), 249

[PATCH V2 00/20] lightnvm: pblk: implement 2.0 support

2018-02-21 Thread Javier González
Changes since V1: Apply Matias' feedback: - Rebase on top of Matias' latest patches. - Use nvme_get_log_ext to submit report chunk and export it. - Re-write report chunk based on Matias' suggestions. Here, I maintained the lba interface, but it was necessary to redo the address

[PATCH 3/3] lightnvm: pblk: prevent race in pblk_rb_flush_point_set

2018-02-21 Thread hans . ml . holmberg
From: Hans Holmberg Make sure that we are not advancing the sync pointer while we're adding bios to the write buffer entry completion list. This race condition results in bios not completing and was identified by a hang when running xfstest generic/113.

Re: [PATCH v2 0/6] lightnvm: base 2.0 implementation

2018-02-21 Thread Javier Gonzalez
> On 15 Feb 2018, at 14.11, Matias Bjørling wrote: > > A couple of patches for 2.0 support for the lightnvm subsystem. They > form the foundation for the integration. > > The first two patches is preparation for the 2.0 work. The third patch > implements the 2.0 data

[PATCH 03/20] lightnvm: fix capabilities for 2.0 sysfs

2018-02-21 Thread Javier González
Both 1.2 and 2.0 specs define a field for media and controller capabilities. Also, 1.2 defines a separate field dedicated to device capabilities. In 2.0 sysfs, this values have been mixed. Revert them to the right value. Signed-off-by: Javier González ---

[PATCH 10/20] lightnvm: pblk: rename ppaf* to addrf*

2018-02-21 Thread Javier González
In preparation for 2.0 support in pblk, rename variables referring to the address format to addrf and reserve ppaf for the 1.2 path. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 8 drivers/lightnvm/pblk-sysfs.c | 4 ++--

[PATCH 17/20] lightnvm: define chunk states

2018-02-21 Thread Javier González
Define chunk states as given in the 2.0 spec. Also, add an extra chunk state that signals that the chunk is in use by the host. This allows for the chunk metadata to be "owned" by a target when active, thus completing the chunk state machine from the host perspective and facilitating sanity

[PATCH 12/20] lightnvm: complete 2.0 values in sysfs

2018-02-21 Thread Javier González
Add missing geometry values to sysfs. Namely, maxoc and maxocpu. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index

[PATCH 14/20] lightnvm: make address conversions depend on generic device

2018-02-21 Thread Javier González
On address conversions, use the generic device, instead of the target device. This allows to use conversions outside of the target's realm. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 4 ++-- include/linux/lightnvm.h | 8 2 files changed, 6

[PATCH 11/20] lightnvm: pblk: check for supported version

2018-02-21 Thread Javier González
At this point, only 1.2 spec is supported, thus check for it. Also, since device-side L2P is only supported in the 1.2 spec, make sure to only check its value under 1.2. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 10 -- 1 file changed, 8

Re: [PATCH v3 0/3] Fix races between blkcg code and request queue initialization and cleanup

2018-02-21 Thread Bart Van Assche
On 02/09/18 10:44, Bart Van Assche wrote: Recently Joseph Qi identified races between the block cgroup code and request queue initialization and cleanup. This patch series address these races. Please consider these patches for kernel v4.17. Hello Joseph, Can you add your Tested-by or

Re: how can one drain MQ request queue ?

2018-02-21 Thread Ming Lei
Hi Max, On Tue, Feb 20, 2018 at 11:56:07AM +0200, Max Gurtovoy wrote: > hi all, > is there a way to drain a blk-mq based request queue (similar to > blk_drain_queue for non MQ) ? Generally speaking, blk_mq_freeze_queue() should be fine to drain blk-mq based request queue, but it may not work

Re: [PATCH 02/20] lightnvm: add controller capabilities to 2.0

2018-02-21 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: Assign missing mccap value on 2.0 path Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index

Re: [PATCH 01/20] lightnvm: simplify geometry structure.

2018-02-21 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: Currently, the device geometry is stored redundantly in the nvm_id and nvm_geo structures at a device level. Moreover, when instantiating targets on a specific number of LUNs, these structures are replicated and manually modified to fit the instance

Re: [PATCH 09/20] lightnvm: use generic identify structure

2018-02-21 Thread Javier González
> On 22 Feb 2018, at 08.47, Matias Bjørling wrote: > > On 02/21/2018 10:26 AM, Javier González wrote: >> Create a generic identify structure to collect the identify information >> before knowing the spec. version. This forces different version paths to >> cast the structure to

Re: [PATCH 10/20] lightnvm: pblk: rename ppaf* to addrf*

2018-02-21 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: In preparation for 2.0 support in pblk, rename variables referring to the address format to addrf and reserve ppaf for the 1.2 path. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 8

Re: [PATCH 11/20] lightnvm: pblk: check for supported version

2018-02-21 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: At this point, only 1.2 spec is supported, thus check for it. Also, since device-side L2P is only supported in the 1.2 spec, make sure to only check its value under 1.2. Signed-off-by: Javier González ---

Re: [PATCH V15 06/22] mmc: block: Add blk-mq support

2018-02-21 Thread Adrian Hunter
On 21/02/18 22:50, Dmitry Osipenko wrote: > On 29.11.2017 16:41, Adrian Hunter wrote: >> 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

Re: [PATCH 09/20] lightnvm: use generic identify structure

2018-02-21 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: Create a generic identify structure to collect the identify information before knowing the spec. version. This forces different version paths to cast the structure to their spec structure, thus making the code less error prone and more maintainable.

Re: [PATCH 03/20] lightnvm: fix capabilities for 2.0 sysfs

2018-02-21 Thread Javier Gonzalez
> On 22 Feb 2018, at 08.28, Matias Bjørling wrote: > > On 02/21/2018 10:26 AM, Javier González wrote: >> Both 1.2 and 2.0 specs define a field for media and controller >> capabilities. Also, 1.2 defines a separate field dedicated to device >> capabilities. >> In 2.0 sysfs, this

Re: [PATCH 04/20] lightnvm: add minor version to generic geometry

2018-02-21 Thread Javier González
> On 22 Feb 2018, at 08.34, Matias Bjørling wrote: > > On 02/21/2018 10:26 AM, Javier González wrote: >> Separate the version between major and minor on the generic geometry. >> Also, add a "subversion" entry to sysfs to expose the minor version >> without breaking user space.

Re: [PATCH 04/20] lightnvm: add minor version to generic geometry

2018-02-21 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: Separate the version between major and minor on the generic geometry. Also, add a "subversion" entry to sysfs to expose the minor version without breaking user space. Signed-off-by: Javier González ---

Re: [PATCH 07/20] lightnvm: rename sect_* to sec_*

2018-02-21 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: Rename abbreviations for sector from sect_* to sec_* as most of the code uses this format and it is confusing when using the different structures. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 8

Re: [PATCH 01/20] lightnvm: simplify geometry structure.

2018-02-21 Thread Javier Gonzalez
> On 22 Feb 2018, at 08.25, Matias Bjørling wrote: > > On 02/21/2018 10:26 AM, Javier González wrote: >> Currently, the device geometry is stored redundantly in the nvm_id and >> nvm_geo structures at a device level. Moreover, when instantiating >> targets on a specific number

Re: [PATCH 03/20] lightnvm: fix capabilities for 2.0 sysfs

2018-02-21 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: Both 1.2 and 2.0 specs define a field for media and controller capabilities. Also, 1.2 defines a separate field dedicated to device capabilities. In 2.0 sysfs, this values have been mixed. Revert them to the right value. Signed-off-by: Javier

Re: [PATCH 08/20] lightnvm: complete geo structure with maxoc*

2018-02-21 Thread Matias Bjørling
On 02/21/2018 10:26 AM, Javier González wrote: Complete the generic geometry structure with the maxoc and maxocpu felds, present in the 2.0 spec. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 4 include/linux/lightnvm.h | 2 ++ 2 files

Re: [PATCH v2] blk-mq: Fix race between resetting the timer and completion handling

2018-02-21 Thread Bart Van Assche
On Wed, 2018-02-21 at 11:21 -0800, t...@kernel.org wrote: > Hello, Bart. > > On Wed, Feb 21, 2018 at 06:53:05PM +, Bart Van Assche wrote: > > On Sun, 2018-02-18 at 05:11 -0800, t...@kernel.org wrote: > > > On Wed, Feb 14, 2018 at 04:58:56PM +, Bart Van Assche wrote: > > > > With this

Re: [PATCH v3 3/3] block: Fix a race between request queue removal and the block cgroup controller

2018-02-21 Thread Joseph Qi
Hi Bart, Sorry for the delayed response since I was on holiday. On 18/2/10 02:44, Bart Van Assche wrote: > Avoid that the following race can occur: > > blk_cleanup_queue() blkcg_print_blkgs() > spin_lock_irq(lock) (1) spin_lock_irq(blkg->q->queue_lock) (2,5) >

Re: [PATCH v2] block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into

2018-02-21 Thread Martin K. Petersen
Bart, > It happens often while I'm preparing a patch for a block driver that > I'm wondering: is a definition of SECTOR_SIZE and/or SECTOR_SHIFT > available for this driver? Do I have to introduce definitions of these > constants before I can use these constants? To avoid this confusion, > move

Re: [PATCH v3 3/3] block: Fix a race between request queue removal and the block cgroup controller

2018-02-21 Thread Ming Lei
On Thu, Feb 22, 2018 at 10:25:28AM +0800, Joseph Qi wrote: > Hi Bart, > > Sorry for the delayed response since I was on holiday. > > On 18/2/10 02:44, Bart Van Assche wrote: > > Avoid that the following race can occur: > > > > blk_cleanup_queue() blkcg_print_blkgs() > >

Re: [PATCH RESEND] blk-throttle: avoid double counted

2018-02-21 Thread Liu Bo
On Wed, Feb 14, 2018 at 11:22:10AM +0800, xuejiufei wrote: > If a bio is split after counted to the stat_bytes and stat_ios in > blkcg_bio_issue_check(), the bio could be resubmitted and enters the > block throttle layer again. This will cause the part of the bio is > counted twice. > > The flag

Re: [PATCH v2] blk-throttle: fix race between blkcg_bio_issue_check and cgroup_rmdir

2018-02-21 Thread Joseph Qi
Hi Tejun, Sorry for the delayed reply. On 18/2/13 01:11, Tejun Heo wrote: > Hello, Joseph. > > On Fri, Feb 09, 2018 at 10:15:19AM +0800, Joseph Qi wrote: >> IIUC, we have to identify it is in blkcg_css_offline now which will >> blkg_put. Since percpu_ref_kill_and_confirm in kill_css will set

Re: [PATCH V2] block: pass inclusive 'lend' parameter to truncate_inode_pages_range

2018-02-21 Thread Ming Lei
On Sat, Feb 10, 2018 at 8:46 AM, Ming Lei wrote: > The 'lend' parameter of truncate_inode_pages_range is required to be > inclusive, so follow the rule. > > This patch fixes one memory corruption triggered by discard. > > Cc: > Cc: Dmitry Monakhov

Re: [PATCH] Use bio_endio instead of bio_put in error path of blk_rq_append_bio

2018-02-21 Thread Boaz Harrosh
On 20/02/18 17:21, Jiri Palecek wrote: > Hello, > > I had a look at the callers of blk_rq_append_bio and checked the > callers. Some changes may need to be done there and I'd like the input > of their maintainers as well before finalising the patch. > > Ming Lei writes: >

Re: [PATCH] Use bio_endio instead of bio_put in error path of blk_rq_append_bio

2018-02-21 Thread Boaz Harrosh
On 21/02/18 18:20, Boaz Harrosh wrote: <> > again not followed closely but if it is about the free of the bounce buffers > then I would just disable bouncing for osd all together. There are only a very > few (2) drivers that support bidi for osd. iscsi and iser so we know those are > totally cool

Re: v4.16-rc1 + dm-mpath + BFQ

2018-02-21 Thread Bart Van Assche
On Fri, 2018-02-16 at 08:39 +0100, Paolo Valente wrote: > after enabling the listing options in your list, and a few other > related options, such iblock support, I get this: > > $ sudo ./run_tests -c -d -r 10 -t 02-mq -e bfq > Unloaded the ib_srpt kernel module > Unloaded the rdma_rxe kernel

Re: [PATCH v2] blk-mq: Fix race between resetting the timer and completion handling

2018-02-21 Thread t...@kernel.org
Hello, Bart. On Wed, Feb 21, 2018 at 06:53:05PM +, Bart Van Assche wrote: > On Sun, 2018-02-18 at 05:11 -0800, t...@kernel.org wrote: > > On Wed, Feb 14, 2018 at 04:58:56PM +, Bart Van Assche wrote: > > > With this patch applied the tests I ran so far pass. > > > > Ah, great to hear.

Re: [PATCH v2] blk-mq: Fix race between resetting the timer and completion handling

2018-02-21 Thread Bart Van Assche
On Sun, 2018-02-18 at 05:11 -0800, t...@kernel.org wrote: > On Wed, Feb 14, 2018 at 04:58:56PM +, Bart Van Assche wrote: > > With this patch applied the tests I ran so far pass. > > Ah, great to hear. Thanks a lot for testing. Can you please verify > the following? It's the same approach

Re: [PATCH V15 06/22] mmc: block: Add blk-mq support

2018-02-21 Thread Dmitry Osipenko
On 29.11.2017 16:41, Adrian Hunter wrote: > 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