Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163276873
D56590.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
D56590.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h
--- a/sys/compat/linuxkpi/common/include/linux/gfp.h
+++ b/sys/compat/linuxkpi/common/include/linux/gfp.h
@@ -59,7 +59,7 @@
#define __GFP_WAIT M_WAITOK
#define __GFP_DMA32 (1U << 24) /* LinuxKPI only */
#define __GFP_NORETRY (1U << 25) /* LinuxKPI only */
-#define __GFP_THISNODE (1U << 26) /* Unimplemented */
+#define __GFP_THISNODE (1U << 26)
#define __GFP_BITS_SHIFT 27
#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1)
#define __GFP_NOFAIL M_WAITOK
diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c
--- a/sys/compat/linuxkpi/common/src/linux_page.c
+++ b/sys/compat/linuxkpi/common/src/linux_page.c
@@ -119,10 +119,19 @@
req |= VM_ALLOC_NORECLAIM;
retry:
- page = vm_page_alloc_noobj_contig(req, npages, 0, pmax,
- PAGE_SIZE, 0, VM_MEMATTR_DEFAULT);
+ if ((flags & __GFP_THISNODE) != 0) {
+ int curdomain = PCPU_GET(domain);
+ page = vm_page_alloc_noobj_contig_domain(
+ curdomain, req, npages, 0, pmax,
+ PAGE_SIZE, 0, VM_MEMATTR_DEFAULT);
+ } else {
+ page = vm_page_alloc_noobj_contig(
+ req, npages, 0, pmax,
+ PAGE_SIZE, 0, VM_MEMATTR_DEFAULT);
+ }
+
if (page == NULL) {
- if ((flags & (M_WAITOK | __GFP_NORETRY)) ==
+ if ((flags & (M_WAITOK | __GFP_NORETRY | __GFP_THISNODE)) ==
M_WAITOK) {
int err = vm_page_reclaim_contig(req,
npages, 0, pmax, PAGE_SIZE, 0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 22, 4:12 PM (17 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35371601
Default Alt Text
D56590.diff (1 KB)
Attached To
Mode
D56590: linuxkpi: Implement __GFP_THISNODE in alloc_pages()
Attached
Detach File
Event Timeline
Log In to Comment