Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136962214
D21420.id61313.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21420.id61313.diff
View Options
Index: sys/kern/kern_cpuset.c
===================================================================
--- sys/kern/kern_cpuset.c
+++ sys/kern/kern_cpuset.c
@@ -500,25 +500,31 @@
static bool
domainset_empty_vm(struct domainset *domain)
{
- int i, j, max;
-
- max = DOMAINSET_FLS(&domain->ds_mask) + 1;
- for (i = 0; i < max; i++)
- if (DOMAINSET_ISSET(i, &domain->ds_mask) && VM_DOMAIN_EMPTY(i))
- DOMAINSET_CLR(i, &domain->ds_mask);
+ domainset_t empty;
+ int i, j;
+
+ DOMAINSET_ZERO(&empty);
+ for (i = 0; i < vm_ndomains; i++)
+ if (VM_DOMAIN_EMPTY(i))
+ DOMAINSET_SET(i, &empty);
+ if (DOMAINSET_SUBSET(&empty, &domain->ds_mask))
+ return (true);
+
+ /* Remove empty domains from the set and recompute. */
+ DOMAINSET_NAND(&domain->ds_mask, &empty);
domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask);
- max = DOMAINSET_FLS(&domain->ds_mask) + 1;
- for (i = j = 0; i < max; i++) {
+ for (i = j = 0; i < DOMAINSET_FLS(&domain->ds_mask); i++)
if (DOMAINSET_ISSET(i, &domain->ds_mask))
domain->ds_order[j++] = i;
- else if (domain->ds_policy == DOMAINSET_POLICY_PREFER &&
- domain->ds_prefer == i && domain->ds_cnt > 1) {
- domain->ds_policy = DOMAINSET_POLICY_ROUNDROBIN;
- domain->ds_prefer = -1;
- }
+
+ /* Convert a PREFER policy referencing an empty domain to RR. */
+ if (domain->ds_policy == DOMAINSET_POLICY_PREFER &&
+ DOMAINSET_ISSET(domain->ds_prefer, &empty)) {
+ domain->ds_policy = DOMAINSET_POLICY_ROUNDROBIN;
+ domain->ds_prefer = -1;
}
- return (DOMAINSET_EMPTY(&domain->ds_mask));
+ return (false);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 21, 8:38 PM (19 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25800319
Default Alt Text
D21420.id61313.diff (1 KB)
Attached To
Mode
D21420: Fix logic in domainset_empty_vm().
Attached
Detach File
Event Timeline
Log In to Comment