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: <74b97e70-fa21-28c3-cb51-3a4ffb1b581a@huawei.com>
Date: Tue, 21 Jan 2025 10:46:57 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: David Hildenbrand <david@...hat.com>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
	<akpm@...ux-foundation.org>, <osalvador@...e.de>, <nao.horiguchi@...il.com>,
	<mhocko@...e.com>, Wupeng Ma <mawupeng1@...wei.com>
Subject: Re: [PATCH v2 1/3] mm: memory-failure: update ttu flag inside
 unmap_poisoned_folio

On 2025/1/20 15:49, David Hildenbrand wrote:
> 
>>>       if (folio_test_hugetlb(folio) && !folio_test_anon(folio)) {
>>>           struct address_space *mapping;
>>>   @@ -1572,7 +1598,7 @@ void unmap_poisoned_folio(struct folio *folio, enum ttu_flags ttu)
>>>           if (!mapping) {
>>>               pr_info("%#lx: could not lock mapping for mapped hugetlb folio\n",
>>>                   folio_pfn(folio));
>>> -            return;
>>> +            return -EBUSY;
>>>           }
>>>             try_to_unmap(folio, ttu|TTU_RMAP_LOCKED);
>>> @@ -1580,6 +1606,8 @@ void unmap_poisoned_folio(struct folio *folio, enum ttu_flags ttu)
>>>       } else {
>>>           try_to_unmap(folio, ttu);
>>>       }
>>> +
>>> +    return folio_mapped(folio) ? -EBUSY : 0;
>>
>> Do we really need this return value? It's unused in do_migrate_range().
> 
> I suggested it, because the folio_mapped() is nowadays extremely cheap. It cleans up hwpoison_user_mappings() quite nicely.
> 
> Any particular reason we shouldn't be doing that?

I was trying to keep code more clean (IMO) but no strong opinion.

Thanks.
.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ