[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yqo+NQBbEk1SU0cO@xz-m1.local>
Date: Wed, 15 Jun 2022 16:16:53 -0400
From: Peter Xu <peterx@...hat.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Peter Collingbourne <pcc@...gle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Nadav Amit <nadav.amit@...il.com>,
Dave Hansen <dave.hansen@...el.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Yang Shi <shy828301@...il.com>,
Hugh Dickins <hughd@...gle.com>,
Mel Gorman <mgorman@...hsingularity.net>
Subject: Re: [PATCH v3] mm/mprotect: try avoiding write faults for exclusive
anonymous pages when changing protection
On Wed, Jun 15, 2022 at 09:52:11PM +0200, David Hildenbrand wrote:
> write unprotection is a change from RO->RW, so I don't immediately see
> the difference.
In my view "unprotect a pte" is only a subset of "grant pte write
permission", since: "unprotect" has a prerequisite that it used to be
"protected" so that's why we can unprotect. Aka, in mm term that's only
when VM_WRITE set.
So basically it is a hint that we're only working on VM_WRITE regions,
where I thought "unprotect" was slightly better.
>
> Anyhow, I don't like the sounding of TRY_WRITE_UNPROTECT.
>
> I made it match the function name that I had:
>
> MM_CP_TRY_CHANGE_WRITABLE
> -> !pte_write()?
> -> can_change_pte_writable() ?
> ->pte_mkwrite()
>
> Maybe MM_CP_TRY_MAKE_WRITABLE / MM_CP_TRY_MAKE_PTE_WRITABLE is clearer?
>
> Open for suggestions because I'm apparently not the bast at naming
> things either.
Me neither. I don't have a strong opinion anyway, and frankly indeed the
old naming is not great either to me. Maybe there's better thoughts.
Thanks,
--
Peter Xu
Powered by blists - more mailing lists