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:   Fri, 29 Dec 2017 12:36:27 +0100
From:   Michal Hocko <mhocko@...nel.org>
To:     Zi Yan <zi.yan@...rutgers.edu>
Cc:     linux-mm@...ck.org, Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
        "Kirill A. Shutemov" <kirill@...temov.name>,
        Vlastimil Babka <vbabka@...e.cz>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Andrea Reale <ar@...ux.vnet.ibm.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 3/3] mm: unclutter THP migration

On Tue 26-12-17 21:19:35, Zi Yan wrote:
> On 8 Dec 2017, at 11:15, Michal Hocko wrote:
[...]
> > @@ -1394,6 +1390,21 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
> >
> >  			switch(rc) {
> >  			case -ENOMEM:
> > +				/*
> > +				 * THP migration might be unsupported or the
> > +				 * allocation could've failed so we should
> > +				 * retry on the same page with the THP split
> > +				 * to base pages.
> > +				 */
> > +				if (PageTransHuge(page)) {
> > +					lock_page(page);
> > +					rc = split_huge_page_to_list(page, from);
> > +					unlock_page(page);
> > +					if (!rc) {
> > +						list_safe_reset_next(page, page2, lru);
> > +						goto retry;
> > +					}
> > +				}
> 
> The hunk splits the THP and adds all tail pages at the end of the list “from”.
> Why do we need “list_safe_reset_next(page, page2, lru);” here, when page2 is not changed here?

Because we need to handle the case when the page2 was the last on the
list.
 
> And it seems a little bit strange to only re-migrate the head page, then come back to all tail
> pages after migrating the rest of pages in the list “from”. Is it better to split the THP into
> a list other than “from” and insert the list after “page”, then retry from the split “page”?
> Thus, we attempt to migrate all sub pages of the THP after it is split.

Why does this matter?
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ