sched_ext: Documentation: add note about multiple ops.enqueue() calls in a row
Subsystems (2)
PATCH 1/1 sched_ext: Documentation: add note about multiple ops.enqueue() calls in a row
Commit 84b1a0ea0b7c
("sched_ext: Implement scx_bpf_dsq_reenq() for user DSQs") introduced the possibility of ops.enqueue() being called multiple times in a row for the same task without intervening calls to ops.dequeue(). AFAIK this was not possible before that commit.
Document this behavior as it may be surprising to some.
--- Documentation/scheduler/sched-ext.rst | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/scheduler/sched-ext.rst +5 -0
@@ -339,6 +339,11 @@ The following briefly shows how a waking task is scheduled and executed. leaves (e.g., when ``ops.dispatch()`` moves it to a terminal DSQ, or on property change / sleep). + Note that ``ops.enqueue()`` can be called multiple times in a row without + an intervening call to ``ops.dequeue()``. This can happen, for example, + when a task on a user-created DSQ is re-enqueued using + ``scx_bpf_dsq_reenq()``. The task stays in BPF custody the entire time. + When a task leaves BPF scheduler custody, ``ops.dequeue()`` is invoked. The dequeue can happen for different reasons, distinguished by flags:
Signature · 1 line
2.54.0.rc1.555.g9c883467ad-goog
Hi Kuba,
Quoted 8 lines · Kuba Piecuch
Commit
84b1a0ea0b7c
("sched_ext: Implementscx_bpf_dsq_reenq()for user DSQs") introduced the possibility ofops.enqueue()being called multiple times in a row for the same task without intervening calls toops.dequeue(). AFAIK this was not possible before that commit.
Document this behavior as it may be surprising to some.Signed-off-by Kuba Piecuch <[email protected]>
Looks good to me and I think it's good to document this special case.
Thanks,
-Andrea
Quoted 23 lines
--- Documentation/scheduler/sched-ext.rst | 5 +++++ 1 file changed, 5 insertions(+)Documentation/scheduler/sched-ext.rst +5
-0@@ -339,6 +339,11 @@ The following briefly shows how a waking task is scheduled and executed. leaves (e.g., when ``ops.dispatch()`` moves it to a terminal DSQ, or on property change / sleep). + Note that ``ops.enqueue()`` can be called multiple times in a row without + an intervening call to ``ops.dequeue()``. This can happen, for example, + when a task on a user-created DSQ is re-enqueued using + ``scx_bpf_dsq_reenq()``. The task stays in BPF custody the entire time. + When a task leaves BPF scheduler custody, ``ops.dequeue()`` is invoked. The dequeue can happen for different reasons, distinguished by flags:Signature · 1 line
2.54.0.rc1.555.g9c883467ad-goog
Hi Kuba,
Quoted 5 lines · Kuba Piecuch
Commit
84b1a0ea0b7c
("sched_ext: Implementscx_bpf_dsq_reenq()for user DSQs") introduced the possibility ofops.enqueue()being called multiple times in a row for the same task without intervening calls toops.dequeue(). AFAIK this was not possible before that commit.
^^^^^
Nit: Do we really need this line in the commit message? Perhaps we can just drop this?
Quoted 12 lines
Document this behavior as it may be surprising to some.
Signed-off-by Kuba Piecuch <[email protected]>--- Documentation/scheduler/sched-ext.rst | 5 +++++ 1 file changed, 5 insertions(+)Documentation/scheduler/sched-ext.rst +0
-0
Documentation/scheduler/sched-ext.rst The following briefly shows how a waking task is scheduled and executed. · line 346
Quoted 8 lines
Documentation/scheduler/sched-ext.rst +5
-0@@ -339,6 +339,11 @@ The following briefly shows how a waking task is scheduled and executed. leaves (e.g., when ``ops.dispatch()`` moves it to a terminal DSQ, or on property change / sleep). + Note that ``ops.enqueue()`` can be called multiple times in a row without + an intervening call to ``ops.dequeue()``. This can happen, for example, + when a task on a user-created DSQ is re-enqueued using + ``scx_bpf_dsq_reenq()``. The task stays in BPF custody the entire time. +
Thanks for adding and clarifying this. ^v^
Quoted 6 lines
Documentation/scheduler/sched-ext.rst +0
-0When a task leaves BPF scheduler custody, ``ops.dequeue()`` is invoked. The dequeue can happen for different reasons, distinguished by flags:Signature · 1 line
2.54.0.rc1.555.g9c883467ad-goog
Signature · 2 lines
Cheers, Cheng-Yang
Hi Cheng-Yang,
Quoted 11 lines · Cheng-Yang Chou
Hi Kuba,
Quoted 5 lines · Kuba Piecuch
Commit
84b1a0ea0b7c
("sched_ext: Implementscx_bpf_dsq_reenq()for user DSQs") introduced the possibility ofops.enqueue()being called multiple times in a row for the same task without intervening calls toops.dequeue(). AFAIK this was not possible before that commit.^^^^^
Nit: Do we really need this line in the commit message? Perhaps we can just drop this?
I put it there just in case someone was actually aware of a scenario before that commit where we can have multiple ops.enqueue() calls in a row.
Regarding removing the line: yeah, I guess it's a bit redundant. I'll send a v2.
Quoted 24 lines
Quoted 13 lines
Document this behavior as it may be surprising to some.
Signed-off-by Kuba Piecuch <[email protected]>--- Documentation/scheduler/sched-ext.rst | 5 +++++ 1 file changed, 5 insertions(+)Documentation/scheduler/sched-ext.rst +0
-0Documentation/scheduler/sched-ext.rst The following briefly shows how a waking task is scheduled and executed. · line 346
Quoted 8 lines
Documentation/scheduler/sched-ext.rst +5
-0@@ -339,6 +339,11 @@ The following briefly shows how a waking task is scheduled and executed. leaves (e.g., when ``ops.dispatch()`` moves it to a terminal DSQ, or on property change / sleep). + Note that ``ops.enqueue()`` can be called multiple times in a row without + an intervening call to ``ops.dequeue()``. This can happen, for example, + when a task on a user-created DSQ is re-enqueued using + ``scx_bpf_dsq_reenq()``. The task stays in BPF custody the entire time. +Thanks for adding and clarifying this. ^v^
Quoted 2 lines
Acked-by Cheng-Yang Chou <[email protected]>
Thanks,
Kuba
Hi Kuba,
Quoted 11 lines · Kuba Piecuch
Hi Cheng-Yang,
Quoted 8 lines · Cheng-Yang Chou
Hi Kuba,
Quoted 5 lines · Kuba Piecuch
Commit
84b1a0ea0b7c
("sched_ext: Implementscx_bpf_dsq_reenq()for user DSQs") introduced the possibility ofops.enqueue()being called multiple times in a row for the same task without intervening calls toops.dequeue(). AFAIK this was not possible before that commit.
Quoted 6 lines
Quoted 3 lines
^^^^^
Nit: Do we really need this line in the commit message? Perhaps we can just drop this?I put it there just in case someone was actually aware of a scenario before that commit where we can have multiple
ops.enqueue()calls in a row.
I see, thanks!
Quoted 33 lines
Regarding removing the line: yeah, I guess it's a bit redundant. I'll send a v2.
Quoted 24 lines
Quoted 13 lines
Document this behavior as it may be surprising to some.
Signed-off-by Kuba Piecuch <[email protected]>--- Documentation/scheduler/sched-ext.rst | 5 +++++ 1 file changed, 5 insertions(+)Documentation/scheduler/sched-ext.rst +0
-0Documentation/scheduler/sched-ext.rst The following briefly shows how a waking task is scheduled and executed. · line 346
Quoted 8 lines
Documentation/scheduler/sched-ext.rst +5
-0@@ -339,6 +339,11 @@ The following briefly shows how a waking task is scheduled and executed. leaves (e.g., when ``ops.dispatch()`` moves it to a terminal DSQ, or on property change / sleep). + Note that ``ops.enqueue()`` can be called multiple times in a row without + an intervening call to ``ops.dequeue()``. This can happen, for example, + when a task on a user-created DSQ is re-enqueued using + ``scx_bpf_dsq_reenq()``. The task stays in BPF custody the entire time. +Thanks for adding and clarifying this. ^v^
Quoted 2 lines
Acked-by Cheng-Yang Chou <[email protected]>Thanks,
Kuba
Signature · 2 lines
Cheers, Cheng-Yang