Thread (59 messages) 59 messages, 6 authors, 2021-01-27

Re: [PATCH v17 11/26] x86/mm: Update ptep_set_wrprotect() and pmdp_set_wrprotect() for transition from _PAGE_DIRTY to _PAGE_COW

From: Yu, Yu-cheng <hidden>
Date: 2021-01-25 22:20:37
Also in: linux-arch, linux-doc, linux-mm, lkml

On 1/25/2021 1:55 PM, Borislav Petkov wrote:
On Mon, Jan 25, 2021 at 01:27:51PM -0800, Yu, Yu-cheng wrote:
quoted
quoted
Maybe I'm missing something but those two can happen outside of the
loop, no? Or is *ptep somehow changing concurrently while the loop is
doing the CMPXCHG and you need to recreate it each time?

IOW, you can generate upfront and do the empty loop...
*ptep can change concurrently.
Care to elaborate?
For example, when a thread reads a W=1, D=0 PTE and before changing it 
to W=0,D=0, another thread could have written to the page and the PTE is 
W=1, D=1 now.  When try_cmpxchg() detects the difference, old_pte is 
read again.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help