Linux block layer
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Fengnan Chang <changfengnan@bytedance.com>,
	Christian Brauner <brauner@kernel.org>, Tejun Heo <tj@kernel.org>
Cc: "Shakeel Butt" <shakeel.butt@linux.dev>,
	"Christoph Hellwig" <hch@lst.de>,
	"Josef Bacik" <josef@toxicpanda.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Hocko" <mhocko@kernel.org>,
	"Roman Gushchin" <roman.gushchin@linux.dev>,
	"Michal Koutný" <mkoutny@suse.com>,
	cgroups@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: Per-bio cost of BLK_CGROUP=y, measured after 7693e1350b06 ("memcg: make MEMCG select BLK_CGROUP")
Date: Thu, 3 Dec 2026 10:59:31 -0700	[thread overview]
Message-ID: <bb6feec1-5985-4963-abd7-c57d5078b1e1@kernel.dk> (raw)
In-Reply-To: <20261203130234.3718286-1-changfengnan@bytedance.com>

On 12/3/26 6:02 AM, Fengnan Chang wrote:
> Hi,
> 
> Since v7.4-rc3, commit 7693e1350b06 ("memcg: make MEMCG select
> BLK_CGROUP") forces CONFIG_BLK_CGROUP (and with it
> CONFIG_CGROUP_WRITEBACK) on for every CONFIG_MEMCG=y build.
> 
> After it landed, our block/io_uring performance test kernels got 4-14%
> slower on single-core io_uring 4K random reads: 3.8-7.4% of IOPS with
> the task in the root cgroup and 7.1-13.8% in a non-root cgroup, on
> cgroup v1 and v2 alike.  Where the core is the bottleneck that is
> +65..+172 cycles and +208..+590 instructions per I/O.

Ugh... Unsurprisingly, because people seemingly never performance
test features they add, they just assume it's free. Or if they know
it has a cost, then the excuse is usually "but it's behind a config
option so people can just turn it off", when the world runs distro
kernels anyway and distros turn on everything under the sun.

So yes I think a series (greatly) reducing the overhead of
BLK_CGROUP would be _highly_ interesting. I'll echo what Tejun
said, do it step-by-step, and have profiles and numbers for
each step.

Thanks!

-- 
Jens Axboe


      parent reply	other threads:[~2026-12-03 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 13:02 Per-bio cost of BLK_CGROUP=y, measured after 7693e1350b06 ("memcg: make MEMCG select BLK_CGROUP") Fengnan Chang
2026-12-03 16:43 ` Tejun Heo
2026-12-03 17:59 ` Jens Axboe [this message]

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=bb6feec1-5985-4963-abd7-c57d5078b1e1@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=changfengnan@bytedance.com \
    --cc=hannes@cmpxchg.org \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=tj@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