lkml.org 
[lkml]   [2018]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm -v2] mm, swap, frontswap: Fix THP swap if frontswap enabled
On (02/07/18 13:05), Andrew Morton wrote:
[..]
> hm. This is assuming that "cluster==true" means "this is thp swap".
> That's presently true, but is it appropriate that get_swap_pages() is
> peeking at "cluster" to work out why it is being called?
>
> Or would it be cleaner to do this in get_swap_page()? Something like
>
> --- a/mm/swap_slots.c~a
> +++ a/mm/swap_slots.c
> @@ -317,8 +317,11 @@ swp_entry_t get_swap_page(struct page *p
> entry.val = 0;
>
> if (PageTransHuge(page)) {
> - if (IS_ENABLED(CONFIG_THP_SWAP))
> - get_swap_pages(1, true, &entry);
> + /* Frontswap doesn't support THP */
> + if (!frontswap_enabled()) {
> + if (IS_ENABLED(CONFIG_THP_SWAP))
> + get_swap_pages(1, true, &entry);
> + }
> return entry;
> }

I have proposed exactly the same thing [1], Minchan commented that
it would introduce frontswap dependency to swap_slots.c [2]. Which
is true, but I'd still probably prefer to handle it all in
get_swap_page. Minchan, any objections?

[1] https://marc.info/?l=linux-mm&m=151791052007719&w=2
[2] https://marc.info/?l=linux-mm&m=151792646812617&w=2

-ss

\
 
 \ /
  Last update: 2018-02-08 02:37    [W:0.098 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site