lkml.org 
[lkml]   [2022]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-06-15 22:18    [W:3.402 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site