Thread (73 messages) 73 messages, 9 authors, 2018-09-14

Re: [RFC PATCH v3 12/24] x86/mm: Modify ptep_set_wrprotect and pmdp_set_wrprotect for _PAGE_DIRTY_SW

From: Dave Hansen <dave.hansen@linux.intel.com>
Date: 2018-09-14 21:33:43
Also in: linux-api, linux-doc, linux-mm, lkml

On 09/14/2018 02:08 PM, Yu-cheng Yu wrote:
On Fri, 2018-09-14 at 13:46 -0700, Dave Hansen wrote:
quoted
On 09/14/2018 01:39 PM, Yu-cheng Yu wrote:
quoted
With the updated ptep_set_wrprotect() below, I did MADV_WILLNEED to a shadow
stack of 8 MB, then 10,000 fork()'s, but could not prove it is more or less
efficient than the other.  So can we say this is probably fine in terms of
efficiency?
BTW, I wasn't particularly concerned about shadow stacks.  Plain old
memory is affected by this change too.  Right?
quoted
Well, the first fork() will do all the hard work.  I don't think
subsequent fork()s will be affected.
Are you talking about a recent commit:

    1b2de5d0 mm/cow: don't bother write protecting already write-protected pages

With that, subsequent fork()s will not do all the hard work.
However, I have not done that for shadow stack PTEs (do we want to do that?).
I think the additional benefit for shadow stack is small?
You're right.  mprotect() doesn't use this path.

But, that reminds me, can you take a quick look at change_pte_range()
and double-check that it's not affected by this issue?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help