From: Tejun Heo <tj@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-block@vger.kernel.org, cgroups@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Jens Axboe <axboe@kernel.dk>, Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH] blkcg: Optimize exit to user space
Date: Wed, 13 Aug 2025 06:53:59 -1000 [thread overview]
Message-ID: <aJzDJ3DfzUK_ntZR@slm.duckdns.org> (raw)
In-Reply-To: <87qzxf6zde.ffs@tglx>
On Wed, Aug 13, 2025 at 04:59:57PM +0200, Thomas Gleixner wrote:
> blkcg uses TIF_NOTIFY_RESUME to handle throttling on exit to user
> space. TIF_NOTIFY_RESUME is a multiplexing TIF bit, which is utilized by
> other entities as well.
>
> This results in a unconditional blkcg_maybe_throttle_current() call for
> every invocation of resume_user_mode_work(), which is a pointless exercise
> as most of the time there is no throttling work to do.
>
> Optimize this by doing a quick check of the throttling condition before
> invoking it.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Josef Bacik <josef@toxicpanda.com>
> Cc: Jens Axboe <axboe@kernel.dk>
...
> -void blkcg_maybe_throttle_current(void)
> +void __blkcg_maybe_throttle_current(void)
> {
> struct gendisk *disk = current->throttle_disk;
> struct blkcg *blkcg;
A nit: __blkcg_maybe_throttle_current() ends up doing another NULL check.
Maybe drop that? Other than that,
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
prev parent reply other threads:[~2025-08-13 16:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 14:59 [PATCH] blkcg: Optimize exit to user space Thomas Gleixner
2025-08-13 16:53 ` Tejun Heo [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=aJzDJ3DfzUK_ntZR@slm.duckdns.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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).