[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.11.2106031954570.12760@eggly.anvils>
Date: Thu, 3 Jun 2021 20:14:31 -0700 (PDT)
From: Hugh Dickins <hughd@...gle.com>
To: Alistair Popple <apopple@...dia.com>
cc: Peter Xu <peterx@...hat.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Axel Rasmussen <axelrasmussen@...gle.com>,
"Kirill A . Shutemov" <kirill@...temov.name>,
Hugh Dickins <hughd@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Miaohe Lin <linmiaohe@...wei.com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Jerome Glisse <jglisse@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Nadav Amit <nadav.amit@...il.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v3 04/27] mm/userfaultfd: Introduce special pte for
unmapped file-backed mem
On Fri, 4 Jun 2021, Alistair Popple wrote:
>
> The detail which is perhaps less important is whether to implement this using
> a new swap entry type or arch-specific swap bit. The argument for using a swap
> type is it will work across architectures due to the use of pte_to_swp_entry()
> and swp_entry_to_pte() to convert to and from the arch-dependent and
> independent representations.
>
> The argument against seems to have been that it is wasting a swap type.
> However if I'm understanding correctly that's not true for all architectures,
> and needing to reserve a bit is more wasteful than using a swap type.
I'm on the outside, not paying much attention here,
but thought Peter would have cleared this up already.
My understanding is that it does *not* use an additional arch-dependent
bit, but puts the _PAGE_UFFD_WP bit (already set aside by any architecture
implementing UFFD WP) to an additional use. That's why I called this
design (from Andrea) more elegant than mine (swap type business).
If I've got that wrong, and yet another arch-dependent bit is needed,
then I very much agree with you: finding arch-dependent pte bits is a
much tougher job than another play with swap type.
(And "more elegant" might not be "easier to understand": you decide.)
Hugh
Powered by blists - more mailing lists