mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Changwoo Min <changwoo@igalia.com>
To: Tejun Heo <tj@kernel.org>
Cc: void@manifault.com, arighi@nvidia.com, david.dai@linux.dev,
	Gavin Guo <gavinguo@igalia.com>,
	kernel-dev@igalia.com, sched-ext@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/8] sched_ext: Add p->scx.bpf_priv for O(1) task context lookup
Date: Sun, 6 Dec 2026 14:38:54 +0900	[thread overview]
Message-ID: <2e52274d-a5cd-4bb9-847c-ca0236e592b6@igalia.com> (raw)
In-Reply-To: <fb2d2c90159dd35e8795219a60142f41@kernel.org>

Hello Tejun,

On 12/5/26 2:19 AM, Tejun Heo wrote:
> Hello, Changwoo.
> 
> The following is a Claude-generated review of the scx_qmap and selftest
> patches. It's fully AI-generated and I haven't vetted the points.
> 
> - 4/8: probe() is a syscall program which is never associated with the
>    struct_ops, so the test reaches both kfuncs only through the fallback
>    for unassociated programs. Also, every task is on the root scheduler
>    while it is loaded, so task_sched_id == sched_id holds whether or not
>    the task was switched to SCHED_EXT, and the test can't tell
>    scx_bpf_task_sched_id() from scx_bpf_sched_id(). Telling them apart
>    takes a sub-scheduler.

v3 associates probe() with the scheduler. The sub-scheduler handoff test
now records scx_task_sched_id() in the receiving scheduler's
ops.init_task(), where the task is still on the other scheduler, and
checks that it reports the other scheduler's id.

> 
> - 6/8: The comment above task_ctx_key and the description say that the
>    tag matters e.g. in qmap_dump_task(), but qmap_dump_task() reads task
>    storage directly and never reads p->scx.bpf_priv. The lookup_task_ctx()
>    caller which can be handed another scheduler's task is
>    qmap_core_sched_before().
> 

qmap_dump_task() now uses lookup_task_ctx() too, so the dump example
holds. qmap_core_sched_before() also reaches tasks of other schedulers,
and the tag covers it the same way.


> - 7/8: ops.enable() counts every task, so the test fails when an unrelated
>    SCHED_EXT task is alive at attach. With one such task running:
> 
>      Expected skel->bss->nr_enable == 3 (4 == 3)
> 
>    sub_handoff filters on the target's pid and passes in the same setup.
> 

Fixed. The test counts only its own tasks.


> - 8/8: The return values of scx_bpf_task_set_priv() in ops.enable() and of
>    scx_bpf_task_set_dsq_vtime() in ops.exit_task() are dropped. If either
>    write were refused, the matching stale value check would pass without
>    testing anything.

Fixed. Both are checked and their failures counted.

> 
> - 4/8, 7/8, 8/8: The tests compare getpid() or fork()'s return value
>    against p->pid, which doesn't hold in a non-initial pid namespace.
> 

Fixed. The tests record their target from BPF and pass in a PID
namespace.

Thanks!
Changwoo

> Only the 7/8 failure has been reproduced. The rest are from reading the
> code.
> 
> Thanks.
> 
> --
> tejun


      reply	other threads:[~2026-12-06  5:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  4:56 Changwoo Min
2026-12-03  4:56 ` [PATCH v2 1/8] sched_ext: Reset task fields after ops.exit_task() Changwoo Min
2026-12-04  6:10   ` Andrea Righi
2026-12-04 17:04   ` Tejun Heo
2026-12-03  4:56 ` [PATCH v2 2/8] sched_ext: Mark a task enabled before ops.enable() Changwoo Min
2026-12-04  6:10   ` Andrea Righi
2026-12-04 17:02   ` Tejun Heo
2026-12-06  5:38     ` Changwoo Min
2026-12-03  4:56 ` [PATCH v2 3/8] sched_ext: Add scx_bpf_sched_id() and scx_bpf_task_sched_id() Changwoo Min
2026-12-04  6:44   ` Andrea Righi
2026-12-06  5:38     ` Changwoo Min
2026-12-04 17:17   ` Tejun Heo
2026-12-06  5:38     ` Changwoo Min
2026-12-03  4:56 ` [PATCH v2 4/8] selftests/sched_ext: Test " Changwoo Min
2026-12-03  4:56 ` [PATCH v2 5/8] sched_ext: Add p->scx.bpf_priv for O(1) task context lookup Changwoo Min
2026-12-04 17:09   ` Tejun Heo
2026-12-06  5:38     ` Changwoo Min
2026-12-03  4:56 ` [PATCH v2 6/8] sched_ext: scx_qmap: Cache task_ctx in p->scx.bpf_priv Changwoo Min
2026-12-03  4:56 ` [PATCH v2 7/8] selftests/sched_ext: Test p->scx.bpf_priv across class changes Changwoo Min
2026-12-03  4:56 ` [PATCH v2 8/8] selftests/sched_ext: Test task field reset across sub-scheduler handoffs Changwoo Min
2026-12-04 17:19 ` [PATCH v2 0/8] sched_ext: Add p->scx.bpf_priv for O(1) task context lookup Tejun Heo
2026-12-06  5:38   ` Changwoo Min [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=2e52274d-a5cd-4bb9-847c-ca0236e592b6@igalia.com \
    --to=changwoo@igalia.com \
    --cc=arighi@nvidia.com \
    --cc=david.dai@linux.dev \
    --cc=gavinguo@igalia.com \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.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®