Re: running get_user_pages() from kernel thread

From: Rik van Riel
Date: Tue Jun 16 2009 - 17:16:33 EST


Johannes Weiner wrote:
On Tue, Jun 16, 2009 at 07:38:39PM +0100, Hugh Dickins wrote:

--- 2.6.30-mm1/mm/thrash.c 2007-07-09 00:32:17.000000000 +0100
+++ linux/mm/thrash.c 2009-06-15 19:44:53.000000000 +0100
@@ -30,6 +30,9 @@ void grab_swap_token(void)
{
int current_interval;
+ if (!current->mm) /* kthread doing get_user_pages on an mm */
+ return;
+

Did you have a particular reason not to pass in the faulting mm
instead?

If the task itself is not swapping, should we really give
it the swap token?

I admit, this could be a pretty weak reason :)

--
All rights reversed.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/