lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 20 May 2020 17:54:46 -0700
From:   Andrew Morton <>
To:     maobibo <>
Cc:     Thomas Bogendoerfer <>,
        Jiaxun Yang <>,
        Huacai Chen <>,
        Paul Burton <>,
        Dmitry Korotin <>,
        Philippe Mathieu-Daudé <>,
        Stafford Horne <>,
        Steven Price <>,
        Anshuman Khandual <>,,,
        Mike Rapoport <>,
        Sergei Shtylyov <>,
        "Maciej W. Rozycki" <>,,
        David Hildenbrand <>
Subject: Re: [PATCH v4 2/4] mm/memory.c: Update local TLB if PTE entry

On Wed, 20 May 2020 14:39:13 +0800 maobibo <> wrote:

> > I'm still worried about the impact on other architectures.  The
> > additional update_mmu_cache() calls won't occur only when multiple
> > threads are racing against the same page, I think?  For example,
> > insert_pfn() will do this when making a read-only page a writable one.
> How about defining ptep_set_access_flags function like this on mips system?
> which is the same on riscv platform.
> static inline int ptep_set_access_flags(struct vm_area_struct *vma,
> 					unsigned long address, pte_t *ptep,
> 					pte_t entry, int dirty)
> {
> 	if (!pte_same(*ptep, entry))
> 		set_pte_at(vma->vm_mm, address, ptep, entry);
> 	/*
> 	 * update_mmu_cache will unconditionally execute, handling both
> 	 * the case that the PTE changed and the spurious fault case.
> 	 */
> 	return true;
> }

hm, it seems a bit abusive - ptep_set_access_flags() is supposed to
return true if the pte changed, and that isn't the case here.

I suppose we could run update_mmu_cache() directly from
ptep_set_access_flags() if we're about to return false, but that
doesn't seem a lot nicer?

> > Would you have time to add some instrumentation into update_mmu_cache()
> > (maybe a tracepoint) and see what effect this change has upon the
> > frequency at which update_mmu_cache() is called for a selection of
> > workloads?  And add this info to the changelog to set minds at ease?
> OK, I will add some instrumentation data in the changelog.

Well, if this testing shows no effect as you expect, perhaps we can
leave the code as-is.

Powered by blists - more mailing lists