linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 6/6] btrfs: reoder btrfs_transaction members for better packing
Date: Wed, 15 Nov 2017 18:42:06 +0100	[thread overview]
Message-ID: <968af0bfaca921b5879c297e3f5b8037377bc672.1510767175.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1510767175.git.dsterba@suse.com>

There are now 20 bytes of holes, we can reduce that to 4 by minor
changes. Moving 'aborted' to the status and flags is also more logical,
similar for num_dirty_bgs. The size goes from 432 to 416.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/transaction.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index 1805fd101767..6beee072b1bd 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -58,6 +58,7 @@ struct btrfs_transaction {
 
 	/* Be protected by fs_info->trans_lock when we want to change it. */
 	enum btrfs_trans_state state;
+	int aborted;
 	struct list_head list;
 	struct extent_io_tree dirty_pages;
 	unsigned long start_time;
@@ -70,7 +71,6 @@ struct btrfs_transaction {
 	struct list_head dirty_bgs;
 	struct list_head io_bgs;
 	struct list_head dropped_roots;
-	unsigned int num_dirty_bgs;
 
 	/*
 	 * we need to make sure block group deletion doesn't race with
@@ -79,11 +79,11 @@ struct btrfs_transaction {
 	 */
 	struct mutex cache_write_mutex;
 	spinlock_t dirty_bgs_lock;
+	unsigned int num_dirty_bgs;
 	/* Protected by spin lock fs_info->unused_bgs_lock. */
 	struct list_head deleted_bgs;
 	spinlock_t dropped_roots_lock;
 	struct btrfs_delayed_ref_root delayed_refs;
-	int aborted;
 	struct btrfs_fs_info *fs_info;
 };
 
-- 
2.14.3


  parent reply	other threads:[~2017-11-15 17:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 17:41 [PATCH 0/6] Shrink some data structures David Sterba
2017-11-15 17:41 ` [PATCH 1/6] btrfs: switch btrfs_trans_handle::adding_csums to bool David Sterba
2017-11-15 17:41 ` [PATCH 2/6] btrfs: remove unused member of btrfs_trans_handle David Sterba
2017-11-15 17:41 ` [PATCH 3/6] btrfs: switch to refcount_t type for btrfs_trans_handle::use_count David Sterba
2017-11-15 17:42 ` [PATCH 4/6] btrfs: reoder btrfs_trans_handle members for better packing David Sterba
2017-11-15 17:42 ` [PATCH 5/6] btrfs: use narrower type for btrfs_transaction::num_dirty_bgs David Sterba
2017-11-15 17:42 ` David Sterba [this message]
2017-11-16 23:29   ` [PATCH 6/6] btrfs: reoder btrfs_transaction members for better packing Liu Bo

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=968af0bfaca921b5879c297e3f5b8037377bc672.1510767175.git.dsterba@suse.com \
    --to=dsterba@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).