Skip to contentSkip to conversation

use __GFP_NOKILL in fd chunk allocation

PATCH In review William Lee Irwin III 1 participant 1 message Sep 26, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 8/13 use __GFP_NOKILL in fd chunk allocation

The fdchunks are allocated in sys_poll() in response to a system call whose allocations may be failed.

fs/select.c +2 -2
diff -urN linux-2.5.33/fs/select.c linux-2.5.33-mm5/fs/select.c
@@ -447,14 +447,14 @@
 	nchunks = 0;
 	nleft = nfds;
 	while (nleft > POLLFD_PER_PAGE) { /* allocate complete PAGE_SIZE chunks */
-		fds[nchunks] = (struct pollfd *)__get_free_page(GFP_KERNEL);
+		fds[nchunks] = (struct pollfd *)__get_free_page(GFP_KERNEL | __GFP_NOKILL);
 		if (fds[nchunks] == NULL)
 			goto out_fds;
 		nchunks++;
 		nleft -= POLLFD_PER_PAGE;
 	}
 	if (nleft) { /* allocate last PAGE_SIZE chunk, only nleft elements used */
-		fds[nchunks] = (struct pollfd *)__get_free_page(GFP_KERNEL);
+		fds[nchunks] = (struct pollfd *)__get_free_page(GFP_KERNEL | __GFP_NOKILL);
 		if (fds[nchunks] == NULL)
 			goto out_fds;
 	}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/