diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-11 08:30:05 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-11 08:30:05 +0100 |
| commit | 3dba1da360da5071d013fd0fb8839124104390fa (patch) | |
| tree | 6e1efe643077ca559fbf0d6c89ac9358e1f8319e /mm/memory.c | |
| parent | d61adf609c48b9e91a84e9a943f0b3bcd84c3cad (diff) | |
| parent | 7c53f6b671f4aba70ff15e1b05148b10d58c2837 (diff) | |
Merge 5.11-rc3 into staging-next
We need the staging fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/memory.c')
| -rw-r--r-- | mm/memory.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c index 7d608765932b..feff48e1465a 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2892,11 +2892,13 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf) entry = mk_pte(new_page, vma->vm_page_prot); entry = pte_sw_mkyoung(entry); entry = maybe_mkwrite(pte_mkdirty(entry), vma); + /* * Clear the pte entry and flush it first, before updating the - * pte with the new entry. This will avoid a race condition - * seen in the presence of one thread doing SMC and another - * thread doing COW. + * pte with the new entry, to keep TLBs on different CPUs in + * sync. This code used to set the new PTE then flush TLBs, but + * that left a window where the new PTE could be loaded into + * some TLBs while the old PTE remains in others. */ ptep_clear_flush_notify(vma, vmf->address, vmf->pte); page_add_new_anon_rmap(new_page, vma, vmf->address, false); |
