linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: hannes@cmpxchg.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, jack@suse.cz,
	linux-fsdevel@vger.kernel.org, kernel-team@fb.com,
	linux-btrfs@vger.kernel.org, Josef Bacik <jbacik@fb.com>
Subject: Re: [PATCH v2 09/11] Btrfs: kill the btree_inode
Date: Mon, 27 Nov 2017 18:10:51 +0100	[thread overview]
Message-ID: <20171127171051.GF3553@twin.jikos.cz> (raw)
In-Reply-To: <1511385366-20329-10-git-send-email-josef@toxicpanda.com>

On Wed, Nov 22, 2017 at 04:16:04PM -0500, Josef Bacik wrote:
> From: Josef Bacik <jbacik@fb.com>
> @@ -4802,8 +4885,8 @@ struct extent_buffer *btrfs_clone_extent_buffer(struct extent_buffer *src)
>  	return new;
>  }
>  
> -struct extent_buffer *__alloc_dummy_extent_buffer(struct btrfs_fs_info *fs_info,
> -						  u64 start, unsigned long len)
> +struct extent_buffer *alloc_dummy_extent_buffer(struct btrfs_eb_info *eb_info,
> +						u64 start, unsigned long len)

The __alloc_dummy_extent_buffer takes the length parameter because it's
used in tests that need to pass different values.
I've removed nodesize from alloc_dummy_extent_buffer and the callchain
because we know that it's always going to be fs_info->nodesize.
Reintroducing it does not look like a good idea.

>  {
>  	struct extent_buffer *eb;
>  	unsigned long num_pages;

> @@ -160,13 +162,25 @@ struct extent_state {
>  #endif
>  };
>  
> +struct btrfs_eb_info {
> +	struct btrfs_fs_info *fs_info;
> +	struct extent_io_tree io_tree;
> +	struct extent_io_tree io_failure_tree;
> +
> +	/* Extent buffer radix tree */
> +	spinlock_t buffer_lock;
> +	struct radix_tree_root buffer_radix;
> +	struct list_lru lru_list;
> +	pgoff_t writeback_index;
> +};
> +
>  #define INLINE_EXTENT_BUFFER_PAGES 16
>  #define MAX_INLINE_EXTENT_BUFFER_SIZE (INLINE_EXTENT_BUFFER_PAGES * PAGE_SIZE)
>  struct extent_buffer {
>  	u64 start;
>  	unsigned long len;
>  	unsigned long bflags;
> -	struct btrfs_fs_info *fs_info;
> +	struct btrfs_eb_info *eb_info;

This single change increases the patch size just because all the
callers need to be updated. I suggest to keep fs_info in extent_buffer,
we're not going to lose much in terms of memory:

currently there are 14 eb objects in a 4k slab page, with the additional
fs_info it's still 14,

280 * 14 = 3920, unused 176 bytes
288 * 14 = 4032, unused 64 bytes

>  	spinlock_t refs_lock;
>  	atomic_t refs;
>  	atomic_t io_pages;

  reply	other threads:[~2017-11-27 17:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 21:15 [PATCH v2 00/11] Metadata specific accouting and dirty writeout Josef Bacik
2017-11-22 21:15 ` [PATCH v2 01/11] remove mapping from balance_dirty_pages*() Josef Bacik
2017-11-22 21:15 ` [PATCH v2 02/11] writeback: convert WB_WRITTEN/WB_DIRITED counters to bytes Josef Bacik
2017-11-29 17:02   ` Jan Kara
2017-11-22 21:15 ` [PATCH v2 03/11] lib: make the fprop batch size a multiple of PAGE_SIZE Josef Bacik
2017-11-29 17:04   ` Jan Kara
2017-11-30 15:48     ` David Sterba
2017-11-22 21:15 ` [PATCH v2 04/11] lib: add a __fprop_add_percpu_max Josef Bacik
2017-11-29 17:05   ` Jan Kara
2017-11-22 21:16 ` [PATCH v2 05/11] writeback: convert the flexible prop stuff to bytes Josef Bacik
2017-11-29 17:05   ` Jan Kara
2017-11-22 21:16 ` [PATCH v2 06/11] writeback: add counters for metadata usage Josef Bacik
2017-12-04 13:06   ` Jan Kara
2017-12-06 20:18     ` Josef Bacik
2017-12-06 22:43       ` Johannes Weiner
2017-11-22 21:16 ` [PATCH v2 07/11] writeback: introduce super_operations->write_metadata Josef Bacik
2017-11-22 21:16 ` [PATCH v2 08/11] export radix_tree_iter_tag_set Josef Bacik
2017-11-22 21:16 ` [PATCH v2 09/11] Btrfs: kill the btree_inode Josef Bacik
2017-11-27 17:10   ` David Sterba [this message]
2017-11-22 21:16 ` [PATCH v2 10/11] btrfs: rework end io for extent buffer reads Josef Bacik
2017-11-22 21:16 ` [PATCH v2 11/11] btrfs: add NR_METADATA_BYTES accounting Josef Bacik
2017-11-23 18:45 ` [PATCH v2 00/11] Metadata specific accouting and dirty writeout 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=20171127171051.GF3553@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=jack@suse.cz \
    --cc=jbacik@fb.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.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).