lkml.org 
[lkml]   [2013]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFCv2][PATCH 2/5] make 'struct page' and swp_entry_t variants of swapcache_free().
On Thu, May 16, 2013 at 01:34:29PM -0700, Dave Hansen wrote:
>
> From: Dave Hansen <dave.hansen@linux.intel.com>
>
> swapcache_free() takes two arguments:
>
> void swapcache_free(swp_entry_t entry, struct page *page)
>
> Most of its callers (5/7) are from error handling paths haven't even
> instantiated a page, so they pass page=NULL. Both of the callers
> that call in with a 'struct page' create and pass in a temporary
> swp_entry_t.
>
> Now that we are deferring clearing page_private() until after
> swapcache_free() has been called, we can just create a variant
> that takes a 'struct page' and does the temporary variable in
> the helper.
>
> That leaves all the other callers doing
>
> swapcache_free(entry, NULL)
>
> so create another helper for them that makes it clear that they
> need only pass in a swp_entry_t.
>
> One downside here is that delete_from_swap_cache() now does
> an extra swap_address_space() call. But, those are pretty
> cheap (just some array index arithmetic).
>
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>

Acked-by: Mel Gorman <mgorman@suse.de>

--
Mel Gorman
SUSE Labs


\
 
 \ /
  Last update: 2013-05-17 16:01    [W:0.062 / U:2.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site