lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 3 Jun 2013 17:35:40 +0900
From:	Minchan Kim <minchan@...nel.org>
To:	Dave Hansen <dave@...1.net>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org, mgorman@...e.de,
	tim.c.chen@...ux.intel.com
Subject: Re: [v4][PATCH 4/6] mm: vmscan: break out mapping "freepage" code

On Fri, May 31, 2013 at 11:39:01AM -0700, Dave Hansen wrote:
> 
> From: Dave Hansen <dave.hansen@...ux.intel.com>
> 
> __remove_mapping() only deals with pages with mappings, meaning
> page cache and swap cache.
> 
> At this point, the page has been removed from the mapping's radix
> tree, and we need to ensure that any fs-specific (or swap-
> specific) resources are freed up.
> 
> We will be using this function from a second location in a
> following patch.
> 
> Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
> Acked-by: Mel Gorman <mgorman@...e.de>

Reviewed-by: Minchan Kim <minchan@...nel.org>

Again, a nitpick. Sorry.

> ---
> 
>  linux.git-davehans/mm/vmscan.c |   28 +++++++++++++++++++---------
>  1 file changed, 19 insertions(+), 9 deletions(-)
> 
> diff -puN mm/vmscan.c~free_mapping_page mm/vmscan.c
> --- linux.git/mm/vmscan.c~free_mapping_page	2013-05-30 16:07:51.461115968 -0700
> +++ linux.git-davehans/mm/vmscan.c	2013-05-30 16:07:51.465116144 -0700
> @@ -497,6 +497,24 @@ static int __remove_mapping(struct addre
>  	return 1;
>  }
>  
> +/*
> + * Release any resources the mapping had tied up in
> + * the page.

It could be a one line.


> + */
> +static void mapping_release_page(struct address_space *mapping,
> +				 struct page *page)
> +{
> +	if (PageSwapCache(page)) {
> +		swapcache_free_page_entry(page);
> +	} else {
> +		void (*freepage)(struct page *);
> +		freepage = mapping->a_ops->freepage;
> +		mem_cgroup_uncharge_cache_page(page);
> +		if (freepage != NULL)
> +			freepage(page);
> +	}
> +}
> +
>  static int lock_remove_mapping(struct address_space *mapping, struct page *page)
>  {
>  	int ret;
> @@ -510,15 +528,7 @@ static int lock_remove_mapping(struct ad
>  	if (!ret)
>  		return 0;
>  
> -	if (PageSwapCache(page)) {
> -		swapcache_free_page_entry(page);
> -	} else {
> -		void (*freepage)(struct page *);
> -		freepage = mapping->a_ops->freepage;
> -		mem_cgroup_uncharge_cache_page(page);
> -		if (freepage != NULL)
> -			freepage(page);
> -	}
> +	mapping_release_page(mapping, page);
>  	return ret;
>  }
>  
> _
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>

-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ