Re: [PATCH 04/14] mm,migration: Allow the migration ofPageSwapCache pages

From: KAMEZAWA Hiroyuki
Date: Thu Apr 22 2010 - 06:35:17 EST


On Thu, 22 Apr 2010 19:13:12 +0900
Minchan Kim <minchan.kim@xxxxxxxxx> wrote:

> On Thu, Apr 22, 2010 at 6:46 PM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

> > Hmm..in my test, the case was.
> >
> > Before try_to_unmap:
> > Â Â Â Âmapcount=1, SwapCache, remap_swapcache=1
> > After remap
> > Â Â Â Âmapcount=0, SwapCache, rc=0.
> >
> > So, I think there may be some race in rmap_walk() and vma handling or
> > anon_vma handling. migration_entry isn't found by rmap_walk.
> >
> > Hmm..it seems this kind patch will be required for debug.
>
> I looked do_swap_page, again.
> lock_page is called long after migration_entry_wait.
> It means lock_page can't close the race.
>
> So I think this BUG is possible.
> What do you think?
>

I think it's not a problem.
When migration-entry-wait is called, enry_wait() does

pte_lock();
check migration_pte
check it's locked.

And after wait_on_page_locked(), it just returns to user and cause
page fault again.

Thanks,
-Kame

--
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/