* Re: [PATCHv12 11/12] nvme: register fdp parameters with the block layer
[not found] ` <20241206221801.790690-12-kbusch@meta.com>
@ 2024-12-09 4:05 ` kernel test robot
2024-12-09 12:44 ` Christoph Hellwig
2024-12-09 8:34 ` Hannes Reinecke
` (2 subsequent siblings)
3 siblings, 1 reply; 33+ messages in thread
From: kernel test robot @ 2024-12-09 4:05 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: llvm, oe-kbuild-all, sagi, asml.silence, anuj20.g, joshi.k,
Keith Busch
Hi Keith,
kernel test robot noticed the following build warnings:
[auto build test WARNING on axboe-block/for-next]
[also build test WARNING on next-20241206]
[cannot apply to brauner-vfs/vfs.all hch-configfs/for-next linus/master v6.13-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Keith-Busch/fs-add-write-stream-information-to-statx/20241207-063826
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
patch link: https://lore.kernel.org/r/20241206221801.790690-12-kbusch%40meta.com
patch subject: [PATCHv12 11/12] nvme: register fdp parameters with the block layer
config: i386-buildonly-randconfig-001-20241207 (https://download.01.org/0day-ci/archive/20241207/202412071144.9uXFLnls-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241207/202412071144.9uXFLnls-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412071144.9uXFLnls-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/nvme/host/core.c:8:
In file included from include/linux/blkdev.h:9:
In file included from include/linux/blk_types.h:10:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:8:
In file included from include/linux/cacheflush.h:5:
In file included from arch/x86/include/asm/cacheflush.h:5:
In file included from include/linux/mm.h:2223:
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> drivers/nvme/host/core.c:2187:11: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
2187 | } while (i++ < fdp_idx);
| ^
drivers/nvme/host/core.c:2160:7: note: initialize the variable 'i' to silence this warning
2160 | int i, n, ret;
| ^
| = 0
2 warnings generated.
vim +/i +2187 drivers/nvme/host/core.c
2153
2154 static int nvme_check_fdp(struct nvme_ns *ns, struct nvme_ns_info *info,
2155 u8 fdp_idx)
2156 {
2157 struct nvme_fdp_config_log hdr, *h;
2158 struct nvme_fdp_config_desc *desc;
2159 size_t size = sizeof(hdr);
2160 int i, n, ret;
2161 void *log;
2162
2163 info->runs = 0;
2164 ret = nvme_get_log_lsi(ns->ctrl, 0, NVME_LOG_FDP_CONFIGS, 0, NVME_CSI_NVM,
2165 (void *)&hdr, size, 0, info->endgid);
2166 if (ret)
2167 return ret;
2168
2169 size = le32_to_cpu(hdr.sze);
2170 h = kzalloc(size, GFP_KERNEL);
2171 if (!h)
2172 return 0;
2173
2174 ret = nvme_get_log_lsi(ns->ctrl, 0, NVME_LOG_FDP_CONFIGS, 0, NVME_CSI_NVM,
2175 h, size, 0, info->endgid);
2176 if (ret)
2177 goto out;
2178
2179 n = le16_to_cpu(h->numfdpc) + 1;
2180 if (fdp_idx > n)
2181 goto out;
2182
2183 log = h + 1;
2184 do {
2185 desc = log;
2186 log += le16_to_cpu(desc->dsze);
> 2187 } while (i++ < fdp_idx);
2188
2189 info->runs = le64_to_cpu(desc->runs);
2190 out:
2191 kfree(h);
2192 return ret;
2193 }
2194
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 01/12] fs: add write stream information to statx
[not found] ` <20241206221801.790690-2-kbusch@meta.com>
@ 2024-12-09 8:25 ` Hannes Reinecke
2024-12-09 11:44 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:25 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Add new statx field to report the maximum number of write streams
> supported and the granularity for them.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> [hch: rename hint to stream, add granularity]
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/stat.c | 2 ++
> include/linux/stat.h | 2 ++
> include/uapi/linux/stat.h | 7 +++++--
> 3 files changed, 9 insertions(+), 2 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 02/12] fs: add a write stream field to the kiocb
[not found] ` <20241206221801.790690-3-kbusch@meta.com>
@ 2024-12-09 8:25 ` Hannes Reinecke
2024-12-09 12:47 ` [PATCHv12 01/12] fs: add write stream information to statx Christian Brauner
2024-12-10 7:24 ` [PATCHv12 02/12] fs: add a write stream field to the kiocb Nitesh Shetty
2 siblings, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:25 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> Prepare for io_uring passthrough of write streams. The write stream
> field in the kiocb structure fits into an existing 2-byte hole, so its
> size is not changed.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> include/linux/fs.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 2cc3d45da7b01..26940c451f319 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -373,6 +373,7 @@ struct kiocb {
> void *private;
> int ki_flags;
> u16 ki_ioprio; /* See linux/ioprio.h */
> + u8 ki_write_stream;
> union {
> /*
> * Only used for async buffered reads, where it denotes the
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 03/12] block: add a bi_write_stream field
[not found] ` <20241206221801.790690-4-kbusch@meta.com>
@ 2024-12-09 8:26 ` Hannes Reinecke
2024-12-10 7:34 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:26 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> Add the ability to pass a write stream for placement control in the bio.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> block/bio.c | 2 ++
> block/blk-crypto-fallback.c | 1 +
> block/blk-merge.c | 4 ++++
> block/bounce.c | 1 +
> include/linux/blk_types.h | 1 +
> 5 files changed, 9 insertions(+)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 04/12] block: introduce max_write_streams queue limit
[not found] ` <20241206221801.790690-5-kbusch@meta.com>
@ 2024-12-09 8:27 ` Hannes Reinecke
2024-12-10 7:38 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:27 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Drivers with hardware that support write streams need a way to export how
> many are available so applications can generically query this.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> [hch: renamed hints to streams, removed stacking]
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> Documentation/ABI/stable/sysfs-block | 7 +++++++
> block/blk-sysfs.c | 3 +++
> include/linux/blkdev.h | 9 +++++++++
> 3 files changed, 19 insertions(+)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 05/12] block: introduce a write_stream_granularity queue limit
[not found] ` <20241206221801.790690-6-kbusch@meta.com>
@ 2024-12-09 8:29 ` Hannes Reinecke
2024-12-10 7:45 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:29 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> Export the granularity that write streams should be discarded with,
> as it is essential for making good use of them.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> Documentation/ABI/stable/sysfs-block | 8 ++++++++
> block/blk-sysfs.c | 3 +++
> include/linux/blkdev.h | 7 +++++++
> 3 files changed, 18 insertions(+)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 06/12] block: expose write streams for block device nodes
[not found] ` <20241206221801.790690-7-kbusch@meta.com>
@ 2024-12-09 8:30 ` Hannes Reinecke
2024-12-09 10:58 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:30 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> Export statx information about the number and granularity of write
> streams, use the per-kiocb write hint and map temperature hints
> to write streams (which is a bit questionable, but this shows how it is
> done).
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> block/bdev.c | 6 ++++++
> block/fops.c | 23 +++++++++++++++++++++++
> 2 files changed, 29 insertions(+)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 07/12] io_uring: enable per-io write streams
[not found] ` <20241206221801.790690-8-kbusch@meta.com>
@ 2024-12-09 8:31 ` Hannes Reinecke
0 siblings, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:31 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Allow userspace to pass a per-I/O write stream in the SQE:
>
> __u8 write_stream;
>
> The __u8 type matches the size the filesystems and block layer support.
>
> Application can query the supported values from the statx
> max_write_streams field. Unsupported values are ignored by file
> operations that do not support write streams or rejected with an error
> by those that support them.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> include/uapi/linux/io_uring.h | 4 ++++
> io_uring/io_uring.c | 2 ++
> io_uring/rw.c | 1 +
> 3 files changed, 7 insertions(+)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 08/12] nvme: add a nvme_get_log_lsi helper
[not found] ` <20241206221801.790690-9-kbusch@meta.com>
@ 2024-12-09 8:31 ` Hannes Reinecke
2024-12-10 12:12 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:31 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> For log pages that need to pass in a LSI value, while at the same time
> not touching all the existing nvme_get_log callers.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/nvme/host/core.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 09/12] nvme: pass a void pointer to nvme_get/set_features for the result
[not found] ` <20241206221801.790690-10-kbusch@meta.com>
@ 2024-12-09 8:32 ` Hannes Reinecke
2024-12-10 12:13 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:32 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> That allows passing in structures instead of the u32 result, and thus
> reduce the amount of bit shifting and masking required to parse the
> result.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/nvme/host/core.c | 4 ++--
> drivers/nvme/host/nvme.h | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 10/12] nvme.h: add FDP definitions
[not found] ` <20241206221801.790690-11-kbusch@meta.com>
@ 2024-12-09 8:33 ` Hannes Reinecke
2024-12-10 12:19 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:33 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:17, Keith Busch wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> Add the config feature result, config log page, and management receive
> commands needed for FDP.
>
> Partially based on a patch from Kanchan Joshi <joshi.k@samsung.com>.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> [kbusch: renamed some fields to match spec]
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> include/linux/nvme.h | 77 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 77 insertions(+)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 11/12] nvme: register fdp parameters with the block layer
[not found] ` <20241206221801.790690-12-kbusch@meta.com>
2024-12-09 4:05 ` [PATCHv12 11/12] nvme: register fdp parameters with the block layer kernel test robot
@ 2024-12-09 8:34 ` Hannes Reinecke
2024-12-09 13:18 ` Christoph Hellwig
2024-12-10 8:45 ` Dan Carpenter
3 siblings, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:34 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:18, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Register the device data placement limits if supported. This is just
> registering the limits with the block layer. Nothing beyond reporting
> these attributes is happening in this patch.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/nvme/host/core.c | 112 +++++++++++++++++++++++++++++++++++++++
> drivers/nvme/host/nvme.h | 4 ++
> 2 files changed, 116 insertions(+)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 12/12] nvme: use fdp streams if write stream is provided
[not found] ` <20241206221801.790690-13-kbusch@meta.com>
@ 2024-12-09 8:34 ` Hannes Reinecke
2024-12-10 7:27 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Hannes Reinecke @ 2024-12-09 8:34 UTC (permalink / raw)
To: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring
Cc: sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
On 12/6/24 23:18, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Maps a user requested write stream to an FDP placement ID if possible.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/nvme/host/core.c | 32 +++++++++++++++++++++++++++++++-
> drivers/nvme/host/nvme.h | 1 +
> 2 files changed, 32 insertions(+), 1 deletion(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 06/12] block: expose write streams for block device nodes
[not found] ` <20241206221801.790690-7-kbusch@meta.com>
2024-12-09 8:30 ` [PATCHv12 06/12] block: expose write streams for block device nodes Hannes Reinecke
@ 2024-12-09 10:58 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-09 10:58 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 1975 bytes --]
On 06/12/24 02:17PM, Keith Busch wrote:
>From: Christoph Hellwig <hch@lst.de>
>
>Export statx information about the number and granularity of write
>streams, use the per-kiocb write hint and map temperature hints
>to write streams (which is a bit questionable, but this shows how it is
>done).
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>---
> block/bdev.c | 6 ++++++
> block/fops.c | 23 +++++++++++++++++++++++
> 2 files changed, 29 insertions(+)
>
>diff --git a/block/bdev.c b/block/bdev.c
>index 738e3c8457e7f..c23245f1fdfe3 100644
>--- a/block/bdev.c
>+++ b/block/bdev.c
>@@ -1296,6 +1296,12 @@ void bdev_statx(struct path *path, struct kstat *stat,
> stat->result_mask |= STATX_DIOALIGN;
> }
>
>+ if ((request_mask & STATX_WRITE_STREAM) &&
We may not reach this point, if user application doesn't set either of
STATX_DIOALIGN or STATX_WRITE_ATOMIC.
>+ bdev_max_write_streams(bdev)) {
>+ stat->write_stream_max = bdev_max_write_streams(bdev);
>+ stat->result_mask |= STATX_WRITE_STREAM;
statx will show value of 0 for write_stream_granularity.
Below is the fix which might help you,
diff --git a/block/bdev.c b/block/bdev.c
index c23245f1fdfe..290577e20457 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -1275,7 +1275,8 @@ void bdev_statx(struct path *path, struct kstat *stat,
struct inode *backing_inode;
struct block_device *bdev;
- if (!(request_mask & (STATX_DIOALIGN | STATX_WRITE_ATOMIC)))
+ if (!(request_mask & (STATX_DIOALIGN | STATX_WRITE_ATOMIC |
+ STATX_WRITE_STREAM)))
return;
backing_inode = d_backing_inode(path->dentry);
@@ -1299,6 +1300,7 @@ void bdev_statx(struct path *path, struct kstat *stat,
if ((request_mask & STATX_WRITE_STREAM) &&
bdev_max_write_streams(bdev)) {
stat->write_stream_max = bdev_max_write_streams(bdev);
+ stat->write_stream_granularity = bdev_write_stream_granularity(bdev);
stat->result_mask |= STATX_WRITE_STREAM;
}
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [PATCHv12 01/12] fs: add write stream information to statx
[not found] ` <20241206221801.790690-2-kbusch@meta.com>
2024-12-09 8:25 ` [PATCHv12 01/12] fs: add write stream information to statx Hannes Reinecke
@ 2024-12-09 11:44 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-09 11:44 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
On 06/12/24 02:17PM, Keith Busch wrote:
>From: Keith Busch <kbusch@kernel.org>
>
>Add new statx field to report the maximum number of write streams
>supported and the granularity for them.
>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>[hch: rename hint to stream, add granularity]
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>---
> fs/stat.c | 2 ++
> include/linux/stat.h | 2 ++
> include/uapi/linux/stat.h | 7 +++++--
> 3 files changed, 9 insertions(+), 2 deletions(-)
>
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 11/12] nvme: register fdp parameters with the block layer
2024-12-09 4:05 ` [PATCHv12 11/12] nvme: register fdp parameters with the block layer kernel test robot
@ 2024-12-09 12:44 ` Christoph Hellwig
0 siblings, 0 replies; 33+ messages in thread
From: Christoph Hellwig @ 2024-12-09 12:44 UTC (permalink / raw)
To: kernel test robot
Cc: Keith Busch, axboe, hch, linux-block, linux-nvme, linux-fsdevel,
io-uring, llvm, oe-kbuild-all, sagi, asml.silence, anuj20.g,
joshi.k, Keith Busch
On Mon, Dec 09, 2024 at 12:05:27PM +0800, kernel test robot wrote:
> >> drivers/nvme/host/core.c:2187:11: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
> 2187 | } while (i++ < fdp_idx);
> | ^
> drivers/nvme/host/core.c:2160:7: note: initialize the variable 'i' to silence this warning
> 2160 | int i, n, ret;
> | ^
> | = 0
> 2 warnings generated.
Yeah, looks like this is uninitialized. Did I mention I hate these
variable length log entries in nvme? They've already been a major
pain in ANA before..
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 01/12] fs: add write stream information to statx
[not found] ` <20241206221801.790690-3-kbusch@meta.com>
2024-12-09 8:25 ` [PATCHv12 02/12] fs: add a write stream field to the kiocb Hannes Reinecke
@ 2024-12-09 12:47 ` Christian Brauner
2024-12-10 7:24 ` [PATCHv12 02/12] fs: add a write stream field to the kiocb Nitesh Shetty
2 siblings, 0 replies; 33+ messages in thread
From: Christian Brauner @ 2024-12-09 12:47 UTC (permalink / raw)
To: Keith Busch, axboe
Cc: hch, linux-block, linux-nvme, linux-fsdevel, io-uring, sagi,
asml.silence, anuj20.g, joshi.k, Keith Busch
On Fri, Dec 06, 2024 at 02:17:50PM -0800, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Add new statx field to report the maximum number of write streams
> supported and the granularity for them.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> [hch: rename hint to stream, add granularity]
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/stat.c | 2 ++
> include/linux/stat.h | 2 ++
> include/uapi/linux/stat.h | 7 +++++--
> 3 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/fs/stat.c b/fs/stat.c
> index 0870e969a8a0b..00e4598b1ff25 100644
> --- a/fs/stat.c
> +++ b/fs/stat.c
> @@ -729,6 +729,8 @@ cp_statx(const struct kstat *stat, struct statx __user *buffer)
> tmp.stx_atomic_write_unit_min = stat->atomic_write_unit_min;
> tmp.stx_atomic_write_unit_max = stat->atomic_write_unit_max;
> tmp.stx_atomic_write_segments_max = stat->atomic_write_segments_max;
> + tmp.stx_write_stream_granularity = stat->write_stream_granularity;
> + tmp.stx_write_stream_max = stat->write_stream_max;
>
> return copy_to_user(buffer, &tmp, sizeof(tmp)) ? -EFAULT : 0;
> }
> diff --git a/include/linux/stat.h b/include/linux/stat.h
> index 3d900c86981c5..36d4dfb291abd 100644
> --- a/include/linux/stat.h
> +++ b/include/linux/stat.h
> @@ -57,6 +57,8 @@ struct kstat {
> u32 atomic_write_unit_min;
> u32 atomic_write_unit_max;
> u32 atomic_write_segments_max;
> + u32 write_stream_granularity;
> + u16 write_stream_max;
> };
>
> /* These definitions are internal to the kernel for now. Mainly used by nfsd. */
> diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h
> index 887a252864416..547c62a1a3a7c 100644
> --- a/include/uapi/linux/stat.h
> +++ b/include/uapi/linux/stat.h
> @@ -132,9 +132,11 @@ struct statx {
> __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */
> /* 0xb0 */
> __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */
> - __u32 __spare1[1];
> + __u32 stx_write_stream_granularity;
> /* 0xb8 */
> - __u64 __spare3[9]; /* Spare space for future expansion */
> + __u16 stx_write_stream_max;
> + __u16 __sparse2[3];
> + __u64 __spare3[8]; /* Spare space for future expansion */
> /* 0x100 */
> };
Once you're ready to merge, let me know so I can give you a stable
branch with the fs changes.
>
> @@ -164,6 +166,7 @@ struct statx {
> #define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */
> #define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */
> #define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */
> +#define STATX_WRITE_STREAM 0x00020000U /* Want/got write_stream_* */
>
> #define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
>
> --
> 2.43.5
>
On Fri, Dec 06, 2024 at 02:17:51PM -0800, Keith Busch wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> Prepare for io_uring passthrough of write streams. The write stream
> field in the kiocb structure fits into an existing 2-byte hole, so its
> size is not changed.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> include/linux/fs.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 2cc3d45da7b01..26940c451f319 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -373,6 +373,7 @@ struct kiocb {
> void *private;
> int ki_flags;
> u16 ki_ioprio; /* See linux/ioprio.h */
> + u8 ki_write_stream;
> union {
> /*
> * Only used for async buffered reads, where it denotes the
> --
> 2.43.5
>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 00/12] block write streams with nvme fdp
[not found] <20241206221801.790690-1-kbusch@meta.com>
` (6 preceding siblings ...)
[not found] ` <20241206221801.790690-3-kbusch@meta.com>
@ 2024-12-09 12:55 ` Christoph Hellwig
2024-12-09 16:07 ` Keith Busch
[not found] ` <20241206221801.790690-12-kbusch@meta.com>
` (4 subsequent siblings)
12 siblings, 1 reply; 33+ messages in thread
From: Christoph Hellwig @ 2024-12-09 12:55 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
I just compared this to a crude rebase of what I last sent out, and
AFAICS the differences are:
1) basically all new io_uring handling due to the integrity stuff that
went in
2) fixes for the NVMe FDP log page parsing
3) drop the support for the remapping of per-partition streams
conceptually this all looks fine to me. I'll throw in a few nitpicks
on the nvme bits, and I'd need to get up to speed a bit more on the
io_uring bits before commenting useful.
One thing that came I was pondering for a new version is if statx
really is the right vehicle for this as it is a very common fast-path
information. If we had a separate streaminfo ioctl or fcntl it might
be easier to leave a bit spare space for extensibility. I can try to
prototype that or we can leave it as-is because everyone is tired of
the series.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 11/12] nvme: register fdp parameters with the block layer
[not found] ` <20241206221801.790690-12-kbusch@meta.com>
2024-12-09 4:05 ` [PATCHv12 11/12] nvme: register fdp parameters with the block layer kernel test robot
2024-12-09 8:34 ` Hannes Reinecke
@ 2024-12-09 13:18 ` Christoph Hellwig
2024-12-09 16:29 ` Keith Busch
2024-12-10 8:45 ` Dan Carpenter
3 siblings, 1 reply; 33+ messages in thread
From: Christoph Hellwig @ 2024-12-09 13:18 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
> +static int nvme_check_fdp(struct nvme_ns *ns, struct nvme_ns_info *info,
> + u8 fdp_idx)
Maybe nvme_query_fdp_runs or something else that makes it clear this
is trying to find the runs field might make sense to name this a little
bit more descriptively.
> +{
> + struct nvme_fdp_config_log hdr, *h;
> + struct nvme_fdp_config_desc *desc;
> + size_t size = sizeof(hdr);
> + int i, n, ret;
> + void *log;
> +
> + info->runs = 0;
> + ret = nvme_get_log_lsi(ns->ctrl, 0, NVME_LOG_FDP_CONFIGS, 0, NVME_CSI_NVM,
Overly long line here, and same for the second call below.
> + (void *)&hdr, size, 0, info->endgid);
And this cast isn't actually needed.
> + n = le16_to_cpu(h->numfdpc) + 1;
> + if (fdp_idx > n)
> + goto out;
> +
> + log = h + 1;
> + do {
> + desc = log;
> + log += le16_to_cpu(desc->dsze);
> + } while (i++ < fdp_idx);
Maybe a for loop makes it easier to avoid the uninitialized variable,
e.g.
for (i = 0; i < fdp_index; i++) {
..
> + if (ns->ctrl->ctratt & NVME_CTRL_ATTR_FDPS) {
> + ret = nvme_query_fdp_info(ns, info);
> + if (ret)
> + dev_warn(ns->ctrl->device,
> + "FDP failure status:0x%x\n", ret);
> + if (ret < 0)
> + goto out;
> + }
Looking at the full series with the next patch applied I'm a bit
confused about the handling when rescanning. AFAIK the code now always
goes into nvme_query_fdp_info when NVME_CTRL_ATTR_FDPS even if
head->plids/head->nr_plids is already set, and that will then simply
override them, even if they were already set.
Also the old freeing of head->plids in nvme_free_ns_head seems gone in
this version.
Last not but least "FDP failure" is probably not a very helpful message
when it could come from about half a dozen different commands sent to
the device.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 00/12] block write streams with nvme fdp
2024-12-09 12:55 ` [PATCHv12 00/12] block write streams with nvme fdp Christoph Hellwig
@ 2024-12-09 16:07 ` Keith Busch
2024-12-10 1:49 ` Martin K. Petersen
2024-12-10 7:19 ` Christoph Hellwig
0 siblings, 2 replies; 33+ messages in thread
From: Keith Busch @ 2024-12-09 16:07 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Keith Busch, axboe, linux-block, linux-nvme, linux-fsdevel,
io-uring, sagi, asml.silence, anuj20.g, joshi.k
On Mon, Dec 09, 2024 at 01:55:11PM +0100, Christoph Hellwig wrote:
> I just compared this to a crude rebase of what I last sent out, and
> AFAICS the differences are:
>
> 1) basically all new io_uring handling due to the integrity stuff that
> went in
> 2) fixes for the NVMe FDP log page parsing
> 3) drop the support for the remapping of per-partition streams
Yep, pretty much. I will revisit the partition mapping. I just haven't
heard any use cases for divvying the streams up this way, so it's not
clear to me what the interface needs to provide.
> One thing that came I was pondering for a new version is if statx
> really is the right vehicle for this as it is a very common fast-path
> information. If we had a separate streaminfo ioctl or fcntl it might
> be easier to leave a bit spare space for extensibility. I can try to
> prototype that or we can leave it as-is because everyone is tired of
> the series.
Oh sure. I can live without the statx parts from this series if you
prefer we take additional time to consider other approaches. We have the
sysfs block attributes reporting the same information, and that is okay
for now.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 11/12] nvme: register fdp parameters with the block layer
2024-12-09 13:18 ` Christoph Hellwig
@ 2024-12-09 16:29 ` Keith Busch
0 siblings, 0 replies; 33+ messages in thread
From: Keith Busch @ 2024-12-09 16:29 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Keith Busch, axboe, linux-block, linux-nvme, linux-fsdevel,
io-uring, sagi, asml.silence, anuj20.g, joshi.k
On Mon, Dec 09, 2024 at 02:18:19PM +0100, Christoph Hellwig wrote:
> > + n = le16_to_cpu(h->numfdpc) + 1;
> > + if (fdp_idx > n)
> > + goto out;
> > +
> > + log = h + 1;
> > + do {
> > + desc = log;
> > + log += le16_to_cpu(desc->dsze);
> > + } while (i++ < fdp_idx);
>
> Maybe a for loop makes it easier to avoid the uninitialized variable,
> e.g.
>
> for (i = 0; i < fdp_index; i++) {
> ..
Yeah, okay. I was just trying to cleverly have a single place where the
descriptor is set. A for-loop needs to set it both within and after the
loop.
> > + if (ns->ctrl->ctratt & NVME_CTRL_ATTR_FDPS) {
> > + ret = nvme_query_fdp_info(ns, info);
> > + if (ret)
> > + dev_warn(ns->ctrl->device,
> > + "FDP failure status:0x%x\n", ret);
> > + if (ret < 0)
> > + goto out;
> > + }
>
> Looking at the full series with the next patch applied I'm a bit
> confused about the handling when rescanning. AFAIK the code now always
> goes into nvme_query_fdp_info when NVME_CTRL_ATTR_FDPS even if
> head->plids/head->nr_plids is already set, and that will then simply
> override them, even if they were already set.
I thought you could change the FDP configuration on a live namespace
with the Set Feature command, so needed to account for that. But the
spec really does restrict that feature to endurance groups without
namespaces, so I was mistaken and we can skip re-validiting FDP state
after the first scan.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 00/12] block write streams with nvme fdp
2024-12-09 16:07 ` Keith Busch
@ 2024-12-10 1:49 ` Martin K. Petersen
2024-12-10 7:19 ` Christoph Hellwig
1 sibling, 0 replies; 33+ messages in thread
From: Martin K. Petersen @ 2024-12-10 1:49 UTC (permalink / raw)
To: Keith Busch
Cc: Christoph Hellwig, Keith Busch, axboe, linux-block, linux-nvme,
linux-fsdevel, io-uring, sagi, asml.silence, anuj20.g, joshi.k
Hi Keith!
>> 3) drop the support for the remapping of per-partition streams
>
> Yep, pretty much. I will revisit the partition mapping. I just haven't
> heard any use cases for divvying the streams up this way, so it's not
> clear to me what the interface needs to provide.
Since the streams are a (very) scarce hardware resource, it does seem to
me like we should have an explicit interface for an entity (whether
app-on-bdev or a filesystem) to allocate them.
While there certainly are cases where there is a 1:1 app-to-device
mapping, as soon as you add virtualization or enterprise apps to the
mix, that assumption quickly falls apart...
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 00/12] block write streams with nvme fdp
2024-12-09 16:07 ` Keith Busch
2024-12-10 1:49 ` Martin K. Petersen
@ 2024-12-10 7:19 ` Christoph Hellwig
1 sibling, 0 replies; 33+ messages in thread
From: Christoph Hellwig @ 2024-12-10 7:19 UTC (permalink / raw)
To: Keith Busch
Cc: Christoph Hellwig, Keith Busch, axboe, linux-block, linux-nvme,
linux-fsdevel, io-uring, sagi, asml.silence, anuj20.g, joshi.k
On Mon, Dec 09, 2024 at 09:07:35AM -0700, Keith Busch wrote:
> Yep, pretty much. I will revisit the partition mapping. I just haven't
> heard any use cases for divvying the streams up this way, so it's not
> clear to me what the interface needs to provide.
Yes, it would be good to understand use cases first. I just threw the
patch in as a POC to show we can do it.
> > One thing that came I was pondering for a new version is if statx
> > really is the right vehicle for this as it is a very common fast-path
> > information. If we had a separate streaminfo ioctl or fcntl it might
> > be easier to leave a bit spare space for extensibility. I can try to
> > prototype that or we can leave it as-is because everyone is tired of
> > the series.
>
> Oh sure. I can live without the statx parts from this series if you
> prefer we take additional time to consider other approaches. We have the
> sysfs block attributes reporting the same information, and that is okay
> for now.
I'll try to find some time this afternoon for an interface, but if it
doesn't arrive in time we can probably drop if for the next submission.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 02/12] fs: add a write stream field to the kiocb
[not found] ` <20241206221801.790690-3-kbusch@meta.com>
2024-12-09 8:25 ` [PATCHv12 02/12] fs: add a write stream field to the kiocb Hannes Reinecke
2024-12-09 12:47 ` [PATCHv12 01/12] fs: add write stream information to statx Christian Brauner
@ 2024-12-10 7:24 ` Nitesh Shetty
2 siblings, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-10 7:24 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 397 bytes --]
On 06/12/24 02:17PM, Keith Busch wrote:
>From: Christoph Hellwig <hch@lst.de>
>
>Prepare for io_uring passthrough of write streams. The write stream
>field in the kiocb structure fits into an existing 2-byte hole, so its
>size is not changed.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>---
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 12/12] nvme: use fdp streams if write stream is provided
[not found] ` <20241206221801.790690-13-kbusch@meta.com>
2024-12-09 8:34 ` [PATCHv12 12/12] nvme: use fdp streams if write stream is provided Hannes Reinecke
@ 2024-12-10 7:27 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-10 7:27 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 255 bytes --]
On 06/12/24 02:18PM, Keith Busch wrote:
>From: Keith Busch <kbusch@kernel.org>
>
>Maps a user requested write stream to an FDP placement ID if possible.
>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 03/12] block: add a bi_write_stream field
[not found] ` <20241206221801.790690-4-kbusch@meta.com>
2024-12-09 8:26 ` [PATCHv12 03/12] block: add a bi_write_stream field Hannes Reinecke
@ 2024-12-10 7:34 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-10 7:34 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
On 06/12/24 02:17PM, Keith Busch wrote:
>From: Christoph Hellwig <hch@lst.de>
>
>Add the ability to pass a write stream for placement control in the bio.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>---
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 04/12] block: introduce max_write_streams queue limit
[not found] ` <20241206221801.790690-5-kbusch@meta.com>
2024-12-09 8:27 ` [PATCHv12 04/12] block: introduce max_write_streams queue limit Hannes Reinecke
@ 2024-12-10 7:38 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-10 7:38 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
On 06/12/24 02:17PM, Keith Busch wrote:
>From: Keith Busch <kbusch@kernel.org>
>
>Drivers with hardware that support write streams need a way to export how
>many are available so applications can generically query this.
>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>[hch: renamed hints to streams, removed stacking]
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>---
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 05/12] block: introduce a write_stream_granularity queue limit
[not found] ` <20241206221801.790690-6-kbusch@meta.com>
2024-12-09 8:29 ` [PATCHv12 05/12] block: introduce a write_stream_granularity queue limit Hannes Reinecke
@ 2024-12-10 7:45 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-10 7:45 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
On 06/12/24 02:17PM, Keith Busch wrote:
>From: Christoph Hellwig <hch@lst.de>
>
>Export the granularity that write streams should be discarded with,
>as it is essential for making good use of them.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>---
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 11/12] nvme: register fdp parameters with the block layer
[not found] ` <20241206221801.790690-12-kbusch@meta.com>
` (2 preceding siblings ...)
2024-12-09 13:18 ` Christoph Hellwig
@ 2024-12-10 8:45 ` Dan Carpenter
2024-12-10 15:23 ` Keith Busch
3 siblings, 1 reply; 33+ messages in thread
From: Dan Carpenter @ 2024-12-10 8:45 UTC (permalink / raw)
To: oe-kbuild, Keith Busch, axboe, hch, linux-block, linux-nvme,
linux-fsdevel, io-uring
Cc: lkp, oe-kbuild-all, sagi, asml.silence, anuj20.g, joshi.k,
Keith Busch
Hi Keith,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Keith-Busch/fs-add-write-stream-information-to-statx/20241207-063826
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
patch link: https://lore.kernel.org/r/20241206221801.790690-12-kbusch%40meta.com
patch subject: [PATCHv12 11/12] nvme: register fdp parameters with the block layer
config: csky-randconfig-r072-20241209 (https://download.01.org/0day-ci/archive/20241210/202412100319.Y5vv98P8-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202412100319.Y5vv98P8-lkp@intel.com/
New smatch warnings:
drivers/nvme/host/core.c:2187 nvme_check_fdp() error: uninitialized symbol 'i'.
drivers/nvme/host/core.c:2232 nvme_query_fdp_info() warn: missing error code 'ret'
vim +/i +2187 drivers/nvme/host/core.c
04ca0849938146 Keith Busch 2024-12-06 2154 static int nvme_check_fdp(struct nvme_ns *ns, struct nvme_ns_info *info,
04ca0849938146 Keith Busch 2024-12-06 2155 u8 fdp_idx)
04ca0849938146 Keith Busch 2024-12-06 2156 {
04ca0849938146 Keith Busch 2024-12-06 2157 struct nvme_fdp_config_log hdr, *h;
04ca0849938146 Keith Busch 2024-12-06 2158 struct nvme_fdp_config_desc *desc;
04ca0849938146 Keith Busch 2024-12-06 2159 size_t size = sizeof(hdr);
04ca0849938146 Keith Busch 2024-12-06 2160 int i, n, ret;
04ca0849938146 Keith Busch 2024-12-06 2161 void *log;
04ca0849938146 Keith Busch 2024-12-06 2162
04ca0849938146 Keith Busch 2024-12-06 2163 info->runs = 0;
04ca0849938146 Keith Busch 2024-12-06 2164 ret = nvme_get_log_lsi(ns->ctrl, 0, NVME_LOG_FDP_CONFIGS, 0, NVME_CSI_NVM,
04ca0849938146 Keith Busch 2024-12-06 2165 (void *)&hdr, size, 0, info->endgid);
04ca0849938146 Keith Busch 2024-12-06 2166 if (ret)
04ca0849938146 Keith Busch 2024-12-06 2167 return ret;
04ca0849938146 Keith Busch 2024-12-06 2168
04ca0849938146 Keith Busch 2024-12-06 2169 size = le32_to_cpu(hdr.sze);
04ca0849938146 Keith Busch 2024-12-06 2170 h = kzalloc(size, GFP_KERNEL);
04ca0849938146 Keith Busch 2024-12-06 2171 if (!h)
04ca0849938146 Keith Busch 2024-12-06 2172 return 0;
04ca0849938146 Keith Busch 2024-12-06 2173
04ca0849938146 Keith Busch 2024-12-06 2174 ret = nvme_get_log_lsi(ns->ctrl, 0, NVME_LOG_FDP_CONFIGS, 0, NVME_CSI_NVM,
04ca0849938146 Keith Busch 2024-12-06 2175 h, size, 0, info->endgid);
04ca0849938146 Keith Busch 2024-12-06 2176 if (ret)
04ca0849938146 Keith Busch 2024-12-06 2177 goto out;
04ca0849938146 Keith Busch 2024-12-06 2178
04ca0849938146 Keith Busch 2024-12-06 2179 n = le16_to_cpu(h->numfdpc) + 1;
04ca0849938146 Keith Busch 2024-12-06 2180 if (fdp_idx > n)
04ca0849938146 Keith Busch 2024-12-06 2181 goto out;
04ca0849938146 Keith Busch 2024-12-06 2182
04ca0849938146 Keith Busch 2024-12-06 2183 log = h + 1;
04ca0849938146 Keith Busch 2024-12-06 2184 do {
04ca0849938146 Keith Busch 2024-12-06 2185 desc = log;
04ca0849938146 Keith Busch 2024-12-06 2186 log += le16_to_cpu(desc->dsze);
04ca0849938146 Keith Busch 2024-12-06 @2187 } while (i++ < fdp_idx);
^
i needs to be initialized to zero at the start.
04ca0849938146 Keith Busch 2024-12-06 2188
04ca0849938146 Keith Busch 2024-12-06 2189 info->runs = le64_to_cpu(desc->runs);
04ca0849938146 Keith Busch 2024-12-06 2190 out:
04ca0849938146 Keith Busch 2024-12-06 2191 kfree(h);
04ca0849938146 Keith Busch 2024-12-06 2192 return ret;
04ca0849938146 Keith Busch 2024-12-06 2193 }
04ca0849938146 Keith Busch 2024-12-06 2194
04ca0849938146 Keith Busch 2024-12-06 2195 static int nvme_query_fdp_info(struct nvme_ns *ns, struct nvme_ns_info *info)
04ca0849938146 Keith Busch 2024-12-06 2196 {
04ca0849938146 Keith Busch 2024-12-06 2197 struct nvme_ns_head *head = ns->head;
04ca0849938146 Keith Busch 2024-12-06 2198 struct nvme_fdp_ruh_status *ruhs;
04ca0849938146 Keith Busch 2024-12-06 2199 struct nvme_fdp_config fdp;
04ca0849938146 Keith Busch 2024-12-06 2200 struct nvme_command c = {};
04ca0849938146 Keith Busch 2024-12-06 2201 int size, ret;
04ca0849938146 Keith Busch 2024-12-06 2202
04ca0849938146 Keith Busch 2024-12-06 2203 ret = nvme_get_features(ns->ctrl, NVME_FEAT_FDP, info->endgid, NULL, 0,
04ca0849938146 Keith Busch 2024-12-06 2204 &fdp);
04ca0849938146 Keith Busch 2024-12-06 2205 if (ret)
04ca0849938146 Keith Busch 2024-12-06 2206 goto err;
04ca0849938146 Keith Busch 2024-12-06 2207
04ca0849938146 Keith Busch 2024-12-06 2208 if (!(fdp.flags & FDPCFG_FDPE))
04ca0849938146 Keith Busch 2024-12-06 2209 goto err;
04ca0849938146 Keith Busch 2024-12-06 2210
04ca0849938146 Keith Busch 2024-12-06 2211 ret = nvme_check_fdp(ns, info, fdp.fdpcidx);
04ca0849938146 Keith Busch 2024-12-06 2212 if (ret || !info->runs)
04ca0849938146 Keith Busch 2024-12-06 2213 goto err;
04ca0849938146 Keith Busch 2024-12-06 2214
04ca0849938146 Keith Busch 2024-12-06 2215 size = struct_size(ruhs, ruhsd, NVME_MAX_PLIDS);
04ca0849938146 Keith Busch 2024-12-06 2216 ruhs = kzalloc(size, GFP_KERNEL);
04ca0849938146 Keith Busch 2024-12-06 2217 if (!ruhs) {
04ca0849938146 Keith Busch 2024-12-06 2218 ret = -ENOMEM;
04ca0849938146 Keith Busch 2024-12-06 2219 goto err;
04ca0849938146 Keith Busch 2024-12-06 2220 }
04ca0849938146 Keith Busch 2024-12-06 2221
04ca0849938146 Keith Busch 2024-12-06 2222 c.imr.opcode = nvme_cmd_io_mgmt_recv;
04ca0849938146 Keith Busch 2024-12-06 2223 c.imr.nsid = cpu_to_le32(head->ns_id);
04ca0849938146 Keith Busch 2024-12-06 2224 c.imr.mo = NVME_IO_MGMT_RECV_MO_RUHS;
04ca0849938146 Keith Busch 2024-12-06 2225 c.imr.numd = cpu_to_le32(nvme_bytes_to_numd(size));
04ca0849938146 Keith Busch 2024-12-06 2226 ret = nvme_submit_sync_cmd(ns->queue, &c, ruhs, size);
04ca0849938146 Keith Busch 2024-12-06 2227 if (ret)
04ca0849938146 Keith Busch 2024-12-06 2228 goto free;
04ca0849938146 Keith Busch 2024-12-06 2229
04ca0849938146 Keith Busch 2024-12-06 2230 head->nr_plids = le16_to_cpu(ruhs->nruhsd);
04ca0849938146 Keith Busch 2024-12-06 2231 if (!head->nr_plids)
04ca0849938146 Keith Busch 2024-12-06 @2232 goto free;
ret = -EINVAL?
04ca0849938146 Keith Busch 2024-12-06 2233
04ca0849938146 Keith Busch 2024-12-06 2234 kfree(ruhs);
04ca0849938146 Keith Busch 2024-12-06 2235 return 0;
04ca0849938146 Keith Busch 2024-12-06 2236
04ca0849938146 Keith Busch 2024-12-06 2237 free:
04ca0849938146 Keith Busch 2024-12-06 2238 kfree(ruhs);
04ca0849938146 Keith Busch 2024-12-06 2239 err:
04ca0849938146 Keith Busch 2024-12-06 2240 head->nr_plids = 0;
04ca0849938146 Keith Busch 2024-12-06 2241 info->runs = 0;
04ca0849938146 Keith Busch 2024-12-06 2242 return ret;
04ca0849938146 Keith Busch 2024-12-06 2243 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 08/12] nvme: add a nvme_get_log_lsi helper
[not found] ` <20241206221801.790690-9-kbusch@meta.com>
2024-12-09 8:31 ` [PATCHv12 08/12] nvme: add a nvme_get_log_lsi helper Hannes Reinecke
@ 2024-12-10 12:12 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-10 12:12 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 359 bytes --]
On 06/12/24 02:17PM, Keith Busch wrote:
>From: Christoph Hellwig <hch@lst.de>
>
>For log pages that need to pass in a LSI value, while at the same time
>not touching all the existing nvme_get_log callers.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>---
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 09/12] nvme: pass a void pointer to nvme_get/set_features for the result
[not found] ` <20241206221801.790690-10-kbusch@meta.com>
2024-12-09 8:32 ` [PATCHv12 09/12] nvme: pass a void pointer to nvme_get/set_features for the result Hannes Reinecke
@ 2024-12-10 12:13 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-10 12:13 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 383 bytes --]
On 06/12/24 02:17PM, Keith Busch wrote:
>From: Christoph Hellwig <hch@lst.de>
>
>That allows passing in structures instead of the u32 result, and thus
>reduce the amount of bit shifting and masking required to parse the
>result.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>---
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 10/12] nvme.h: add FDP definitions
[not found] ` <20241206221801.790690-11-kbusch@meta.com>
2024-12-09 8:33 ` [PATCHv12 10/12] nvme.h: add FDP definitions Hannes Reinecke
@ 2024-12-10 12:19 ` Nitesh Shetty
1 sibling, 0 replies; 33+ messages in thread
From: Nitesh Shetty @ 2024-12-10 12:19 UTC (permalink / raw)
To: Keith Busch
Cc: axboe, hch, linux-block, linux-nvme, linux-fsdevel, io-uring,
sagi, asml.silence, anuj20.g, joshi.k, Keith Busch
[-- Attachment #1: Type: text/plain, Size: 449 bytes --]
On 06/12/24 02:17PM, Keith Busch wrote:
>From: Christoph Hellwig <hch@lst.de>
>
>Add the config feature result, config log page, and management receive
>commands needed for FDP.
>
>Partially based on a patch from Kanchan Joshi <joshi.k@samsung.com>.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>[kbusch: renamed some fields to match spec]
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>---
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCHv12 11/12] nvme: register fdp parameters with the block layer
2024-12-10 8:45 ` Dan Carpenter
@ 2024-12-10 15:23 ` Keith Busch
0 siblings, 0 replies; 33+ messages in thread
From: Keith Busch @ 2024-12-10 15:23 UTC (permalink / raw)
To: Dan Carpenter
Cc: oe-kbuild, Keith Busch, axboe, hch, linux-block, linux-nvme,
linux-fsdevel, io-uring, lkp, oe-kbuild-all, sagi, asml.silence,
anuj20.g, joshi.k
On Tue, Dec 10, 2024 at 11:45:43AM +0300, Dan Carpenter wrote:
> 04ca0849938146 Keith Busch 2024-12-06 2226 ret = nvme_submit_sync_cmd(ns->queue, &c, ruhs, size);
> 04ca0849938146 Keith Busch 2024-12-06 2227 if (ret)
> 04ca0849938146 Keith Busch 2024-12-06 2228 goto free;
> 04ca0849938146 Keith Busch 2024-12-06 2229
> 04ca0849938146 Keith Busch 2024-12-06 2230 head->nr_plids = le16_to_cpu(ruhs->nruhsd);
> 04ca0849938146 Keith Busch 2024-12-06 2231 if (!head->nr_plids)
> 04ca0849938146 Keith Busch 2024-12-06 @2232 goto free;
>
> ret = -EINVAL?
It's very much on purpose to return "0" here. Returning a negative error
has the driver fail the namespace disk creation. Seeing a stream
configuration the driver doesn't support just means you don't get to use
the block layer's write stream features. You should still be able to use
your namespace the same as before the driver started checking these
configs, otherwise it's a regression since such namespaces are usable
today.
^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2024-12-10 15:23 UTC | newest]
Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20241206221801.790690-1-kbusch@meta.com>
[not found] ` <20241206221801.790690-4-kbusch@meta.com>
2024-12-09 8:26 ` [PATCHv12 03/12] block: add a bi_write_stream field Hannes Reinecke
2024-12-10 7:34 ` Nitesh Shetty
[not found] ` <20241206221801.790690-6-kbusch@meta.com>
2024-12-09 8:29 ` [PATCHv12 05/12] block: introduce a write_stream_granularity queue limit Hannes Reinecke
2024-12-10 7:45 ` Nitesh Shetty
[not found] ` <20241206221801.790690-7-kbusch@meta.com>
2024-12-09 8:30 ` [PATCHv12 06/12] block: expose write streams for block device nodes Hannes Reinecke
2024-12-09 10:58 ` Nitesh Shetty
[not found] ` <20241206221801.790690-8-kbusch@meta.com>
2024-12-09 8:31 ` [PATCHv12 07/12] io_uring: enable per-io write streams Hannes Reinecke
[not found] ` <20241206221801.790690-9-kbusch@meta.com>
2024-12-09 8:31 ` [PATCHv12 08/12] nvme: add a nvme_get_log_lsi helper Hannes Reinecke
2024-12-10 12:12 ` Nitesh Shetty
[not found] ` <20241206221801.790690-2-kbusch@meta.com>
2024-12-09 8:25 ` [PATCHv12 01/12] fs: add write stream information to statx Hannes Reinecke
2024-12-09 11:44 ` Nitesh Shetty
[not found] ` <20241206221801.790690-3-kbusch@meta.com>
2024-12-09 8:25 ` [PATCHv12 02/12] fs: add a write stream field to the kiocb Hannes Reinecke
2024-12-09 12:47 ` [PATCHv12 01/12] fs: add write stream information to statx Christian Brauner
2024-12-10 7:24 ` [PATCHv12 02/12] fs: add a write stream field to the kiocb Nitesh Shetty
2024-12-09 12:55 ` [PATCHv12 00/12] block write streams with nvme fdp Christoph Hellwig
2024-12-09 16:07 ` Keith Busch
2024-12-10 1:49 ` Martin K. Petersen
2024-12-10 7:19 ` Christoph Hellwig
[not found] ` <20241206221801.790690-12-kbusch@meta.com>
2024-12-09 4:05 ` [PATCHv12 11/12] nvme: register fdp parameters with the block layer kernel test robot
2024-12-09 12:44 ` Christoph Hellwig
2024-12-09 8:34 ` Hannes Reinecke
2024-12-09 13:18 ` Christoph Hellwig
2024-12-09 16:29 ` Keith Busch
2024-12-10 8:45 ` Dan Carpenter
2024-12-10 15:23 ` Keith Busch
[not found] ` <20241206221801.790690-13-kbusch@meta.com>
2024-12-09 8:34 ` [PATCHv12 12/12] nvme: use fdp streams if write stream is provided Hannes Reinecke
2024-12-10 7:27 ` Nitesh Shetty
[not found] ` <20241206221801.790690-5-kbusch@meta.com>
2024-12-09 8:27 ` [PATCHv12 04/12] block: introduce max_write_streams queue limit Hannes Reinecke
2024-12-10 7:38 ` Nitesh Shetty
[not found] ` <20241206221801.790690-10-kbusch@meta.com>
2024-12-09 8:32 ` [PATCHv12 09/12] nvme: pass a void pointer to nvme_get/set_features for the result Hannes Reinecke
2024-12-10 12:13 ` Nitesh Shetty
[not found] ` <20241206221801.790690-11-kbusch@meta.com>
2024-12-09 8:33 ` [PATCHv12 10/12] nvme.h: add FDP definitions Hannes Reinecke
2024-12-10 12:19 ` Nitesh Shetty
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox