From: Josef Bacik <jbacik@fb.com>
To: <linux-btrfs@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
<kernel-team@fb.com>, <jack@suse.com>, <viro@zeniv.linux.org.uk>,
<dchinner@redhat.com>, <hch@lst.de>
Subject: [PATCH 0/2][RFC] Provide accounting for dirty metadata
Date: Tue, 9 Aug 2016 15:08:25 -0400 [thread overview]
Message-ID: <1470769707-26079-1-git-send-email-jbacik@fb.com> (raw)
Btrfs has always had a dummy inode that we used to allocate pages for our
metadata. This has allowed us to take advantage of balance_dirty_pages() since
our dirty metadata is unbounded otherwise. This has worked fine for years, but
now we want to add sub pagesize blocksize support. The easiest way to do this
would be to just kmalloc() our pages, since we already do all of our buffer
management ourselves anyway. But in order to switch over to that we need to
kill the metadata inode and allow us to make our own allocations for metadata.
Enter these two patches. The first one is fairly straightforward.
balance_dirty_pages() works on a per-bdi case, the only reason we pass mapping
around is so we can check and see if the fs we are working against has writeback
cgroups enabled. So this change is just changing function arguments and has no
behavior change at all.
The second patch is where I'd like a little more attention. I've added some
helpers to deal with the dirty metadata page accounting. Basically this just
adds some page stats that balance_dirty_pages() can take into account when
deciding whether to kick the background writeback. Then I've added a sb
callback to handle writing back dirty metadata, and I've added a list to the bdi
for the sb's attached to that bdi. My plan is to just add/remove the btrfs sb
to it when we mount/umount.
Any suggestions are welcome, this is relatively self contained and doesn't
complicate things too much so I think works well, but I may not be thinking of
other cases. Thanks,
Josef
next reply other threads:[~2016-08-09 19:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 19:08 Josef Bacik [this message]
2016-08-09 19:08 ` [PATCH 1/2] remove mapping from balance_dirty_pages*() Josef Bacik
2016-08-09 19:30 ` kbuild test robot
2016-08-09 19:32 ` kbuild test robot
2016-08-09 20:12 ` kbuild test robot
2016-08-09 20:50 ` kbuild test robot
2016-08-10 8:27 ` Jan Kara
2016-08-10 8:29 ` Jan Kara
2016-08-10 19:56 ` Tejun Heo
2016-08-09 19:08 ` [PATCH 2/2] writeback: allow for dirty metadata accounting Josef Bacik
2016-08-10 10:09 ` Jan Kara
2016-08-10 14:05 ` Josef Bacik
2016-08-10 20:12 ` Tejun Heo
2016-08-10 21:16 ` Josef Bacik
2016-08-10 21:39 ` Tejun Heo
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=1470769707-26079-1-git-send-email-jbacik@fb.com \
--to=jbacik@fb.com \
--cc=dchinner@redhat.com \
--cc=hch@lst.de \
--cc=jack@suse.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).