From: Tejun Heo <tj@kernel.org>
To: Chuyi Zhou <zhouchuyi@bytedance.com>
Cc: void@manifault.com, arighi@nvidia.com, changwoo@igalia.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched_ext: Use SCX_CALL_OP_TASK in task_tick_scx
Date: Thu, 13 Feb 2025 06:57:47 -1000 [thread overview]
Message-ID: <Z64ki36mCAmT0ORF@slm.duckdns.org> (raw)
In-Reply-To: <20250212130935.1585338-1-zhouchuyi@bytedance.com>
On Wed, Feb 12, 2025 at 09:09:35PM +0800, Chuyi Zhou wrote:
> Now when we use scx_bpf_task_cgroup() in ops.tick() to get the cgroup of
> the current task, the following error will occur:
>
> scx_foo[3795244] triggered exit kind 1024:
> runtime error (called on a task not being operated on)
>
> The reason is that we are using SCX_CALL_OP() instead of SCX_CALL_OP_TASK()
> when calling ops.tick(), which triggers the error during the subsequent
> scx_kf_allowed_on_arg_tasks() check.
>
> SCX_CALL_OP_TASK() was first introduced in commit 36454023f50b ("sched_ext:
> Track tasks that are subjects of the in-flight SCX operation") to ensure
> task's rq lock is held when accessing task's sched_group. Since ops.tick()
> is marked as SCX_KF_TERMINAL and task_tick_scx() is protected by the rq
> lock, we can use SCX_CALL_OP_TASK() to avoid the above issue. Similarly,
> the same changes should be made for ops.disable() and ops.exit_task(), as
> they are also protected by task_rq_lock() and it's safe to access the
> task's task_group.
>
> Fixes: 36454023f50b ("sched_ext: Track tasks that are subjects of the in-flight SCX operation")
> Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
Applied to sched_ext/for-6.14-fixes.
Thanks.
--
tejun
prev parent reply other threads:[~2025-02-13 16:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 13:09 Chuyi Zhou
2025-02-13 16:57 ` 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=Z64ki36mCAmT0ORF@slm.duckdns.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=void@manifault.com \
--cc=zhouchuyi@bytedance.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
all inboxes | Powered by JetHome®