From: Josef Bacik <jbacik@fb.com>
To: Tejun Heo <htejun@fb.com>
Cc: <linux-btrfs@vger.kernel.org>, <kernel-team@fb.com>,
<david@fromorbit.com>, <jack@suse.cz>,
<linux-fsdevel@vger.kernel.org>, <viro@zeniv.linux.org.uk>,
<hch@infradead.org>, <jweiner@fb.com>
Subject: Re: [PATCH 2/5] writeback: convert WB_WRITTEN/WB_DIRITED counters to bytes
Date: Tue, 25 Oct 2016 15:09:42 -0400 [thread overview]
Message-ID: <9eb320ce-a1fa-bb4f-a21b-ee3557bb6083@fb.com> (raw)
In-Reply-To: <20161025190317.GB13857@htj.duckdns.org>
On 10/25/2016 03:03 PM, Tejun Heo wrote:
> Hello, Josef.
>
> On Tue, Oct 25, 2016 at 02:41:41PM -0400, 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>
>
> Acked-by: Tejun Heo <tj@kernel.org>
>
> A small nit below.
>
>> @@ -2547,12 +2547,16 @@ void account_page_redirty(struct page *page)
>> if (mapping && mapping_cap_account_dirty(mapping)) {
>> struct inode *inode = mapping->host;
>> struct bdi_writeback *wb;
>> + unsigned long flags;
>> bool locked;
>>
>> wb = unlocked_inode_to_wb_begin(inode, &locked);
>> current->nr_dirtied--;
>> - dec_node_page_state(page, NR_DIRTIED);
>> - dec_wb_stat(wb, WB_DIRTIED);
>> +
>> + local_irq_save(flags);
>> + __dec_node_page_state(page, NR_DIRTIED);
>> + __add_wb_stat(wb, WB_DIRTIED_BYTES, -(long)PAGE_SIZE);
>> + local_irq_restore(flags);
>
> Hmmm... so, the explicit irq clustering is neutral or win as the code
> currently stands but AFAICS that's just because add_wb_stat() doesn't
> use the right percpu ops. If we convert add_wb_stat() to use the
> matching percpu ops, the above change would be more expensive at least
> on x86. Maybe just skip this part?
>
Yeah I can convert it over and then just not do the irq dance. I'll fix that up
for the next go around. Thanks,
Josef
next prev parent reply other threads:[~2016-10-25 19:10 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 18:41 [PATCH 0/5][RESEND] Support for metadata specific accounting Josef Bacik
2016-10-25 18:41 ` [PATCH 1/5] remove mapping from balance_dirty_pages*() Josef Bacik
2016-10-25 18:47 ` Tejun Heo
2016-10-25 18:41 ` [PATCH 2/5] writeback: convert WB_WRITTEN/WB_DIRITED counters to bytes Josef Bacik
2016-10-25 19:03 ` Tejun Heo
2016-10-25 19:09 ` Josef Bacik [this message]
2016-10-30 15:13 ` Jan Kara
2016-10-25 18:41 ` [PATCH 3/5] writeback: add counters for metadata usage Josef Bacik
2016-10-25 19:50 ` Tejun Heo
2016-10-26 15:20 ` Josef Bacik
2016-10-26 15:49 ` Tejun Heo
2016-10-30 15:36 ` Jan Kara
2016-10-25 18:41 ` [PATCH 4/5] writeback: introduce super_operations->write_metadata Josef Bacik
2016-10-25 20:00 ` Tejun Heo
2016-10-25 18:41 ` [PATCH 5/5] fs: don't set *REFERENCED unless we are on the lru list Josef Bacik
2016-10-25 22:01 ` Dave Chinner
2016-10-25 23:36 ` Dave Chinner
2016-10-26 20:03 ` Josef Bacik
2016-10-26 22:20 ` Dave Chinner
2016-10-26 15:11 ` Josef Bacik
2016-10-27 0:30 ` Dave Chinner
2016-10-27 13:13 ` Josef Bacik
2016-10-28 3:48 ` Dave Chinner
2016-10-25 22:44 ` Omar Sandoval
2016-10-26 4:17 ` [PATCH 5/5] " Andreas Dilger
2016-10-26 5:24 ` Omar Sandoval
-- strict thread matches above, loose matches on Subject: below --
2016-10-24 20:43 [PATCH 0/5] Support for metadata specific accounting Josef Bacik
2016-10-24 20:43 ` [PATCH 2/5] writeback: convert WB_WRITTEN/WB_DIRITED counters to bytes 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=9eb320ce-a1fa-bb4f-a21b-ee3557bb6083@fb.com \
--to=jbacik@fb.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=htejun@fb.com \
--cc=jack@suse.cz \
--cc=jweiner@fb.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).