Re: [v4][PATCH 2/6] mm: swap: make 'struct page' and swp_entry_tvariants of swapcache_free().
From: Dave Hansen
Date: Mon Jun 03 2013 - 11:55:15 EST
On 06/02/2013 11:13 PM, Minchan Kim wrote:
> I lost from this description.
> Old behavior
> New behavior
> So you removes a swap_address_space, not adding a extra call.
> Am I missing something?
I think I got the page->swp_entry_t lookup confused with the
page->swap_address_space lookup when I was writing the description. The
bit that you missed is that I _added_ a page_mapping() call, which calls
New description (last paragraph changed). Andrew, I'll resend the
series since there are a few of these cleanups.
From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
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
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
That leaves all the other callers doing
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 calls
swap_address_space() via page_mapping() instead of calling
swap_address_space() directly. In doing so, it removes one more
case of the swap cache code being special-cased, which is a good
thing in my book.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/