From: Tejun Heo <tj@kernel.org>
To: Chen Linxuan <chenlinxuan@uniontech.com>
Cc: Josef Bacik <josef@toxicpanda.com>, Jens Axboe <axboe@kernel.dk>,
Wen Tao <wentao@uniontech.com>,
cgroups@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND v2] blk-cgroup: improve policy registration error handling
Date: Mon, 17 Mar 2025 08:39:45 -1000 [thread overview]
Message-ID: <Z9hscRtPa76fdank@slm.duckdns.org> (raw)
In-Reply-To: <3E333A73B6B6DFC0+20250317022924.150907-1-chenlinxuan@uniontech.com>
On Mon, Mar 17, 2025 at 10:29:24AM +0800, Chen Linxuan wrote:
> This patch improve the returned error code of blkcg_policy_register().
>
> 1. Move the validation check for cpd/pd_alloc_fn and cpd/pd_free_fn
> function pairs to the start of blkcg_policy_register(). This ensures
> we immediately return -EINVAL if the function pairs are not correctly
> provided, rather than returning -ENOSPC after locking and unlocking
> mutexes unnecessarily.
>
> Those locks should not contention any problems, as error of policy
> registration is a super cold path.
>
> 2. Return -ENOMEM when cpd_alloc_fn() failed.
>
> Co-authored-by: Wen Tao <wentao@uniontech.com>
> Signed-off-by: Wen Tao <wentao@uniontech.com>
> Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
next prev parent reply other threads:[~2025-03-17 18:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 2:29 [PATCH RESEND v2] blk-cgroup: improve policy registration error handling Chen Linxuan
2025-03-17 18:39 ` Tejun Heo [this message]
2025-03-18 15:51 ` Michal Koutný
2025-03-18 18:32 ` Jens Axboe
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=Z9hscRtPa76fdank@slm.duckdns.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=chenlinxuan@uniontech.com \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wentao@uniontech.com \
/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