From: Tejun Heo <tj@kernel.org>
To: axboe@kernel.dk
Cc: linux-kernel@vger.kernel.org, jack@suse.cz,
Tejun Heo <tj@kernel.org>, Wu Fengguang <fengguang.wu@intel.com>
Subject: [PATCH 08/10] writeback: cosmetic change in account_page_dirtied()
Date: Tue, 18 Nov 2014 03:37:26 -0500 [thread overview]
Message-ID: <1416299848-22112-9-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1416299848-22112-1-git-send-email-tj@kernel.org>
Flip the polarity of mapping_cap_account_dirty() test so that the body
of page accounting can be moved outside the if () block. This will
help adding cgroup writeback support.
This causes no logic changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jan Kara <jack@suse.cz>
Cc: Wu Fengguang <fengguang.wu@intel.com>
---
mm/page-writeback.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 7c721b4..29d5bd2 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2104,15 +2104,16 @@ void account_page_dirtied(struct page *page, struct address_space *mapping)
{
trace_writeback_dirty_page(page, mapping);
- if (mapping_cap_account_dirty(mapping)) {
- __inc_zone_page_state(page, NR_FILE_DIRTY);
- __inc_zone_page_state(page, NR_DIRTIED);
- __inc_wb_stat(&mapping->backing_dev_info->wb, WB_RECLAIMABLE);
- __inc_wb_stat(&mapping->backing_dev_info->wb, WB_DIRTIED);
- task_io_account_write(PAGE_CACHE_SIZE);
- current->nr_dirtied++;
- this_cpu_inc(bdp_ratelimits);
- }
+ if (!mapping_cap_account_dirty(mapping))
+ return;
+
+ __inc_zone_page_state(page, NR_FILE_DIRTY);
+ __inc_zone_page_state(page, NR_DIRTIED);
+ __inc_wb_stat(&mapping->backing_dev_info->wb, WB_RECLAIMABLE);
+ __inc_wb_stat(&mapping->backing_dev_info->wb, WB_DIRTIED);
+ task_io_account_write(PAGE_CACHE_SIZE);
+ current->nr_dirtied++;
+ this_cpu_inc(bdp_ratelimits);
}
EXPORT_SYMBOL(account_page_dirtied);
--
1.9.3
next prev parent reply other threads:[~2014-11-18 8:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 8:37 [PATCHSET block/for-next] writeback: prepare for cgroup writeback support Tejun Heo
2014-11-18 8:37 ` [PATCH 01/10] writeback: move backing_dev_info->state into bdi_writeback Tejun Heo
2014-11-20 15:27 ` Jan Kara
2014-11-20 15:38 ` Tejun Heo
2014-11-25 1:20 ` NeilBrown
2014-11-18 8:37 ` [PATCH 02/10] writeback: move backing_dev_info->bdi_stat[] " Tejun Heo
2014-11-20 15:31 ` Jan Kara
2014-11-18 8:37 ` [PATCH 03/10] writeback: move bandwidth related fields from backing_dev_info " Tejun Heo
2014-11-20 15:52 ` Jan Kara
2014-11-20 16:01 ` Tejun Heo
2014-11-18 8:37 ` [PATCH 04/10] writeback: move backing_dev_info->wb_lock and ->worklist " Tejun Heo
2014-11-20 16:01 ` Jan Kara
2014-11-20 16:02 ` Tejun Heo
2014-11-20 16:10 ` Jan Kara
2014-11-18 8:37 ` [PATCH 05/10] writeback: move lingering dirty IO lists transfer from bdi_destroy() to wb_exit() Tejun Heo
2014-11-18 8:37 ` [PATCH 06/10] writeback: reorganize mm/backing-dev.c Tejun Heo
2014-11-18 8:37 ` [PATCH 07/10] writeback: separate out include/linux/backing-dev-defs.h Tejun Heo
2014-11-18 8:37 ` Tejun Heo [this message]
2014-11-18 8:37 ` [PATCH 09/10] writeback: add @gfp to wb_init() Tejun Heo
2014-11-18 8:37 ` [PATCH 10/10] writeback: move inode_to_bdi() to include/linux/backing-dev.h Tejun Heo
2014-11-20 15:13 ` [PATCHSET block/for-next] writeback: prepare for cgroup writeback support Jan Kara
2014-11-20 15:14 ` Tejun Heo
2014-11-20 15:44 ` Christoph Hellwig
2014-11-20 16:21 ` 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=1416299848-22112-9-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=fengguang.wu@intel.com \
--cc=jack@suse.cz \
--cc=linux-kernel@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).