[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <80984553-a2b9-46b4-acdc-f7abba3c755f@redhat.com>
Date: Mon, 20 Jan 2025 09:46:20 +0100
From: David Hildenbrand <david@...hat.com>
To: Miaohe Lin <linmiaohe@...wei.com>, Wupeng Ma <mawupeng1@...wei.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
Subject: Re: [PATCH v2 1/3] mm: memory-failure: update ttu flag inside
unmap_poisoned_folio
On 20.01.25 08: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.
I'm also wondering, if in do_migrate_range(), we want to
pr_warn_ratelimit() in case still mapped after the call. IIUC, we don't
really expect this to happen with SYNC set.
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists