From: Jan Kara <jack@suse.cz>
To: Josef Bacik <jbacik@fb.com>
Cc: 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, linux-mm@kvack.org,
hannes@cmpxchg.org
Subject: Re: [PATCH 3/4] writeback: convert WB_WRITTEN/WB_DIRITED counters to bytes
Date: Thu, 22 Sep 2016 13:34:26 +0200 [thread overview]
Message-ID: <20160922113426.GM2834@quack2.suse.cz> (raw)
In-Reply-To: <1474405068-27841-4-git-send-email-jbacik@fb.com>
On Tue 20-09-16 16:57:47, Josef Bacik wrote:
> These are counters that constantly go up in order to do bandwidth calculations.
> It isn't important what the units are in, as long as they are consistent between
> the two of them, so convert them to count bytes written/dirtied, and allow the
> metadata accounting stuff to change the counters as well.
>
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
> fs/fuse/file.c | 4 ++--
> include/linux/backing-dev-defs.h | 4 ++--
> include/linux/backing-dev.h | 2 +-
> mm/backing-dev.c | 8 ++++----
> mm/page-writeback.c | 26 ++++++++++++++++----------
> 5 files changed, 25 insertions(+), 19 deletions(-)
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index f394aff..3f5991e 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -1466,7 +1466,7 @@ static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
> for (i = 0; i < req->num_pages; i++) {
> dec_wb_stat(&bdi->wb, WB_WRITEBACK);
> dec_node_page_state(req->pages[i], NR_WRITEBACK_TEMP);
> - wb_writeout_inc(&bdi->wb);
> + wb_writeout_inc(&bdi->wb, PAGE_SIZE);
Nitpick: Rename this to wb_writeout_add()? You have to change all the call
sites anyway and it is more consistent with other naming.
> @@ -2523,6 +2523,7 @@ void account_metadata_dirtied(struct page *page, struct backing_dev_info *bdi,
> __mod_node_page_state(page_pgdat(page), NR_METADATA_DIRTY_BYTES,
> bytes);
> __add_wb_stat(&bdi->wb, WB_METADATA_DIRTY_BYTES, bytes);
> + __add_wb_stat(&bdi->wb, WB_DIRTIED_BYTES, bytes);
> current->nr_dirtied++;
> task_io_account_write(bytes);
> this_cpu_inc(bdp_ratelimits);
> @@ -2593,6 +2594,7 @@ void account_metadata_end_writeback(struct page *page,
> __add_wb_stat(&bdi->wb, WB_METADATA_WRITEBACK_BYTES, -bytes);
> __mod_node_page_state(page_pgdat(page), NR_METADATA_WRITEBACK_BYTES,
> -bytes);
> + __add_wb_stat(&bdi->wb, WB_WRITTEN_BYTES, bytes);
> local_irq_restore(flags);
> }
> EXPORT_SYMBOL(account_metadata_end_writeback);
It seems it would make sense to move this patch to be second in the
series so that above two functions could do the right thing from the
beginning.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2016-09-22 11:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-20 20:57 [PATCH 0/4][V3] metadata throttling in writeback patches Josef Bacik
2016-09-20 20:57 ` [PATCH 1/4] remove mapping from balance_dirty_pages*() Josef Bacik
2016-09-20 20:57 ` [PATCH 2/4] writeback: allow for dirty metadata accounting Josef Bacik
2016-09-22 11:18 ` Jan Kara
2016-09-22 13:34 ` Josef Bacik
2016-09-22 19:48 ` Johannes Weiner
2016-09-20 20:57 ` [PATCH 3/4] writeback: convert WB_WRITTEN/WB_DIRITED counters to bytes Josef Bacik
2016-09-22 11:34 ` Jan Kara [this message]
2016-09-22 13:35 ` Josef Bacik
2016-09-20 20:57 ` [PATCH 4/4] writeback: introduce super_operations->write_metadata Josef Bacik
2016-09-22 11:48 ` Jan Kara
2016-09-22 13:36 ` Josef Bacik
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=20160922113426.GM2834@quack2.suse.cz \
--to=jack@suse.cz \
--cc=dchinner@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=hch@lst.de \
--cc=jack@suse.com \
--cc=jbacik@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.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).