Page MenuHomeFreeBSD

Dynamically allocate per-cpu scheduler state
AcceptedPublic

Authored by jeff on Feb 24 2019, 2:53 AM.

Details

Reviewers
kib
gallatin
markj
Summary

We want to allocate scheduler state dynamically so that it can be allocated to the correct NUMA domain. This also eliminates a global and statically sized MAXCPU state array.

I added a per-cpu variable to point at dpcpu allocated memory to keep the instruction bloat down. This actually makes TDQ_SELF() more efficient than it was before but TDQ_CPU() is less efficient.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

jeff created this revision.Feb 24 2019, 2:53 AM
kib added a comment.Feb 24 2019, 9:42 AM

Can you re-upload the diff with the full context added, please ?

gallatin accepted this revision.Feb 25 2019, 4:48 PM

Much cleaner, as usual, than the hack I gave you to start with.

This revision is now accepted and ready to land.Feb 25 2019, 4:48 PM
markj accepted this revision.Feb 28 2019, 5:31 PM
In D19315#413467, @kib wrote:

Can you re-upload the diff with the full context added, please ?

+1, it is painful to review diffs without context.

Am I right that in head, dpcpu area allocations are not yet NUMA-affinitized?

kern/sched_ule.c
315

It's called "id" in the definition.

kib added a comment.Feb 28 2019, 6:00 PM

Am I right that in head, dpcpu area allocations are not yet NUMA-affinitized?

Yes, it is just kmem_malloc() in mp_machdep.c:native_start_all_aps().