Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F116018671
D32036.id95417.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
D32036.id95417.diff
View Options
Index: sys/vm/vm_fault.c
===================================================================
--- sys/vm/vm_fault.c
+++ sys/vm/vm_fault.c
@@ -1080,7 +1080,6 @@
vm_fault_allocate(struct faultstate *fs)
{
struct domainset *dset;
- int alloc_req;
int rv;
if ((fs->object->flags & OBJ_SIZEVNLOCK) != 0) {
@@ -1117,9 +1116,14 @@
/*
* Allocate a new page for this object/offset pair.
*
- * Unlocked read of the p_flag is harmless. At worst, the P_KILLED
- * might be not observed there, and allocation can fail, causing
- * restart and new reading of the p_flag.
+ * If the process has a fatal signal pending, prioritize the allocation
+ * with the expectation that the process will exit shortly and free some
+ * pages. In particular, the signal may have been posted by the page
+ * daemon in an attempt to resolve an out-of-memory condition.
+ *
+ * The unlocked read of the p_flag is harmless. At worst, the P_KILLED
+ * might be not observed there, and allocation can fail, causing restart
+ * and new reading of the p_flag.
*/
dset = fs->object->domain.dr_policy;
if (dset == NULL)
@@ -1128,12 +1132,8 @@
#if VM_NRESERVLEVEL > 0
vm_object_color(fs->object, atop(fs->vaddr) - fs->pindex);
#endif
- alloc_req = P_KILLED(curproc) ?
- VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL;
- if (fs->object->type != OBJT_VNODE &&
- fs->object->backing_object == NULL)
- alloc_req |= VM_ALLOC_ZERO;
- fs->m = vm_page_alloc(fs->object, fs->pindex, alloc_req);
+ fs->m = vm_page_alloc(fs->object, fs->pindex,
+ P_KILLED(curproc) ? VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL);
}
if (fs->m == NULL) {
unlock_and_deallocate(fs);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 2, 4:44 PM (13 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17908162
Default Alt Text
D32036.id95417.diff (1 KB)
Attached To
Mode
D32036: vm_fault: Stop specifying VM_ALLOC_ZERO
Attached
Detach File
Event Timeline
Log In to Comment