lkml.org 
[lkml]   [2009]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH v3 1/6] mm: Don't unmap gup()ed page
On Tue, Apr 14, 2009 at 03:16:52PM +0900, KOSAKI Motohiro wrote:
> + if (PageSwapCache(page) &&
> + page_count(page) != page_mapcount(page) + 2) {
> + ret = SWAP_FAIL;
> + goto out_unmap;
> + }
> +

Besides the race pointed out by Nick, this also would break KVM
swapping with mmu notifier. mmu_notifier_invalidate_page must be
invoked before reading page_count for this to work. However the
invalidate has to be moved below the
mlock/ptep_clear_flush_young_notify, no point to get rid of sptes if
any of the spte or the pte is still young.


\
 
 \ /
  Last update: 2009-04-14 16:43    [from the cache]
©2003-2011 Jasper Spaans