From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 2/2] btrfs: Optimise layout of btrfs_block_group_cache
Date: Mon, 26 Jun 2017 17:42:35 +0300 [thread overview]
Message-ID: <1498488155-9941-2-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1498488155-9941-1-git-send-email-nborisov@suse.com>
With this patch applied pahole stats look like:
/* size: 840, cachelines: 14, members: 40 */
/* sum members: 833, holes: 1, sum holes: 7 */
/* bit holes: 1, sum bit holes: 28 bits */
/* last cacheline: 8 bytes */
No functional changes.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/ctree.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index cdd3775e930b..bdd06bbeb9aa 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -586,6 +586,11 @@ struct btrfs_block_group_cache {
unsigned int iref:1;
unsigned int has_caching_ctl:1;
unsigned int removed:1;
+ /*
+ * Does the block group need to be added to the free space tree?
+ * Protected by free_space_lock.
+ */
+ unsigned int needs_free_space:1;
int disk_cache_state;
@@ -608,6 +613,8 @@ struct btrfs_block_group_cache {
/* usage count */
atomic_t count;
+ atomic_t trimming;
+
/* List of struct btrfs_free_clusters for this block group.
* Today it will only have one thing on it, but that may change
*/
@@ -619,8 +626,6 @@ struct btrfs_block_group_cache {
/* For read-only block groups */
struct list_head ro_list;
- atomic_t trimming;
-
/* For dirty block groups */
struct list_head dirty_list;
struct list_head io_list;
@@ -651,11 +656,6 @@ struct btrfs_block_group_cache {
/* Lock for free space tree operations. */
struct mutex free_space_lock;
- /*
- * Does the block group need to be added to the free space tree?
- * Protected by free_space_lock.
- */
- int needs_free_space;
/* Record locked full stripes for RAID5/6 block group */
struct btrfs_full_stripe_locks_tree full_stripe_locks_root;
--
2.7.4
next prev parent reply other threads:[~2017-06-26 14:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-26 14:42 [PATCH 1/2] btrfs: remove unused sectorsize member Nikolay Borisov
2017-06-26 14:42 ` Nikolay Borisov [this message]
2017-06-26 15:30 ` [PATCH 2/2] btrfs: Optimise layout of btrfs_block_group_cache Nikolay Borisov
2017-06-27 17:11 ` David Sterba
2017-06-27 11:22 ` [PATCH 1/2] btrfs: remove unused sectorsize member kbuild test robot
2017-06-27 13:25 ` [PATCH v2] " Nikolay Borisov
2017-06-27 17:13 ` David Sterba
2017-06-28 8:05 ` [PATCH v3] " Nikolay Borisov
2017-06-30 8:07 ` David Sterba
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=1498488155-9941-2-git-send-email-nborisov@suse.com \
--to=nborisov@suse.com \
--cc=linux-btrfs@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 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).