svn commit: r266163 - projects/numa/sys/vm
Attilio Rao
attilio at FreeBSD.org
Thu May 15 18:02:08 UTC 2014
Author: attilio
Date: Thu May 15 18:02:08 2014
New Revision: 266163
URL: http://svnweb.freebsd.org/changeset/base/266163
Log:
Use vm_domain_select_next() when needed.
For this we need to define the inlined function a bit earlier.
Modified:
projects/numa/sys/vm/vm_domain.h
Modified: projects/numa/sys/vm/vm_domain.h
==============================================================================
--- projects/numa/sys/vm/vm_domain.h Thu May 15 17:53:42 2014 (r266162)
+++ projects/numa/sys/vm/vm_domain.h Thu May 15 18:02:08 2014 (r266163)
@@ -73,37 +73,37 @@ extern struct vm_domain_select vm_sel_ft
extern struct vm_domain_select vm_sel_dom[MAXMEMDOM]; /* specific domain */
static inline int
-vm_domain_select_first(struct vm_domain_select *sel)
+vm_domain_select_next(struct vm_domain_select *sel, int domain)
{
- int domain;
switch (sel->ds_policy) {
case FIRSTTOUCH:
- domain = PCPU_GET(domain);
- if (VM_DOMAIN_ISSET(domain, &sel->ds_mask))
- break;
/* FALLTHROUGH */
case ROUNDROBIN:
- domain = atomic_fetchadd_int(&sel->ds_cursor, 1) % vm_ndomains;
- while (!VM_DOMAIN_ISSET(domain, &sel->ds_mask))
+ do {
domain = (domain + 1) % vm_ndomains;
+ } while (!VM_DOMAIN_ISSET(domain, &sel->ds_mask));
}
- return (domain);
+ return domain;
}
static inline int
-vm_domain_select_next(struct vm_domain_select *sel, int domain)
+vm_domain_select_first(struct vm_domain_select *sel)
{
+ int domain;
switch (sel->ds_policy) {
case FIRSTTOUCH:
+ domain = PCPU_GET(domain);
+ if (VM_DOMAIN_ISSET(domain, &sel->ds_mask))
+ break;
/* FALLTHROUGH */
case ROUNDROBIN:
- do {
- domain = (domain + 1) % vm_ndomains;
- } while (!VM_DOMAIN_ISSET(domain, &sel->ds_mask));
+ domain = atomic_fetchadd_int(&sel->ds_cursor, 1) % vm_ndomains;
+ if (!VM_DOMAIN_ISSET(domain, &sel->ds_mask))
+ domain = vm_domain_select_next(sel, domain);
}
- return domain;
+ return (domain);
}
#endif /* _KERNEL */
More information about the svn-src-projects
mailing list