Re: running get_user_pages() from kernel thread

Rik van Riel
2009-06-16T21:16:29Z

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.