Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F138069207
D17425.id48759.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D17425.id48759.diff
View Options
Index: sys/vm/uma_core.c
===================================================================
--- sys/vm/uma_core.c
+++ sys/vm/uma_core.c
@@ -1178,8 +1178,8 @@
}
static void *
-pcpu_page_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag,
- int wait)
+pcpu_page_alloc(uma_zone_t zone, vm_size_t bytes, int domain __unused,
+ uint8_t *pflag, int wait)
{
struct pglist alloctail;
vm_offset_t addr, zkva;
@@ -1196,18 +1196,9 @@
malloc2vm_flags(wait);
*pflag = UMA_SLAB_KERNEL;
for (cpu = 0; cpu <= mp_maxid; cpu++) {
- if (CPU_ABSENT(cpu)) {
- p = vm_page_alloc(NULL, 0, flags);
- } else {
-#ifndef NUMA
- p = vm_page_alloc(NULL, 0, flags);
-#else
- pc = pcpu_find(cpu);
- p = vm_page_alloc_domain(NULL, 0, pc->pc_domain, flags);
- if (__predict_false(p == NULL))
- p = vm_page_alloc(NULL, 0, flags);
-#endif
- }
+ pc = pcpu_find(cpu);
+ p = vm_page_alloc_domainset(NULL, 0,
+ DOMAINSET_PREFER(pc->pc_domain), flags);
if (__predict_false(p == NULL))
goto fail;
TAILQ_INSERT_TAIL(&alloctail, p, listq);
Index: sys/vm/vm_page.h
===================================================================
--- sys/vm/vm_page.h
+++ sys/vm/vm_page.h
@@ -518,6 +518,8 @@
void vm_page_advise(vm_page_t m, int advice);
vm_page_t vm_page_alloc(vm_object_t, vm_pindex_t, int);
vm_page_t vm_page_alloc_domain(vm_object_t, vm_pindex_t, int, int);
+vm_page_t vm_page_alloc_domainset(vm_object_t, vm_pindex_t, struct domainset *,
+ int);
vm_page_t vm_page_alloc_after(vm_object_t, vm_pindex_t, int, vm_page_t);
vm_page_t vm_page_alloc_domain_after(vm_object_t, vm_pindex_t, int, int,
vm_page_t);
Index: sys/vm/vm_page.c
===================================================================
--- sys/vm/vm_page.c
+++ sys/vm/vm_page.c
@@ -1733,6 +1733,24 @@
NULL));
}
+vm_page_t
+vm_page_alloc_domainset(vm_object_t object, vm_pindex_t pindex,
+ struct domainset *ds, int req)
+{
+ struct vm_domainset_iter di;
+ vm_page_t m;
+ int domain;
+
+ vm_domainset_iter_policy_init(&di, ds, &domain, &req);
+ do {
+ m = vm_page_alloc_domain(object, pindex, domain, req);
+ if (m != NULL)
+ break;
+ } while (vm_domainset_iter_policy(&di, &domain) == 0);
+
+ return (m);
+}
+
/*
* Allocate a page in the specified object with the given page index. To
* optimize insertion of the page into the object, the caller must also specifiy
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 29, 3:33 PM (12 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26343310
Default Alt Text
D17425.id48759.diff (2 KB)
Attached To
Mode
D17425: Add vm_page_alloc_domainset().
Attached
Detach File
Event Timeline
Log In to Comment