Re: [PATCH v2 03/10] Change isolate mode from int type to enum type

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

 



On Mon, May 30, 2011 at 03:13:42AM +0900, Minchan Kim wrote:
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -957,23 +957,29 @@ keep_lumpy:
>   *
>   * returns 0 on success, -ve errno on failure.
>   */
> -int __isolate_lru_page(struct page *page, int mode, int file)
> +int __isolate_lru_page(struct page *page, enum ISOLATE_PAGE_MODE mode,
> +							int file)
>  {
> +	int active;
>  	int ret = -EINVAL;
> +	BUG_ON(mode & ISOLATE_BOTH &&
> +		(mode & ISOLATE_INACTIVE || mode & ISOLATE_ACTIVE));
>  
>  	/* Only take pages on the LRU. */
>  	if (!PageLRU(page))
>  		return ret;
>  
> +	active = PageActive(page);
> +
>  	/*
>  	 * When checking the active state, we need to be sure we are
>  	 * dealing with comparible boolean values.  Take the logical not
>  	 * of each.
>  	 */
> -	if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
> +	if (mode & ISOLATE_ACTIVE && !active)
>  		return ret;
>  
> -	if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
> +	if (mode & ISOLATE_INACTIVE && active)
>  		return ret;

What happened to the check for file pages?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  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]