]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
sched_ext: Improve SCX_KF_DISPATCH comment
authorTejun Heo <tj@kernel.org>
Tue, 23 Sep 2025 19:03:26 +0000 (09:03 -1000)
committerTejun Heo <tj@kernel.org>
Tue, 23 Sep 2025 19:03:26 +0000 (09:03 -1000)
The comment for SCX_KF_DISPATCH was incomplete and didn't explain that
ops.dispatch() may temporarily release the rq lock, allowing ENQUEUE and
SELECT_CPU operations to be nested inside DISPATCH contexts.

Update the comment to clarify this nesting behavior and provide better
context for when these operations can occur within dispatch.

Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/sched/ext.h

index 7047101dbf587a48898b9e00d1901f93ade747fb..d82b7a9b0658be75faf5aec0984ec2cc45ec38f0 100644 (file)
@@ -108,7 +108,11 @@ enum scx_kf_mask {
        SCX_KF_UNLOCKED         = 0,      /* sleepable and not rq locked */
        /* ENQUEUE and DISPATCH may be nested inside CPU_RELEASE */
        SCX_KF_CPU_RELEASE      = 1 << 0, /* ops.cpu_release() */
-       /* ops.dequeue (in REST) may be nested inside DISPATCH */
+       /*
+        * ops.dispatch() may release rq lock temporarily and thus ENQUEUE and
+        * SELECT_CPU may be nested inside. ops.dequeue (in REST) may also be
+        * nested inside DISPATCH.
+        */
        SCX_KF_DISPATCH         = 1 << 1, /* ops.dispatch() */
        SCX_KF_ENQUEUE          = 1 << 2, /* ops.enqueue() and ops.select_cpu() */
        SCX_KF_SELECT_CPU       = 1 << 3, /* ops.select_cpu() */