Re: [RFC PATCH] mm: thp: make swap configurable

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

 



On Mon, Oct 10, 2011 at 09:58:06PM +0800, Bob Liu wrote:
> Currently THP do swap by default, user has no control of it.
> But some applications are swap sensitive, this patch add a boot param
> and sys file to make it configurable.

What's special about THP compared to regular-sized anon pages?

> @@ -155,10 +156,11 @@ int add_to_swap(struct page *page)
>  		return 0;
>  
>  	if (unlikely(PageTransHuge(page)))
> -		if (unlikely(split_huge_page(page))) {
> -			swapcache_free(entry, NULL);
> -			return 0;
> -		}
> +		if(!transparent_hugepage_swap_disable())
> +			if (unlikely(split_huge_page(page))) {
> +				swapcache_free(entry, NULL);
> +				return 0;
> +			}
>  
>  	/*
>  	 * Radix-tree node allocations from PF_MEMALLOC contexts could

That will just prevent the splitting and then add the huge page to the
swap cache, for which it is not prepared.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
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]