Re: [PATCH] sched/fair: Add null pointer check to pick_next_entity()

Peter Zijlstra
2025-04-16T07:59:38Z

On Tue, Apr 15, 2025 at 12:07:05PM +0200, Peter Zijlstra wrote:
> On Mon, Apr 14, 2025 at 11:38:15AM -0400, Chris Mason wrote:
> >
> >
> > On 4/14/25 5:08 AM, Peter Zijlstra wrote:
> >
> > [ math and such ]
> >
> >
> > > The zero_vruntime patch I gave earlier should avoid this particular
> > > issue.
> >
> > Here's a crash with the zero runtime patch.
>
> And indeed it doesn't have these massive (negative) avg_vruntime values.
>
> > I'm trying to reproduce
> > this outside of prod so we can crank up the iteration speed a bit.
>
> Thanks.
>
> Could you add which pick went boom for the next dump?
>
>
>
> I am however, slightly confused by this output format.
>
> It looks like it dumps the cfs_rq the first time it encounters it,
> either through curr or through the tree.
>
> So if I read this correct the root is something like:
>
> > nr_running = 2
> > zero_vruntime = 19194347104893960
> > avg_vruntime = 6044054790
> > avg_load = 2
> > curr = {
> > cgroup urgent
> > vruntime = 24498183812106172
> > weight = 3561684 => 3478
> > }
> > tasks_timeline = [
> > {
> > cgroup optional
> > vruntime = 19194350126921355
> > weight = 1168 => 2
> > },
> > ]
>
> group 19194347104893960
> curr 24498183812106172 3561684
> entity 19194350126921355 1168
>
> But if I run those numbers, I get avg_load == 1, seeing how 1168/1024 =
> 1. But the thing says it should be 2.

N/m, late last night I remembered we have a max(2, ..) in there. So
yeah, your numbers seem right.