public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Chris Mason <clm@meta.com>, Josef Bacik <josef@toxicpanda.com>,
	Chris Mason <clm@fb.com>, David Sterba <dsterba@suse.com>,
	Jens Axboe <axboe@kernel.dk>,
	cgroups@vger.kernel.org, linux-block@vger.kernel.org,
	linux-btrfs@vger.kernel.org
Subject: Re: move bio cgroup punting into btrfs
Date: Wed, 29 Mar 2023 09:16:18 -1000	[thread overview]
Message-ID: <ZCSOgoe84BhiUZcn@slm.duckdns.org> (raw)
In-Reply-To: <20230328233448.GA5486@lst.de>

Hello, Christoph.

I'm semi-offline for a few weeks, so please pardon the tardiness and
brevity.

On Wed, Mar 29, 2023 at 01:34:48AM +0200, Christoph Hellwig wrote:
> On Tue, Mar 28, 2023 at 05:18:43PM -0400, Chris Mason wrote:
> btrfs is the only place offloading writes from the per-cgroup writeback
> to it's own not cgroup aware workqueues.
>
> Offloading from one writeback thread to another threadpool to just
> offload back to another thread to not deadlock is obviously not
> an actual smart thing to do, and fortunately no one else is doing
> this.

We didn't really look deep into adding the support but Chris mentioned that
raid5/6 are likely to need something similar. Maybe this is because my grasp
of filesytsems is pretty weak but the pattern doesn't seem unreasonable to
me. There's some work to be done by a shread kthread and that sometimes can
fork out IOs which belong to specific cgroups.

> For btrfs it is on it's way out by not doing the offload just for
> checksumming in a little bit, and even for compression the right fix
> is just to allow more than one thread per device and cgroup.  I plan
> to look into that, but there's plenty higher priority work right now.

At least in the IO control and direct issue path, punting to just one thread
hasn't been a practical problem given that when the issuing thread needs to
be blocked, either the whole device or the cgroup needs to be throttled
anyway. Are you thinking about scenarios where substantial CPU cycles are
consumed for IOs (e.g. dm-crypt)?

Thanks.

-- 
tejun

  reply	other threads:[~2023-03-29 19:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27  0:49 move bio cgroup punting into btrfs Christoph Hellwig
2023-03-27  0:49 ` [PATCH 1/7] btrfs: move kthread_associate_blkcg out of btrfs_submit_compressed_write Christoph Hellwig
2023-03-27  0:49 ` [PATCH 2/7] btrfs: don't free the async_extent in submit_uncompressed_range Christoph Hellwig
2023-03-27  0:49 ` [PATCH 3/7] btrfs: also use kthread_associate_blkcg for uncompressible ranges Christoph Hellwig
2023-03-27  0:49 ` [PATCH 4/7] btrfs, mm: remove the punt_to_cgroup field in struct writeback_control Christoph Hellwig
2023-03-27  0:49 ` [PATCH 5/7] btrfs, block: move REQ_CGROUP_PUNT to btrfs Christoph Hellwig
2023-03-28  1:15   ` Jens Axboe
2023-03-27  0:49 ` [PATCH 6/7] block: async_bio_lock does not need to be bh-safe Christoph Hellwig
2023-03-27 23:31   ` Jens Axboe
2023-03-27  0:49 ` [PATCH 7/7] block: make blkcg_punt_bio_submit optional Christoph Hellwig
2023-03-27 23:32   ` Jens Axboe
2023-03-27 23:18 ` move bio cgroup punting into btrfs David Sterba
2023-03-31 17:25   ` David Sterba
2023-03-28 21:18 ` Chris Mason
2023-03-28 23:34   ` Christoph Hellwig
2023-03-29 19:16     ` Tejun Heo [this message]
2023-03-30  0:15       ` Christoph Hellwig

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=ZCSOgoe84BhiUZcn@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=clm@fb.com \
    --cc=clm@meta.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@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