On 03/02/2017 12:09 PM, Minchan Kim wrote: > If the page is mapped and rescue in ttuo, page_mapcount(page) == 0 cannot Nit: "ttuo" is very cryptic. Please expand it. > be true so page_mapcount check in ttu is enough to return SWAP_SUCCESS. > IOW, SWAP_MLOCK check is redundant so remove it. Right, page_mapcount(page) should be enough to tell whether swapping out happened successfully or the page is still mapped in some page table. > > Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx> > --- > mm/rmap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/rmap.c b/mm/rmap.c > index 3a14013..0a48958 100644 > --- a/mm/rmap.c > +++ b/mm/rmap.c > @@ -1523,7 +1523,7 @@ int try_to_unmap(struct page *page, enum ttu_flags flags) > else > ret = rmap_walk(page, &rwc); > > - if (ret != SWAP_MLOCK && !page_mapcount(page)) > + if (!page_mapcount(page)) > ret = SWAP_SUCCESS; > return ret; > } > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>