Page MenuHomeFreeBSD

Fix logic in domainset_empty_vm().
ClosedPublic

Authored by markj on Aug 26 2019, 5:14 PM.
Tags
None
Referenced Files
F106166111: D21420.diff
Thu, Dec 26, 11:41 AM
Unknown Object (File)
Fri, Dec 13, 2:27 PM
Unknown Object (File)
Thu, Dec 5, 7:50 AM
Unknown Object (File)
Nov 14 2024, 12:49 PM
Unknown Object (File)
Sep 27 2024, 3:22 PM
Unknown Object (File)
Sep 26 2024, 9:40 PM
Unknown Object (File)
Sep 24 2024, 10:09 AM
Unknown Object (File)
Sep 17 2024, 3:59 PM
Subscribers

Details

Summary
  • Don't add 1 to the result of DOMAINSET_FLS(). It uses 1-indexing already.
  • If a domainset consists entirely of empty domains, return true without modifying the set. Otherwise it is impossible to use DOMAINSET_FIXED reliably in kernel code.
  • Always flatten a _PREFER policy to _ROUNDROBIN if the preferred domain is empty. Previously we were doing this only when ds_cnt > 1 after removing empty domains.
Test Plan

On a 2-socket system:

  • I set hw.physmem to avoid using memory attached to domain 1, and verified that we can boot.
  • I removed the DIMMs attached to socket 0, and verified that the system boots and that all system memory is associated with domain 1.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26115
Build 24635: arc lint + arc unit

Event Timeline

markj edited the test plan for this revision. (Show Details)
markj added reviewers: kib, alc, jeff, dougm.

Should there be a followup to restore _FIXED in amd64/mp_machdep.c after this commit ?

sys/kern/kern_cpuset.c
503–514

Is this DOMAINSET_NAND ?

In D21420#466169, @kib wrote:

Should there be a followup to restore _FIXED in amd64/mp_machdep.c after this commit ?

I don't think so: the allocations must succeed, so if _FIXED is used there must be a fallback to RR if the allocation fails. But this is exactly the semantics provided by _PREF, so we might as well just use _PREF.

In general, _FIXED is dangerous since a M_WAITOK+_FIXED allocation will wait forever if the domain is empty. Any users should ensure that some upper layer specifies M_NOWAIT, as in uma allocf implementations.

This revision is now accepted and ready to land.Aug 26 2019, 8:19 PM
hselasky added a subscriber: hselasky.

This fixes boot issues with DELL PowerEdge R620 BIOS v2.7.0.

This revision was automatically updated to reflect the committed changes.
head/sys/kern/kern_cpuset.c
479 ↗(On Diff #61354)

Isn't this another instance of one of the mistakes that you fixed in domainset_empty_vm()?

head/sys/kern/kern_cpuset.c
479 ↗(On Diff #61354)

Thanks, I will fix it.