From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
sched-ext@lists.linux.dev,
Cheng-Yang Chou <yphbchou0911@gmail.com>,
Emil Tsalapatis <emil@etsalapatis.com>,
linux-kernel@vger.kernel.org,
Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
Chia-Ping Tsai <chia7712@gmail.com>
Subject: Re: [PATCH v3 sched_ext/for-7.2] sched_ext: add p->scx.tid and SCX_OPS_TID_TO_TASK lookup
Date: Sun, 19 Apr 2026 21:02:11 +0200 [thread overview]
Message-ID: <aeUms-ccHZhBNVKn@gpd4> (raw)
In-Reply-To: <c3069bb592d7d09790ca9ff6d9b7d3b2@kernel.org>
On Sun, Apr 19, 2026 at 08:36:45AM -1000, Tejun Heo wrote:
...
> +static void scx_tid_hash_insert(struct task_struct *p)
> +{
> + int ret;
> +
> + lockdep_assert_held(&scx_tasks_lock);
> +
> + ret = rhashtable_lookup_insert_fast(&scx_tid_hash,
> + &p->scx.tid_hash_node,
> + scx_tid_hash_params);
> + WARN_ON_ONCE(ret);
> +}
Hm... WARN_ON_ONCE() only fires once, it can be hard to catch subsequent errors,
especially in case of -ENOMEM.
How about triggering WARN_ON_ONCE(ret == -EEXIST), which should be considered a
real sched_ext core bug, and use scx_error() for insert failures (ENOMEM).
In this way the error is more obvious for the BPF scheduler and can immediately
exit if it happens (even if scx_error() is probably a bit of a semantic stretch
in this case)?
Thanks,
-Andrea
next prev parent reply other threads:[~2026-04-19 19:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-19 18:36 [PATCH v3 sched_ext/for-7.2] sched_ext: add p->scx.tid and SCX_OPS_TID_TO_TASK lookup Tejun Heo
2026-04-19 18:39 ` Cheng-Yang Chou
2026-04-19 19:02 ` Andrea Righi [this message]
2026-04-19 19:15 ` Tejun Heo
2026-04-19 19:24 ` Andrea Righi
2026-04-19 20:19 ` Tejun Heo
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=aeUms-ccHZhBNVKn@gpd4 \
--to=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=chia7712@gmail.com \
--cc=emil@etsalapatis.com \
--cc=jserv@ccns.ncku.edu.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=void@manifault.com \
--cc=yphbchou0911@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.