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: <6f613668-6cc8-13eb-df81-1bfc3d9e6f22@huawei.com>
Date:   Fri, 18 Mar 2022 14:28:33 +0800
From:   Miaohe Lin <linmiaohe@...wei.com>
To:     David Hildenbrand <david@...hat.com>
CC:     <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        <naoya.horiguchi@....com>, <shy828301@...il.com>,
        <mike.kravetz@...cle.com>
Subject: Re: [PATCH v3 2/2] mm/memory-failure.c: make non-LRU movable pages
 unhandlable

On 2022/3/17 20:11, David Hildenbrand wrote:
> On 18.03.22 08:39, Miaohe Lin wrote:
>> We can not really handle non-LRU movable pages in memory failure. Typically
>> they are balloon, zsmalloc, etc. Assuming we run into a base (4K) non-LRU
>> movable page, we could reach as far as identify_page_state(), it should not
>> fall into any category except me_unknown. For the non-LRU compound movable
>> pages, they could be taken for transhuge pages but it's unexpected to split
>> non-LRU  movable pages using split_huge_page_to_list in memory_failure. So
>> we could just simply make non-LRU  movable pages unhandlable to avoid these
>> possible nasty cases.
>>
>> Suggested-by: Yang Shi <shy828301@...il.com>
>> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
>> Reviewed-by: Yang Shi <shy828301@...il.com>
>> Acked-by: Naoya Horiguchi <naoya.horiguchi@....com>
>> ---
>>  mm/memory-failure.c | 20 +++++++++++++-------
>>  1 file changed, 13 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
>> index ecf45961f3b6..bf14bea2ed93 100644
>> --- a/mm/memory-failure.c
>> +++ b/mm/memory-failure.c
>> @@ -1176,12 +1176,18 @@ void ClearPageHWPoisonTakenOff(struct page *page)
>>   * does not return true for hugetlb or device memory pages, so it's assumed
>>   * to be called only in the context where we never have such pages.
>>   */
>> -static inline bool HWPoisonHandlable(struct page *page)
>> +static inline bool HWPoisonHandlable(struct page *page, unsigned long flags)
>>  {
>> -	return PageLRU(page) || __PageMovable(page) || is_free_buddy_page(page);
>> +	bool movable = false;
>> +
>> +	/* Soft offline could mirgate non-LRU movable pages */
> 
> s/mirgate/migrate/

OK. My mistake.

> 
>> +	if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page))
>> +		movable = true;
> 
> simply "return true" and drop "bool movable".

OK.

> 
>> +
>> +	return movable || PageLRU(page) || is_free_buddy_page(page);
> 

Many thanks for comment!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ