lkml.org 
[lkml]   [2018]   [Feb]   [8]   [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/08/18 02:25), Minchan Kim wrote:
[..]
> > > 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?
>
> I didn't want to spread out frontswap stuff unless it has good value
> because most of frontswap functions are located in mm/swapfile.c
> at this moment.

Sure, your points are perfectly valid. At the same time it might be the
case that we already kind of expose that THP dependency thing to vmscan.
The whole

if (!add_to_swap()) {
if (!PageTransHuge(page))
goto activate_locked;

split_huge_page_to_list(page);
add_to_swap(page);
}

looks a bit suspicious - if add_to_swap() fails and the page is THP then
split it and add_to_swap() again.

-ss

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