[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yxoc5mrIjrh+I5w5@dhcp22.suse.cz>
Date: Thu, 8 Sep 2022 18:48:38 +0200
From: Michal Hocko <mhocko@...e.com>
To: "Kirill A. Shutemov" <kirill@...temov.name>
Cc: Naoya Horiguchi <naoya.horiguchi@...ux.dev>, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Muchun Song <songmuchun@...edance.com>,
Miaohe Lin <linmiaohe@...wei.com>,
Matthew Wilcox <willy@...radead.org>,
Yang Shi <shy828301@...il.com>,
Naoya Horiguchi <naoya.horiguchi@....com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm/huge_memory: use pfn_to_online_page() in
split_huge_pages_all()
On Thu 08-09-22 15:23:03, Kirill A. Shutemov wrote:
[...]
> But it makes me think if there's other similar cases. "page is offline" is
> rather obscure case that rarely covered by routine testing. Otherwise the
> bug would not survive for 6 years.
>
> After quick look, kvm_pfn_to_refcounted_page() looks suspicious.
this one is hard to judge for me. Is this ever used for something that
could be offlined?
> kdb_getphys() too.
this one looks it needs a fix
> Maybe we should make pfn_valid() false for offline pages and introduce
> other check that allows offline pages which can be used in codepaths that
> deal with offline pages explicitly.
Back when pfn_to_online page was introduced altering pfn_valid was
considered but the semantic is not the same. offline pages could be
still pfn_valid. The discussion should be in archives. Sorry do not have
the link handy. We have also considered changing pfn_to_page but that
would add an overhead for unlikely case to everybody. So the conclusion
was that only pfn walkers should care. Most other users just translate
pfn to page when the page cannot be offlined (e.g. because it is
referenced).
I do realize this is fragile but we couldn't come up with something more
clever without introducing overhead all over the place.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists