All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] btrfs: compressed writeback cgroup attribution
@ 2022-03-31 21:58 Dennis Zhou
  2022-03-31 21:58 ` [PATCH 1/1] btrfs: fix btrfs_submit_compressed_write " Dennis Zhou
  0 siblings, 1 reply; 3+ messages in thread
From: Dennis Zhou @ 2022-03-31 21:58 UTC (permalink / raw)
  To: David Sterba, Chris Mason, Josef Bacik; +Cc: linux-btrfs, Dennis Zhou

Hello,

I was looking at some blk-cgroup attribution stuff due to an ask
regarding io_uring and was thinking back to this work. I noticed that
the cgroup attribution for writeback is gone. Josef or Chris, can you
comment if this is still desired / the state of REQ_CGROUP_PUNT?

Thanks,
Dennis

Dennis Zhou (1):
  btrfs: fix btrfs_submit_compressed_write cgroup attribution

 fs/btrfs/compression.c | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] btrfs: fix btrfs_submit_compressed_write cgroup attribution
  2022-03-31 21:58 [PATCH 0/1] btrfs: compressed writeback cgroup attribution Dennis Zhou
@ 2022-03-31 21:58 ` Dennis Zhou
  2022-04-01 16:52   ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Dennis Zhou @ 2022-03-31 21:58 UTC (permalink / raw)
  To: David Sterba, Chris Mason, Josef Bacik; +Cc: linux-btrfs, Dennis Zhou

This restores the logic from commit 46bcff2bfc5e
("btrfs: fix compressed write bio blkcg attribution") which added cgroup
attribution to btrfs writeback. It also adds back the REQ_CGROUP_PUNT
flag for these ios.

Fixes: 91507240482e ("btrfs: determine stripe boundary at bio allocation time in btrfs_submit_compressed_write")
Signed-off-by: Dennis Zhou <dennis@kernel.org>
---
 fs/btrfs/compression.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index be476f094300..19bf36d8ffea 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -537,6 +537,9 @@ blk_status_t btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start,
 	cb->orig_bio = NULL;
 	cb->nr_pages = nr_pages;
 
+	if (blkcg_css)
+		kthread_associate_blkcg(blkcg_css);
+
 	while (cur_disk_bytenr < disk_start + compressed_len) {
 		u64 offset = cur_disk_bytenr - disk_start;
 		unsigned int index = offset >> PAGE_SHIFT;
@@ -555,6 +558,8 @@ blk_status_t btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start,
 				bio = NULL;
 				goto finish_cb;
 			}
+			if (blkcg_css)
+				bio->bi_opf |= REQ_CGROUP_PUNT;
 		}
 		/*
 		 * We should never reach next_stripe_start start as we will
@@ -612,6 +617,9 @@ blk_status_t btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start,
 	return 0;
 
 finish_cb:
+	if (blkcg_css)
+		kthread_associate_blkcg(NULL);
+
 	if (bio) {
 		bio->bi_status = ret;
 		bio_endio(bio);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] btrfs: fix btrfs_submit_compressed_write cgroup attribution
  2022-03-31 21:58 ` [PATCH 1/1] btrfs: fix btrfs_submit_compressed_write " Dennis Zhou
@ 2022-04-01 16:52   ` David Sterba
  0 siblings, 0 replies; 3+ messages in thread
From: David Sterba @ 2022-04-01 16:52 UTC (permalink / raw)
  To: Dennis Zhou; +Cc: David Sterba, Chris Mason, Josef Bacik, linux-btrfs

On Thu, Mar 31, 2022 at 02:58:28PM -0700, Dennis Zhou wrote:
> This restores the logic from commit 46bcff2bfc5e
> ("btrfs: fix compressed write bio blkcg attribution") which added cgroup
> attribution to btrfs writeback. It also adds back the REQ_CGROUP_PUNT
> flag for these ios.
> 
> Fixes: 91507240482e ("btrfs: determine stripe boundary at bio allocation time in btrfs_submit_compressed_write")
> Signed-off-by: Dennis Zhou <dennis@kernel.org>

Looks like this got lost in the refactoring. Added to misc-next, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-01 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-31 21:58 [PATCH 0/1] btrfs: compressed writeback cgroup attribution Dennis Zhou
2022-03-31 21:58 ` [PATCH 1/1] btrfs: fix btrfs_submit_compressed_write " Dennis Zhou
2022-04-01 16:52   ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.