All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org
Cc: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 3/5] fs: add ki_bio_cache pointer to struct kiocb
Date: Tue, 10 Aug 2021 10:37:26 -0600	[thread overview]
Message-ID: <20210810163728.265939-4-axboe@kernel.dk> (raw)
In-Reply-To: <20210810163728.265939-1-axboe@kernel.dk>

This allows an issuer (and owner of a kiocb) to pass in a bio allocation
cache that can be used to improve the efficiency of the churn of repeated
bio allocations and frees.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 include/linux/fs.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 640574294216..5f17d10ddc2d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -291,6 +291,7 @@ struct page;
 struct address_space;
 struct writeback_control;
 struct readahead_control;
+struct bio_alloc_cache;
 
 /*
  * Write life time hint values.
@@ -319,6 +320,8 @@ enum rw_hint {
 /* iocb->ki_waitq is valid */
 #define IOCB_WAITQ		(1 << 19)
 #define IOCB_NOIO		(1 << 20)
+/* iocb->ki_bio_cache is valid */
+#define IOCB_ALLOC_CACHE	(1 << 21)
 
 struct kiocb {
 	struct file		*ki_filp;
@@ -337,6 +340,14 @@ struct kiocb {
 		struct wait_page_queue	*ki_waitq; /* for async buffered IO */
 	};
 
+	/*
+	 * If set, owner of iov_iter can pass in a fast-cache for bio
+	 * allocations.
+	 */
+#ifdef CONFIG_BLOCK
+	struct bio_alloc_cache	*ki_bio_cache;
+#endif
+
 	randomized_struct_fields_end
 };
 
-- 
2.32.0


  parent reply	other threads:[~2021-08-10 16:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 16:37 [PATCHSET v3 0/5] Enable bio recycling for polled IO Jens Axboe
2021-08-10 16:37 ` [PATCH 1/5] bio: add allocation cache abstraction Jens Axboe
2021-08-11  8:34   ` Christoph Hellwig
2021-08-10 16:37 ` [PATCH 2/5] io_uring: use kiocb->private to hold rw_len Jens Axboe
2021-08-11 11:40   ` Christoph Hellwig
2021-08-10 16:37 ` Jens Axboe [this message]
2021-08-10 16:37 ` [PATCH 4/5] io_uring: wire up bio allocation cache Jens Axboe
2021-08-10 16:37 ` [PATCH 5/5] block: enable use of " Jens Axboe
2021-08-10 16:44 ` [PATCHSET v3 0/5] Enable bio recycling for polled IO Jens Axboe
2021-08-11  8:26 ` Christoph Hellwig
2021-08-11 11:13   ` Christoph Hellwig
2021-08-11 15:05     ` Jens Axboe
2021-08-11 15:08       ` Christoph Hellwig
2021-08-11 15:06     ` Ming Lei

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=20210810163728.265939-4-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-block@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.