Re: [PATCH sched_ext/for-7.3-fixes] sched_ext: Generate qseq from a per-task counter
From: Kuba Piecuch
Date: Sat Oct 03 2026 - 07:39:12 EST
Hi Tejun,
On Fri, Oct 02, 2026 at 12:33:27PM -1000, Tejun Heo wrote:
> Maybe wrap the counter where the QSEQ field wraps instead of looping?
>
> p->scx.ops_qseq = ((p->scx.ops_qseq + 1) &
> (SCX_OPSS_QSEQ_MASK >> SCX_OPSS_QSEQ_SHIFT)) ?: 1;
> qseq = (unsigned long)p->scx.ops_qseq << SCX_OPSS_QSEQ_SHIFT;
>
> On 32bit, the shift drops the top two bits of the counter, so the mask is
> what keeps the counter from reaching a value that shifts to 0.
Sounds good, will send a v2 with this change.
Thanks,
Kuba