Re: [PATCH v3] sched: reorder some fields in struct rq

From: Blake Jones

Date: Wed Oct 29 2025 - 14:57:08 EST


On Wed, Oct 29, 2025 at 2:14 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> Most places that take rq->lock also update rq->clock. So I was wondering
> if it made sense to put them together. I don't have numbers either.

Makes sense. I think I'll leave it out of this patch since I don't
have numbers for it, but it's an compelling enough idea that I might
try to get some numbers and come back with a followup.

> > The line that I've moved it to has your queue_mask, so that's probably not
> > the best place. How about if I move it to the end of the structure, next to
> > cfsb_csd and cfsb_csd_list, since those don't seem to get used very often?
>
> Works for me.

Great.

> > Well, this is by far one of the hottest kernel data structures we see at
> > Google, and it's not an obvious thing for a security vuln to target. So I'd
> > be quite happy to add __no_randomize_layout; if you agree, I'll add it.
>
> Lets make it so.

Done.

I've made these changes and fleshed out the comment at the top of the
structure a bit more, and I sent the result out as v4:
https://lore.kernel.org/lkml/20251029185458.3040228-1-blakejones@xxxxxxxxxx/T/#u

Thanks.

Blake