Re: [PATCH 2/9] mm: Simplify the assertions in unuse_pte()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12.12.23 14:52, Matthew Wilcox wrote:
On Tue, Dec 12, 2023 at 01:26:35PM +0100, David Hildenbrand wrote:
On 11.12.23 17:22, Matthew Wilcox (Oracle) wrote:
We should only see anon folios in this function (and there are many
assumptions of that already), so we can simplify these two assertions.

If we swapped in a fresh page, it is not PageAnon before we do the
page_add_anon_rmap() call.

So I'm pretty sure this is wrong.

Argh, yes.

What do you think to just dropping the assertions altogether?  You
added them in 78fbe906cc90 as part of general paranoia about using
an existing flag for a new purpose.  I think they've now served their
purpose and can go away.

At least the ones here, yes. I mean, unuse_pte() is a very corner case feature either way.


Perhaps simply:

	VM_BUG_ON_PAGE(PageAnonExclusive(page), page);

If we refault a page form the swapcache, it would already be PageAnon.

Maybe just drop the assertions completely in unuse_pte().

--
Cheers,

David / dhildenb





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux