From: Tejun Heo <tj@kernel.org>
To: dsterba@suse.com, clm@fb.com, josef@toxicpanda.com,
axboe@kernel.dk, jack@suse.cz
Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org, kernel-team@fb.com,
Tejun Heo <tj@kernel.org>
Subject: [PATCH 2/9] blkcg, writeback: Add wbc->no_wbc_acct
Date: Sat, 15 Jun 2019 11:24:46 -0700 [thread overview]
Message-ID: <20190615182453.843275-3-tj@kernel.org> (raw)
In-Reply-To: <20190615182453.843275-1-tj@kernel.org>
When writeback IOs are bounced through async layers, the IOs should
only be accounted against the wbc from the original bdi writeback to
avoid confusing cgroup inode ownership arbitration. Add
wbc->no_wbc_acct to allow disabling wbc accounting. This will be used
make btfs compression work well with cgroup IO control.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
---
fs/fs-writeback.c | 2 +-
include/linux/writeback.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index c29cff345b1f..667ba07fffcd 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -724,7 +724,7 @@ void wbc_account_io(struct writeback_control *wbc, struct page *page,
* behind a slow cgroup. Ultimately, we want pageout() to kick off
* regular writeback instead of writing things out itself.
*/
- if (!wbc->wb)
+ if (!wbc->wb || wbc->no_wbc_acct)
return;
id = mem_cgroup_css_from_page(page)->id;
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 738a0c24874f..b8f5f000cde4 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -68,6 +68,7 @@ struct writeback_control {
unsigned for_reclaim:1; /* Invoked from the page allocator */
unsigned range_cyclic:1; /* range_start is cyclic */
unsigned for_sync:1; /* sync(2) WB_SYNC_ALL writeback */
+ unsigned no_wbc_acct:1; /* skip wbc IO accounting */
#ifdef CONFIG_CGROUP_WRITEBACK
struct bdi_writeback *wb; /* wb this writeback is issued under */
struct inode *inode; /* inode being written out */
--
2.17.1
next prev parent reply other threads:[~2019-06-15 18:25 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-15 18:24 [PATCHSET v2 btrfs/for-next] blkcg, btrfs: fix cgroup writeback support Tejun Heo
2019-06-15 18:24 ` [PATCH 1/9] cgroup, blkcg: Prepare some symbols for module and !CONFIG_CGROUP usages Tejun Heo
2019-06-24 16:39 ` Jan Kara
2019-06-15 18:24 ` Tejun Heo [this message]
2019-06-20 15:21 ` [PATCH 2/9] blkcg, writeback: Add wbc->no_wbc_acct Jan Kara
2019-06-20 17:02 ` Tejun Heo
2019-06-24 8:21 ` Jan Kara
2019-06-24 12:58 ` Tejun Heo
2019-06-24 16:39 ` Jan Kara
2019-06-24 16:49 ` Jan Kara
2019-06-15 18:24 ` [PATCH 3/9] blkcg, writeback: Implement wbc_blkcg_css() Tejun Heo
2019-06-24 16:50 ` Jan Kara
2019-06-15 18:24 ` [PATCH 4/9] blkcg: implement REQ_CGROUP_PUNT Tejun Heo
2019-06-15 18:29 ` Tejun Heo
2019-06-20 15:37 ` Jan Kara
2019-06-20 16:42 ` Tejun Heo
2019-06-20 17:01 ` Jan Kara
2019-06-24 16:53 ` Jan Kara
2019-06-15 18:24 ` [PATCH 5/9] Btrfs: stop using btrfs_schedule_bio() Tejun Heo
2019-06-15 18:24 ` [PATCH 6/9] Btrfs: delete the entire async bio submission framework Tejun Heo
2019-06-15 18:24 ` [PATCH 7/9] Btrfs: only associate the locked page with one async_cow struct Tejun Heo
2019-06-15 18:24 ` [PATCH 8/9] Btrfs: use REQ_CGROUP_PUNT for worker thread submitted bios Tejun Heo
2019-06-15 18:24 ` [PATCH 9/9] Btrfs: extent_write_locked_range() should attach inode->i_wb Tejun Heo
2019-06-18 12:54 ` [PATCHSET v2 btrfs/for-next] blkcg, btrfs: fix cgroup writeback support David Sterba
2019-06-18 14:45 ` 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=20190615182453.843275-3-tj@kernel.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=jack@suse.cz \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--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).