From: Keith Busch <kbusch@meta.com>
To: <linux-block@vger.kernel.org>, <linux-nvme@lists.infradead.org>,
<axboe@kernel.dk>, <hch@lst.de>, <io-uring@vger.kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>, <joshi.k@samsung.com>,
<javier.gonz@samsung.com>, Keith Busch <kbusch@kernel.org>
Subject: [PATCHv8 4/6] fs: introduce per-io hint support flag
Date: Thu, 17 Oct 2024 09:09:35 -0700 [thread overview]
Message-ID: <20241017160937.2283225-5-kbusch@meta.com> (raw)
In-Reply-To: <20241017160937.2283225-1-kbusch@meta.com>
From: Keith Busch <kbusch@kernel.org>
A block device may support write hints on a per-io basis. The raw block
file operations can effectively use these, but real filesystems are not
ready to make use of this. Provide a file_operations flag to indicate
support, and set it for the block file operations.
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
block/fops.c | 2 +-
include/linux/fs.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/fops.c b/block/fops.c
index d0b16d3975fd6..15a63e26161ea 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -869,7 +869,7 @@ const struct file_operations def_blk_fops = {
.splice_write = iter_file_splice_write,
.fallocate = blkdev_fallocate,
.uring_cmd = blkdev_uring_cmd,
- .fop_flags = FOP_BUFFER_RASYNC,
+ .fop_flags = FOP_BUFFER_RASYNC | FOP_PER_IO_HINTS,
};
static __init int blkdev_init(void)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 04e875a37f604..026dc9801dc20 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2117,6 +2117,8 @@ struct file_operations {
#define FOP_HUGE_PAGES ((__force fop_flags_t)(1 << 4))
/* Treat loff_t as unsigned (e.g., /dev/mem) */
#define FOP_UNSIGNED_OFFSET ((__force fop_flags_t)(1 << 5))
+/* File system can handle per-io hints */
+#define FOP_PER_IO_HINTS ((__force fop_flags_t)(1 << 6))
/* Wrap a directory iterator that needs exclusive inode access */
int wrap_directory_iterator(struct file *, struct dir_context *,
--
2.43.5
next prev parent reply other threads:[~2024-10-17 16:11 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 16:09 [PATCHv8 0/6] write hints for nvme fdp Keith Busch
2024-10-17 16:09 ` [PATCHv8 1/6] block, fs: restore kiocb based write hint processing Keith Busch
2024-10-18 5:50 ` Christoph Hellwig
2024-10-21 15:47 ` Keith Busch
2024-10-21 17:09 ` Bart Van Assche
2024-10-21 19:35 ` Keith Busch
2024-10-22 6:43 ` Christoph Hellwig
2024-10-22 14:37 ` Keith Busch
2024-10-22 14:40 ` Christoph Hellwig
2024-10-18 16:11 ` Bart Van Assche
2024-10-17 16:09 ` [PATCHv8 2/6] block: use generic u16 for write hints Keith Busch
2024-10-18 5:46 ` Christoph Hellwig
2024-10-24 19:45 ` Keith Busch
2024-10-25 12:20 ` Christoph Hellwig
2024-10-18 6:00 ` Hannes Reinecke
2024-10-18 16:12 ` Bart Van Assche
2024-10-21 15:03 ` Keith Busch
2024-10-17 16:09 ` [PATCHv8 3/6] block: introduce max_write_hints queue limit Keith Busch
2024-10-18 5:51 ` Christoph Hellwig
2024-10-18 6:01 ` Hannes Reinecke
2024-10-18 16:18 ` Bart Van Assche
2024-10-21 15:02 ` Keith Busch
2024-10-17 16:09 ` Keith Busch [this message]
2024-10-18 5:52 ` [PATCHv8 4/6] fs: introduce per-io hint support flag Christoph Hellwig
2024-10-18 6:03 ` Hannes Reinecke
2024-10-17 16:09 ` [PATCHv8 5/6] io_uring: enable per-io hinting capability Keith Busch
2024-10-18 5:53 ` Christoph Hellwig
2024-10-18 6:03 ` Hannes Reinecke
2024-10-17 16:09 ` [PATCHv8 6/6] nvme: enable FDP support Keith Busch
2024-10-18 10:48 ` Kanchan Joshi
2024-10-21 15:08 ` Keith Busch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241017160937.2283225-5-kbusch@meta.com \
--to=kbusch@meta.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=io-uring@vger.kernel.org \
--cc=javier.gonz@samsung.com \
--cc=joshi.k@samsung.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox