* [PATCH net v4 0/3] net/sched: act_gate: bound the cycle time and refuse schedule entries shorter than 10 us
@ 2026-11-24 14:12 Jamal Hadi Salim
2026-11-24 14:12 ` [PATCH net v4 2/3] net/sched: act_gate: " Jamal Hadi Salim
0 siblings, 1 reply; 7+ messages in thread
From: Jamal Hadi Salim @ 2026-11-24 14:12 UTC (permalink / raw)
To: netdev
Cc: Jamal Hadi Salim, Jiri Pirko, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Simon Horman,
Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
Alexei Starovoitov, linux-rt-devel, Victor Nogueira,
Edward Adam Davis, Po Liu, Shuah Khan, linux-kselftest, stable,
syzbot+0054fed3dc9085390f51, shaos, sashiko-bot
An act_gate schedule is armed from TCA_GATE_BASE_TIME and
TCA_GATE_CYCLE_TIME, both unchecked u64 attributes that are read into a
signed ktime_t. A cycle time above S64_MAX turns negative on that read
and the cycle arithmetic that follows wraps.
That arms the timer in the past. Every expiry then recomputes the same
past time, so the timer softirq never finishes and the task that
installed the action spins until the watchdog reports a soft lockup.
A schedule entry of a few nanoseconds reaches the same state from the
other direction: the entry interval is the period the hrtimer runs at, so
the handler is always behind its own next expiry and the action holds a
core for as long as it exists.
1/3 cap base_time and cycle_time at KTIME_MAX, and make every
start-time computation saturate instead of wrapping.
2/3 require at least 10 us per schedule entry.
3/3 cover the refusals, the largest accepted base time and cycle time,
and both sides of the interval boundary in the tdc action tests.
Edward Adam Davis posted a v3 that capped cycle_time at S64_MAX and moved
the attribute to NLA_S64. That refuses the reported value but leaves the
invariant to the wrap: base_time is read the same way into the same
arithmetic and stays unbounded, so an accepted pair can still compute a
start the timer was never meant to take. The type change is also
unnecessary; S64_MAX is a fine range for NLA_U64.
Alexei Starovoitov traced the stall to this action on the syzbot thread
and sketched the saturating arithmetic used here:
https://lore.kernel.org/netdev/DN37NBGPJJG9.2DSVDCKS3UYTV@gmail.com/
This series keeps NLA_U64 for both attributes and bounds the computed
start time rather than one input's value. cycle_time = 0 stays accepted:
it means "derive the cycle from the entry intervals".
The 10 us entry floor comes from the measured cost of one expiry rather
than a device's frame time, and 2/3 states the margin it leaves. The
100 us floor proposed for taprio was withdrawn for narrowing working uAPI
and for a margin it never explained; this floor answers both.
Changes in v4:
- Reworked as a three-patch series on the current net tree.
- Bound base_time and cycle_time at KTIME_MAX, keeping NLA_U64.
- Saturating start-time arithmetic, shared with the catch-up path.
- Minimum entry interval, with its measured cost and its tdc coverage.
v1 -> v2: reject an out-of-range cycletime instead of clamping it.
v2 -> v3: move the range check into the netlink policy.
Jamal Hadi Salim (3):
net/sched: act_gate: bound the cycle time and start time arithmetic
net/sched: act_gate: refuse schedule entries shorter than 10 us
selftests: tc-testing: act_gate: cover the new cycle time and interval
limits
net/sched/act_gate.c | 45 +++--
.../tc-testing/tc-tests/actions/gate.json | 189 ++++++++++++++++++
2 files changed, 217 insertions(+), 17 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH net v4 2/3] net/sched: act_gate: refuse schedule entries shorter than 10 us
2026-11-24 14:12 [PATCH net v4 0/3] net/sched: act_gate: bound the cycle time and refuse schedule entries shorter than 10 us Jamal Hadi Salim
@ 2026-11-24 14:12 ` Jamal Hadi Salim
2026-11-24 16:12 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 7+ messages in thread
From: Jamal Hadi Salim @ 2026-11-24 14:12 UTC (permalink / raw)
To: netdev
Cc: Jamal Hadi Salim, Jiri Pirko, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Simon Horman,
Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
linux-rt-devel, Victor Nogueira, Po Liu, stable, sashiko-bot
This is a followup of commit a51c328df310 ("net: qos: introduce a gate
control flow action") as reported by Sashiko.
The issue:
fill_gate_entry() only rejects an interval of zero, but that interval is
the period gate_timer_func() re-arms the hrtimer at, and a few
nanoseconds is below the cost of servicing one expiry: the next is due
before the current one finishes, so the action holds a CPU in the timer
softirq for as long as it exists.
On a 2-vCPU guest, entries of 1 us and below hold 86% to 90% of a core,
2 us holds 61%, and 3 us holds 22%; from 3.5 us on the cost falls to a
few percent and it reaches zero by 100 us.
The Fix:
Require at least 10 us per entry. An act_gate schedule is not tied to a
device, so unlike taprio there is no frame time to derive a bound from;
the bound has to come from the cost of servicing one expiry, with room
for a kernel that services it slower.
On a 2-vCPU guest one expiry costs a few hundred nanoseconds, so 10 us
sits 25 to 50 times above it, and that margin is also what holds on a
debug or PREEMPT_RT kernel where the cost is a few microseconds and a
floor at the 3.5 us knee would slip back in.
That is what the withdrawn 100 us taprio floor got wrong. It refused
schedules that cost a fraction of their own interval, a 250 us cycle
split into four windows among them, on a margin over the measured cost it
never explained. This floor admits those windows and states its margin.
The interval == 0 test is subsumed. A change cannot bypass the floor: a
change carrying a list re-validates every entry, and one without a list
copies entries the running kernel has already accepted.
Some context:
The request that reproduces the cycle-time stall also carries a 1 ns
entry interval. With the cycle time derived from the entries, that alone
sets a 1 ns timer period: the report covers both defects.
Conditions to recreate the bug:
CONFIG_NET_ACT_GATE=y, and CAP_NET_ADMIN in the initial user namespace
(netlink_capable() checks init_user_ns, so a user namespace of its own
does not help), in a new network namespace:
tc actions add action gate index 1 sched-entry close 1
The action is accepted and the CPU running the timer softirq stays busy
for as long as the action exists. An entry of 10 us or more still
installs.
Fixes: a51c328df310 ("net: qos: introduce a gate control flow action")
Reported-by: Sashiko (gemini) <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/tencent_4ED9536B0375C96183B2244CF7709768C605@qq.com
Cc: stable@vger.kernel.org
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
net/sched/act_gate.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c
index 4835f6543901..797562dbde69 100644
--- a/net/sched/act_gate.c
+++ b/net/sched/act_gate.c
@@ -25,6 +25,11 @@ static struct tc_action_ops act_gate_ops;
*/
#define GATE_ENTRIES_MAX 1024U
+/* An entry shorter than this lets the next expiry land before the softirq
+ * servicing the current one can finish, so the timer stays permanently behind.
+ */
+#define GATE_MIN_INTERVAL_NSEC 10000U
+
static ktime_t gate_get_time(struct tcf_gate *gact)
{
ktime_t mono = ktime_get();
@@ -199,8 +204,10 @@ static int fill_gate_entry(struct nlattr **tb, struct tcfg_gate_entry *entry,
if (tb[TCA_GATE_ENTRY_INTERVAL])
interval = nla_get_u32(tb[TCA_GATE_ENTRY_INTERVAL]);
- if (interval == 0) {
- NL_SET_ERR_MSG(extack, "Invalid interval for schedule entry");
+ if (interval < GATE_MIN_INTERVAL_NSEC) {
+ NL_SET_ERR_MSG_FMT(extack,
+ "Entry interval must be at least %u ns",
+ GATE_MIN_INTERVAL_NSEC);
return -EINVAL;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH net v4 2/3] net/sched: act_gate: refuse schedule entries shorter than 10 us
2026-11-24 14:12 ` [PATCH net v4 2/3] net/sched: act_gate: " Jamal Hadi Salim
@ 2026-11-24 16:12 ` Sebastian Andrzej Siewior
2026-11-24 16:58 ` Jamal Hadi Salim
0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-11-24 16:12 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: netdev, Jiri Pirko, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Simon Horman,
Clark Williams, Steven Rostedt, linux-rt-devel, Victor Nogueira,
Po Liu, stable, sashiko-bot
On 2026-11-24 09:12:09 [-0500], Jamal Hadi Salim wrote:
> This is a followup of commit a51c328df310 ("net: qos: introduce a gate
> control flow action") as reported by Sashiko.
>
> The issue:
> fill_gate_entry() only rejects an interval of zero, but that interval is
> the period gate_timer_func() re-arms the hrtimer at, and a few
> nanoseconds is below the cost of servicing one expiry: the next is due
> before the current one finishes, so the action holds a CPU in the timer
> softirq for as long as it exists.
The timer is programmed in the past, fires immediately and hogs the
CPU.
> On a 2-vCPU guest, entries of 1 us and below hold 86% to 90% of a core,
> 2 us holds 61%, and 3 us holds 22%; from 3.5 us on the cost falls to a
> few percent and it reaches zero by 100 us.
>
> The Fix:
> Require at least 10 us per entry. An act_gate schedule is not tied to a
> device, so unlike taprio there is no frame time to derive a bound from;
> the bound has to come from the cost of servicing one expiry, with room
> for a kernel that services it slower.
The 10us sound sane. With enough debug (say kasan, lockdep, …) this
might become tight again.
…
>
> Fixes: a51c328df310 ("net: qos: introduce a gate control flow action")
> Reported-by: Sashiko (gemini) <sashiko-bot@kernel.org>
There is no syzbot report for this?
> Closes: https://sashiko.dev/#/patchset/tencent_4ED9536B0375C96183B2244CF7709768C605@qq.com
> Cc: stable@vger.kernel.org
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> --- a/net/sched/act_gate.c
> +++ b/net/sched/act_gate.c
> @@ -25,6 +25,11 @@ static struct tc_action_ops act_gate_ops;
> */
> #define GATE_ENTRIES_MAX 1024U
>
> +/* An entry shorter than this lets the next expiry land before the softirq
> + * servicing the current one can finish, so the timer stays permanently behind.
> + */
No strong opinion. I leave this here.
| With a too small interval the next timer will be programmed in the past
| and will fire immediately.
> +#define GATE_MIN_INTERVAL_NSEC 10000U
> +
> static ktime_t gate_get_time(struct tcf_gate *gact)
> {
> ktime_t mono = ktime_get();
Sebastian
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net v4 2/3] net/sched: act_gate: refuse schedule entries shorter than 10 us
2026-11-24 16:12 ` Sebastian Andrzej Siewior
@ 2026-11-24 16:58 ` Jamal Hadi Salim
2026-11-24 17:11 ` Jamal Hadi Salim
0 siblings, 1 reply; 7+ messages in thread
From: Jamal Hadi Salim @ 2026-11-24 16:58 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: netdev, Jiri Pirko, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Simon Horman,
Clark Williams, Steven Rostedt, linux-rt-devel, Victor Nogueira,
Po Liu, stable, sashiko-bot
On Tue, Nov 24, 2026 at 11:13 AM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> On 2026-11-24 09:12:09 [-0500], Jamal Hadi Salim wrote:
> > This is a followup of commit a51c328df310 ("net: qos: introduce a gate
> > control flow action") as reported by Sashiko.
> >
> > The issue:
> > fill_gate_entry() only rejects an interval of zero, but that interval is
> > the period gate_timer_func() re-arms the hrtimer at, and a few
> > nanoseconds is below the cost of servicing one expiry: the next is due
> > before the current one finishes, so the action holds a CPU in the timer
> > softirq for as long as it exists.
>
> The timer is programmed in the past, fires immediately and hogs the
> CPU.
>
> > On a 2-vCPU guest, entries of 1 us and below hold 86% to 90% of a core,
> > 2 us holds 61%, and 3 us holds 22%; from 3.5 us on the cost falls to a
> > few percent and it reaches zero by 100 us.
> >
> > The Fix:
> > Require at least 10 us per entry. An act_gate schedule is not tied to a
> > device, so unlike taprio there is no frame time to derive a bound from;
> > the bound has to come from the cost of servicing one expiry, with room
> > for a kernel that services it slower.
>
> The 10us sound sane. With enough debug (say kasan, lockdep, …) this
> might become tight again.
>
Agreed. Unfortunately, there is no way to derive a "good value" here
(it depends on workload, machine, utilization, etc, etc).
poor choice of wording on my part - should probably have said all of
what i said above for precisiness...
Cant wait to see the pedantic nitpicks the sashikos will get about
this. Regardless if this is all they came up with I am not resending.
> …
> >
> > Fixes: a51c328df310 ("net: qos: introduce a gate control flow action")
> > Reported-by: Sashiko (gemini) <sashiko-bot@kernel.org>
>
> There is no syzbot report for this?
>
It's in 1/3
> > Closes: https://sashiko.dev/#/patchset/tencent_4ED9536B0375C96183B2244CF7709768C605@qq.com
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
>
> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> > --- a/net/sched/act_gate.c
> > +++ b/net/sched/act_gate.c
> > @@ -25,6 +25,11 @@ static struct tc_action_ops act_gate_ops;
> > */
> > #define GATE_ENTRIES_MAX 1024U
> >
> > +/* An entry shorter than this lets the next expiry land before the softirq
> > + * servicing the current one can finish, so the timer stays permanently behind.
> > + */
>
> No strong opinion. I leave this here.
>
> | With a too small interval the next timer will be programmed in the past
> | and will fire immediately.
>
see above.
cheers,
jamal
> > +#define GATE_MIN_INTERVAL_NSEC 10000U
> > +
> > static ktime_t gate_get_time(struct tcf_gate *gact)
> > {
> > ktime_t mono = ktime_get();
>
> Sebastian
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net v4 2/3] net/sched: act_gate: refuse schedule entries shorter than 10 us
2026-11-24 16:58 ` Jamal Hadi Salim
@ 2026-11-24 17:11 ` Jamal Hadi Salim
2026-11-27 10:14 ` Matthieu Baerts
0 siblings, 1 reply; 7+ messages in thread
From: Jamal Hadi Salim @ 2026-11-24 17:11 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: netdev, Jiri Pirko, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Simon Horman,
Clark Williams, Steven Rostedt, linux-rt-devel, Victor Nogueira,
Po Liu, stable, sashiko-bot
On Tue, Nov 24, 2026 at 11:58 AM Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>
> On Tue, Nov 24, 2026 at 11:13 AM Sebastian Andrzej Siewior
> <bigeasy@linutronix.de> wrote:
> >
> > On 2026-11-24 09:12:09 [-0500], Jamal Hadi Salim wrote:
> > > This is a followup of commit a51c328df310 ("net: qos: introduce a gate
> > > control flow action") as reported by Sashiko.
> > >
> > > The issue:
> > > fill_gate_entry() only rejects an interval of zero, but that interval is
> > > the period gate_timer_func() re-arms the hrtimer at, and a few
> > > nanoseconds is below the cost of servicing one expiry: the next is due
> > > before the current one finishes, so the action holds a CPU in the timer
> > > softirq for as long as it exists.
> >
> > The timer is programmed in the past, fires immediately and hogs the
> > CPU.
> >
> > > On a 2-vCPU guest, entries of 1 us and below hold 86% to 90% of a core,
> > > 2 us holds 61%, and 3 us holds 22%; from 3.5 us on the cost falls to a
> > > few percent and it reaches zero by 100 us.
> > >
> > > The Fix:
> > > Require at least 10 us per entry. An act_gate schedule is not tied to a
> > > device, so unlike taprio there is no frame time to derive a bound from;
> > > the bound has to come from the cost of servicing one expiry, with room
> > > for a kernel that services it slower.
> >
> > The 10us sound sane. With enough debug (say kasan, lockdep, …) this
> > might become tight again.
> >
>
> Agreed. Unfortunately, there is no way to derive a "good value" here
> (it depends on workload, machine, utilization, etc, etc).
> poor choice of wording on my part - should probably have said all of
> what i said above for precisiness...
And now that you bring this up - this should really have been
targetting net-next not net.
I dont want to resend (unless sashikos find something sinister) - but
Jakub/Paolo consider applying this to net-next instead when the time
comes.
cheers,
jamal
> Cant wait to see the pedantic nitpicks the sashikos will get about
> this. Regardless if this is all they came up with I am not resending.
> > …
> > >
> > > Fixes: a51c328df310 ("net: qos: introduce a gate control flow action")
> > > Reported-by: Sashiko (gemini) <sashiko-bot@kernel.org>
> >
> > There is no syzbot report for this?
> >
>
> It's in 1/3
>
> > > Closes: https://sashiko.dev/#/patchset/tencent_4ED9536B0375C96183B2244CF7709768C605@qq.com
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
> >
> > Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> >
> > > --- a/net/sched/act_gate.c
> > > +++ b/net/sched/act_gate.c
> > > @@ -25,6 +25,11 @@ static struct tc_action_ops act_gate_ops;
> > > */
> > > #define GATE_ENTRIES_MAX 1024U
> > >
> > > +/* An entry shorter than this lets the next expiry land before the softirq
> > > + * servicing the current one can finish, so the timer stays permanently behind.
> > > + */
> >
> > No strong opinion. I leave this here.
> >
> > | With a too small interval the next timer will be programmed in the past
> > | and will fire immediately.
> >
>
> see above.
>
> cheers,
> jamal
>
> > > +#define GATE_MIN_INTERVAL_NSEC 10000U
> > > +
> > > static ktime_t gate_get_time(struct tcf_gate *gact)
> > > {
> > > ktime_t mono = ktime_get();
> >
> > Sebastian
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net v4 2/3] net/sched: act_gate: refuse schedule entries shorter than 10 us
2026-11-24 17:11 ` Jamal Hadi Salim
@ 2026-11-27 10:14 ` Matthieu Baerts
2026-11-27 10:16 ` Jamal Hadi Salim
0 siblings, 1 reply; 7+ messages in thread
From: Matthieu Baerts @ 2026-11-27 10:14 UTC (permalink / raw)
To: Jamal Hadi Salim
Cc: Sebastian Andrzej Siewior, netdev, Jiri Pirko, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Clark Williams, Steven Rostedt, linux-rt-devel,
Victor Nogueira, Po Liu, stable, sashiko-bot
Hi Jamal,
On 24/11/2026 18:11, Jamal Hadi Salim wrote:
> On Tue, Nov 24, 2026 at 11:58 AM Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>>
>> On Tue, Nov 24, 2026 at 11:13 AM Sebastian Andrzej Siewior
>> <bigeasy@linutronix.de> wrote:
>>>
>>> On 2026-11-24 09:12:09 [-0500], Jamal Hadi Salim wrote:
>>>> This is a followup of commit a51c328df310 ("net: qos: introduce a gate
>>>> control flow action") as reported by Sashiko.
>>>>
>>>> The issue:
>>>> fill_gate_entry() only rejects an interval of zero, but that interval is
>>>> the period gate_timer_func() re-arms the hrtimer at, and a few
>>>> nanoseconds is below the cost of servicing one expiry: the next is due
>>>> before the current one finishes, so the action holds a CPU in the timer
>>>> softirq for as long as it exists.
>>>
>>> The timer is programmed in the past, fires immediately and hogs the
>>> CPU.
>>>
>>>> On a 2-vCPU guest, entries of 1 us and below hold 86% to 90% of a core,
>>>> 2 us holds 61%, and 3 us holds 22%; from 3.5 us on the cost falls to a
>>>> few percent and it reaches zero by 100 us.
>>>>
>>>> The Fix:
>>>> Require at least 10 us per entry. An act_gate schedule is not tied to a
>>>> device, so unlike taprio there is no frame time to derive a bound from;
>>>> the bound has to come from the cost of servicing one expiry, with room
>>>> for a kernel that services it slower.
>>>
>>> The 10us sound sane. With enough debug (say kasan, lockdep, …) this
>>> might become tight again.
>>>
>>
>> Agreed. Unfortunately, there is no way to derive a "good value" here
>> (it depends on workload, machine, utilization, etc, etc).
>> poor choice of wording on my part - should probably have said all of
>> what i said above for precisiness...
>
> And now that you bring this up - this should really have been
> targetting net-next not net.
> I dont want to resend (unless sashikos find something sinister) - but
> Jakub/Paolo consider applying this to net-next instead when the time
> comes.
I'm sorry to say that, but a new version might be needed: it looks like
the new tests you added in this series are not passing:
https://github.com/p4tc-dev/tc-executor/blob/storage/artifacts/928799/1-tdc-sh/stdout
It started there:
https://netdev.bots.linux.dev/branch_deltas/net-next-2026-11-26--21-00.html
Or is it due to conflicts with other WIP patches or something missing on
the CI?
pw-bot: cr
Cheers,
Matt
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net v4 2/3] net/sched: act_gate: refuse schedule entries shorter than 10 us
2026-11-27 10:14 ` Matthieu Baerts
@ 2026-11-27 10:16 ` Jamal Hadi Salim
0 siblings, 0 replies; 7+ messages in thread
From: Jamal Hadi Salim @ 2026-11-27 10:16 UTC (permalink / raw)
To: Matthieu Baerts
Cc: Sebastian Andrzej Siewior, netdev, Jiri Pirko, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Clark Williams, Steven Rostedt, linux-rt-devel,
Victor Nogueira, Po Liu, stable, sashiko-bot
On Fri, Nov 27, 2026 at 5:14 AM Matthieu Baerts <matttbe@kernel.org> wrote:
>
> Hi Jamal,
>
> On 24/11/2026 18:11, Jamal Hadi Salim wrote:
> > On Tue, Nov 24, 2026 at 11:58 AM Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> >>
> >> On Tue, Nov 24, 2026 at 11:13 AM Sebastian Andrzej Siewior
> >> <bigeasy@linutronix.de> wrote:
> >>>
> >>> On 2026-11-24 09:12:09 [-0500], Jamal Hadi Salim wrote:
> >>>> This is a followup of commit a51c328df310 ("net: qos: introduce a gate
> >>>> control flow action") as reported by Sashiko.
> >>>>
> >>>> The issue:
> >>>> fill_gate_entry() only rejects an interval of zero, but that interval is
> >>>> the period gate_timer_func() re-arms the hrtimer at, and a few
> >>>> nanoseconds is below the cost of servicing one expiry: the next is due
> >>>> before the current one finishes, so the action holds a CPU in the timer
> >>>> softirq for as long as it exists.
> >>>
> >>> The timer is programmed in the past, fires immediately and hogs the
> >>> CPU.
> >>>
> >>>> On a 2-vCPU guest, entries of 1 us and below hold 86% to 90% of a core,
> >>>> 2 us holds 61%, and 3 us holds 22%; from 3.5 us on the cost falls to a
> >>>> few percent and it reaches zero by 100 us.
> >>>>
> >>>> The Fix:
> >>>> Require at least 10 us per entry. An act_gate schedule is not tied to a
> >>>> device, so unlike taprio there is no frame time to derive a bound from;
> >>>> the bound has to come from the cost of servicing one expiry, with room
> >>>> for a kernel that services it slower.
> >>>
> >>> The 10us sound sane. With enough debug (say kasan, lockdep, …) this
> >>> might become tight again.
> >>>
> >>
> >> Agreed. Unfortunately, there is no way to derive a "good value" here
> >> (it depends on workload, machine, utilization, etc, etc).
> >> poor choice of wording on my part - should probably have said all of
> >> what i said above for precisiness...
> >
> > And now that you bring this up - this should really have been
> > targetting net-next not net.
> > I dont want to resend (unless sashikos find something sinister) - but
> > Jakub/Paolo consider applying this to net-next instead when the time
> > comes.
>
> I'm sorry to say that, but a new version might be needed: it looks like
> the new tests you added in this series are not passing:
>
> https://github.com/p4tc-dev/tc-executor/blob/storage/artifacts/928799/1-tdc-sh/stdout
>
> It started there:
>
> https://netdev.bots.linux.dev/branch_deltas/net-next-2026-11-26--21-00.html
>
> Or is it due to conflicts with other WIP patches or something missing on
> the CI?
>
sorry I broke it - not sure why our system didnt catch it before
sending. I will send and fix the commit log whining from sashiko.
cheers,
jamal
> pw-bot: cr
>
> Cheers,
> Matt
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-27 10:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 14:12 [PATCH net v4 0/3] net/sched: act_gate: bound the cycle time and refuse schedule entries shorter than 10 us Jamal Hadi Salim
2026-11-24 14:12 ` [PATCH net v4 2/3] net/sched: act_gate: " Jamal Hadi Salim
2026-11-24 16:12 ` Sebastian Andrzej Siewior
2026-11-24 16:58 ` Jamal Hadi Salim
2026-11-24 17:11 ` Jamal Hadi Salim
2026-11-27 10:14 ` Matthieu Baerts
2026-11-27 10:16 ` Jamal Hadi Salim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox