This is a hack to ensure that we will swap in processes even if one
domain is depleted (belongs to vm_min_domains). Add a domain selection
policy to kstack objects to ensure that we will attempt allocations from
all domains during a swapin.
Details
Peter is testing the patch.
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 19780 Build 19333: arc lint + arc unit
Event Timeline
sys/vm/vm_object.c | ||
---|---|---|
277 | We currently don't appear to do any initialization of the domainset ref, so I think we're relying on it being zeroed upon import into the object zone. |
sys/vm/vm_glue.c | ||
---|---|---|
395 | So this is necessary because the thread policy may not allow a given domain but we want to be able to swap? Long term it would be nice if kstacks and user policy lined up but for now I'm fine with fixing the issue this way. |
sys/vm/vm_glue.c | ||
---|---|---|
395 | Exactly. We could instead compute the intersection of the domainsets for all threads in a process, and allow swap-in if that intersection is not a subset of vm_min_domains. |
sys/vm/vm_glue.c | ||
---|---|---|
395 | ... it should also be noted that the kstack may be cached and reused after a thread exits; some more work would be needed to ensure that a thread's kstack is always allocated using the thread's domain selection policy. |
I'm testing this patch against r338924 on the same EYPC 7551P 32core system used for testing against D17059.
NUMA enabled system work with this patch, but it feels like they still swap processes a lot faster (probably as soon as one NUMA domain is under memory pressure).
Yes, that's true. I will revisit this once the current round of bugs has been addressed.
sys/vm/vm_glue.c | ||
---|---|---|
319–321 | Doesn't this need to account for empty domains? |
sys/vm/vm_glue.c | ||
---|---|---|
319–321 | Indeed. I'm working on a patch set to address some of the NUMA lowmem issues, and have rewritten this part of the diff in the process. I'll be uploading the patches later today. Instead, I define a static array domainset_prefer[MAXMEMDOM], which gets initialized early during boot (after SRAT is parsed and before vm_page_startup() is called). These sets get added to cpuset_domains, and later during boot we update the global domainsets in this list to exclude empty domains. |
sys/vm/vm_glue.c | ||
---|---|---|
319–321 | err, we're not using domainset_prefer[] here, but another global domainset, domainset_roundrobin. |
sys/vm/vm_glue.c | ||
---|---|---|
396 | This will change to DOMAINSET_RR(), yes? | |
sys/vm/vm_swapout.c | ||
745 | The word "global" by itself here doesn't clearly describe the desired condition. It has too many possible interpretations. I would suggest a more precise statement: * - there exists at least one domain that is not suffering from a shortage of free memory; |
sys/vm/vm_glue.c | ||
---|---|---|
396 | Right, I just haven't re-uploaded the patch. |