[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aJzDJ3DfzUK_ntZR@slm.duckdns.org>
Date: Wed, 13 Aug 2025 06:53:59 -1000
From: Tejun Heo <tj@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-block@...r.kernel.org, cgroups@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>, Jens Axboe <axboe@...nel.dk>,
Josef Bacik <josef@...icpanda.com>
Subject: Re: [PATCH] blkcg: Optimize exit to user space
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@...utronix.de>
> Cc: Tejun Heo <tj@...nel.org>
> Cc: Josef Bacik <josef@...icpanda.com>
> Cc: Jens Axboe <axboe@...nel.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@...nel.org>
Thanks.
--
tejun
Powered by blists - more mailing lists