Re: [RFC] mm: support MIGRATE_DISCARD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rik,

On Fri, Aug 24, 2012 at 11:04:16AM -0400, Rik van Riel wrote:
> On 08/24/2012 12:25 AM, Minchan Kim wrote:
> >This patch introudes MIGRATE_DISCARD mode in migration.
> >It drops *unmapped clean cache pages* instead of migration so that
> 
> Am I confused, or does the code not match the changelog?
> 
> It looks like it is still trying to discard mapped page cache pages:

Embarrassing typo :( "clean cache page" is right.
That includes both mapped/unmapped clean cache pages.

> 
> >+	file = page_is_file_cache(page);
> >+	ttu_flags = TTU_IGNORE_ACCESS;
> >+retry:
> >+	if (!(mode & MIGRATE_DISCARD) || !file || PageDirty(page))
> >+		ttu_flags |= (TTU_MIGRATION | TTU_IGNORE_MLOCK);
> >+	else
> >+		discard_mode = true;
> >+
> >  	/* Establish migration ptes or remove ptes */
> >-	try_to_unmap(page, TTU_MIGRATION|TTU_IGNORE_MLOCK|TTU_IGNORE_ACCESS);
> >+	rc = try_to_unmap(page, ttu_flags);
> >
> >  skip_unmap:
> >-	if (!page_mapped(page))
> >-		rc = move_to_new_page(newpage, page, remap_swapcache, mode);
> >+	if (rc == SWAP_SUCCESS) {
> >+		if (!discard_mode)
> >+			rc = move_to_new_page(newpage, page,
> >+					remap_swapcache, mode);
> >+		else {
> >+
> >+			rc = discard_page(page);
> >+			goto uncharge;
> >+		}
> 
> 
> 
> -- 
> All rights reversed

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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]