Re: running get_user_pages() from kernel thread

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

Hugh Dickins wrote:

> [PATCH] mm: pass mm to grab_swap_token
>
> If a kthread happens to use get_user_pages() on an mm (as KSM does),
> there's a chance that it will end up trying to read in a swap page,
> then oops in grab_swap_token() because the kthread has no mm: GUP
> passes down the right mm, so grab_swap_token() ought to be using it.
>
> Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>

Provided nobody has a problem with giving the swap token
to a task that isn't actually swapping itself ...

Acked-by: Rik van Riel <riel@redhat.com>

(I don't have any strong opinions either way)

--
All rights reversed.