Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137929822
D32090.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
D32090.diff
View Options
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
@@ -281,6 +281,7 @@
unsigned long pfn, pgprot_t prot)
{
vm_object_t vm_obj = vma->vm_obj;
+ vm_object_t tmp_obj;
vm_page_t page;
vm_pindex_t pindex;
@@ -296,6 +297,32 @@
page = PHYS_TO_VM_PAGE(IDX_TO_OFF(pfn));
if (!vm_page_busy_acquire(page, VM_ALLOC_WAITFAIL))
goto retry;
+ if (page->object != NULL) {
+ tmp_obj = page->object;
+ vm_page_xunbusy(page);
+ VM_OBJECT_WUNLOCK(vm_obj);
+ VM_OBJECT_WLOCK(tmp_obj);
+ if (page->object == tmp_obj &&
+ vm_page_busy_acquire(page, VM_ALLOC_WAITFAIL)) {
+ KASSERT(page->object == tmp_obj,
+ ("page has changed identity"));
+ KASSERT((page->oflags & VPO_UNMANAGED) == 0,
+ ("page does not belong to shmem"));
+ vm_pager_page_unswapped(page);
+ if (pmap_page_is_mapped(page)) {
+ vm_page_xunbusy(page);
+ VM_OBJECT_WUNLOCK(tmp_obj);
+ printf("%s: page rename failed: page "
+ "is mapped\n", __func__);
+ VM_OBJECT_WLOCK(vm_obj);
+ return (VM_FAULT_NOPAGE);
+ }
+ vm_page_remove(page);
+ }
+ VM_OBJECT_WUNLOCK(tmp_obj);
+ VM_OBJECT_WLOCK(vm_obj);
+ goto retry;
+ }
if (vm_page_insert(page, vm_obj, pindex)) {
vm_page_xunbusy(page);
return (VM_FAULT_OOM);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 28, 9:04 AM (5 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26279491
Default Alt Text
D32090.diff (1 KB)
Attached To
Mode
D32090: LinuxKPI: Allow cdev_pager prefault handler to steal pages from other vm_objects
Attached
Detach File
Event Timeline
Log In to Comment