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]
Message-ID: <5A158D22.3040609@cs.rutgers.edu>
Date:   Wed, 22 Nov 2017 09:43:46 -0500
From:   Zi Yan <zi.yan@...rutgers.edu>
To:     Michal Hocko <mhocko@...nel.org>
CC:     Zi Yan <zi.yan@...t.com>,
        Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
        Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Andrea Reale <ar@...ux.vnet.ibm.com>,
        Jérôme Glisse <jglisse@...hat.com>,
        stable@...r.kernel.org
Subject: Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()



Michal Hocko wrote:
> On Wed 22-11-17 09:54:16, Michal Hocko wrote:
>> On Mon 20-11-17 21:18:55, Zi Yan wrote:
> [...]
>>> diff --git a/include/linux/migrate.h b/include/linux/migrate.h
>>> index 895ec0c4942e..a2246cf670ba 100644
>>> --- a/include/linux/migrate.h
>>> +++ b/include/linux/migrate.h
>>> @@ -54,7 +54,7 @@ static inline struct page *new_page_nodemask(struct page *page,
>>>  	new_page = __alloc_pages_nodemask(gfp_mask, order,
>>>  				preferred_nid, nodemask);
>>>  
>>> -	if (new_page && PageTransHuge(page))
>>> +	if (new_page && PageTransHuge(new_page))
>>>  		prep_transhuge_page(new_page);
>> I would keep the two checks consistent. But that leads to a more
>> interesting question. new_page_nodemask does
>>
>> 	if (thp_migration_supported() && PageTransHuge(page)) {
>> 		order = HPAGE_PMD_ORDER;
>> 		gfp_mask |= GFP_TRANSHUGE;
>> 	}
> 
> And one more question/note. Why do we need thp_migration_supported
> in the first place? 9c670ea37947 ("mm: thp: introduce
> CONFIG_ARCH_ENABLE_THP_MIGRATION") says
> : Introduce CONFIG_ARCH_ENABLE_THP_MIGRATION to limit thp migration
> : functionality to x86_64, which should be safer at the first step.
> 
> but why is unsafe to enable the feature on other arches which support
> THP? Is there any plan to do the next step and remove this config
> option?

Because different architectures have their own way of specifying a swap
entry. This means, to support THP migration, each architecture needs to
add its own __pmd_to_swp_entry() and __swp_entry_to_pmd(), which are
used for arch-independent pmd_to_swp_entry() and swp_entry_to_pmd().

We need this CONFIG_ARCH_ENABLE_THP_MIGRATION before archs that support
THP add code for pmd swap entry.

-- 
Best Regards,
Yan Zi


Download attachment "signature.asc" of type "application/pgp-signature" (538 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ