From: Mike Snitzer <snitzer@kernel.org>
To: dm-devel@redhat.com
Cc: ebiggers@kernel.org, keescook@chromium.org, heinzm@redhat.com,
Mike Snitzer <snitzer@kernel.org>,
nhuck@google.com, linux-block@vger.kernel.org, ejt@redhat.com,
mpatocka@redhat.com, luomeng12@huawei.com
Subject: [dm-devel] [dm-6.4 PATCH v2 2/9] dm bufio: move dm_buffer struct
Date: Fri, 24 Mar 2023 13:56:49 -0400 [thread overview]
Message-ID: <20230324175656.85082-3-snitzer@kernel.org> (raw)
In-Reply-To: <20230324175656.85082-1-snitzer@kernel.org>
Movement prepares for finer grained dm_buffer changes, in the next
commit, to be more easily seen.
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
---
drivers/md/dm-bufio.c | 97 ++++++++++++++++++++++---------------------
1 file changed, 50 insertions(+), 47 deletions(-)
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 79434b38f368..1de1bdcda1ce 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -66,6 +66,56 @@
#define LIST_DIRTY 1
#define LIST_SIZE 2
+/*
+ * Buffer state bits.
+ */
+#define B_READING 0
+#define B_WRITING 1
+#define B_DIRTY 2
+
+/*
+ * Describes how the block was allocated:
+ * kmem_cache_alloc(), __get_free_pages() or vmalloc().
+ * See the comment at alloc_buffer_data.
+ */
+enum data_mode {
+ DATA_MODE_SLAB = 0,
+ DATA_MODE_GET_FREE_PAGES = 1,
+ DATA_MODE_VMALLOC = 2,
+ DATA_MODE_LIMIT = 3
+};
+
+struct dm_buffer {
+ struct rb_node node;
+ struct list_head lru_list;
+ struct list_head global_list;
+
+ sector_t block;
+ void *data;
+ unsigned char data_mode; /* DATA_MODE_* */
+
+ unsigned int accessed;
+ unsigned int hold_count;
+ unsigned long last_accessed;
+
+ unsigned char list_mode; /* LIST_* */
+ blk_status_t read_error;
+ blk_status_t write_error;
+ unsigned long state;
+ unsigned int dirty_start;
+ unsigned int dirty_end;
+ unsigned int write_start;
+ unsigned int write_end;
+ struct dm_bufio_client *c;
+ struct list_head write_list;
+ void (*end_io)(struct dm_buffer *b, blk_status_t bs);
+#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
+#define MAX_STACK 10
+ unsigned int stack_len;
+ unsigned long stack_entries[MAX_STACK];
+#endif
+};
+
/*
* Linking of buffers:
* All buffers are linked to buffer_tree with their node field.
@@ -117,53 +167,6 @@ struct dm_bufio_client {
atomic_long_t need_shrink;
};
-/*
- * Buffer state bits.
- */
-#define B_READING 0
-#define B_WRITING 1
-#define B_DIRTY 2
-
-/*
- * Describes how the block was allocated:
- * kmem_cache_alloc(), __get_free_pages() or vmalloc().
- * See the comment at alloc_buffer_data.
- */
-enum data_mode {
- DATA_MODE_SLAB = 0,
- DATA_MODE_GET_FREE_PAGES = 1,
- DATA_MODE_VMALLOC = 2,
- DATA_MODE_LIMIT = 3
-};
-
-struct dm_buffer {
- struct rb_node node;
- struct list_head lru_list;
- struct list_head global_list;
- sector_t block;
- void *data;
- unsigned char data_mode; /* DATA_MODE_* */
- unsigned char list_mode; /* LIST_* */
- blk_status_t read_error;
- blk_status_t write_error;
- unsigned int accessed;
- unsigned int hold_count;
- unsigned long state;
- unsigned long last_accessed;
- unsigned int dirty_start;
- unsigned int dirty_end;
- unsigned int write_start;
- unsigned int write_end;
- struct dm_bufio_client *c;
- struct list_head write_list;
- void (*end_io)(struct dm_buffer *buf, blk_status_t stat);
-#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
-#define MAX_STACK 10
- unsigned int stack_len;
- unsigned long stack_entries[MAX_STACK];
-#endif
-};
-
static DEFINE_STATIC_KEY_FALSE(no_sleep_enabled);
/*----------------------------------------------------------------*/
--
2.40.0
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
next prev parent reply other threads:[~2023-03-24 17:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-24 17:56 [dm-devel] [dm-6.4 PATCH v2 0/9] dm bufio, thin: improve concurrent IO performance Mike Snitzer
2023-03-24 17:56 ` [dm-devel] [dm-6.4 PATCH v2 1/9] dm bufio: remove unused dm_bufio_release_move interface Mike Snitzer
2023-03-24 17:56 ` Mike Snitzer [this message]
2023-03-24 17:56 ` [dm-devel] [dm-6.4 PATCH v2 3/9] dm bufio: improve concurrent IO performance Mike Snitzer
2023-03-24 19:34 ` Jens Axboe
2023-03-24 22:53 ` Mike Snitzer
2023-03-24 23:11 ` Jens Axboe
2023-03-25 4:21 ` Mike Snitzer
2023-03-24 17:56 ` [dm-devel] [dm-6.4 PATCH v2 4/9] dm bufio: move dm_bufio_client members to avoid spanning cachelines Mike Snitzer
2023-03-24 17:56 ` [dm-devel] [dm-6.4 PATCH v2 5/9] dm bufio: use waitqueue_active in __free_buffer_wake Mike Snitzer
2023-03-24 17:56 ` [dm-devel] [dm-6.4 PATCH v2 6/9] dm bufio: use multi-page bio vector Mike Snitzer
2023-03-24 17:56 ` [dm-devel] [dm-6.4 PATCH v2 7/9] dm thin: speed up cell_defer_no_holder() Mike Snitzer
2023-03-24 17:56 ` [dm-devel] [dm-6.4 PATCH v2 8/9] dm: split discards further if target sets max_discard_granularity Mike Snitzer
2023-03-24 17:56 ` [dm-devel] [dm-6.4 PATCH v2 9/9] dm bio prison v1: improve concurrent IO performance Mike Snitzer
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=20230324175656.85082-3-snitzer@kernel.org \
--to=snitzer@kernel.org \
--cc=dm-devel@redhat.com \
--cc=ebiggers@kernel.org \
--cc=ejt@redhat.com \
--cc=heinzm@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-block@vger.kernel.org \
--cc=luomeng12@huawei.com \
--cc=mpatocka@redhat.com \
--cc=nhuck@google.com \
/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;
as well as URLs for NNTP newsgroup(s).