On Wed, May 29, 2024 at 3:59 PM Sean Christopherson wrote:
>
> On Wed, May 29, 2024, Yu Zhao wrote:
> > On Wed, May 29, 2024 at 12:05 PM James Houghton
> > wrote:
> > >
> > > Secondary MMUs are currently consulted for access/age information at
> > >
MMU notifiers except at
> eviction time.
>
> Suggested-by: Yu Zhao
> Signed-off-by: James Houghton
This is not what I suggested, and it would have been done in the first
place if it hadn't regressed the non-lockless case.
NAK.
On Wed, May 15, 2024 at 2:45 PM Erhard Furtner wrote:
>
> On Wed, 8 May 2024 20:21:11 +0200
> Erhard Furtner wrote:
>
> > Greetings!
> >
> > Got that on my dual CPU PowerMac G4 DP shortly after boot. This does not
> > happen every time at bootup though:
> >
> > [...]
> > kswapd0: page
On Tue, Jun 27, 2023 at 5:48 AM Aneesh Kumar K V
wrote:
>
> On 6/26/23 10:34 PM, Yu Zhao wrote:
> > On Mon, Jun 26, 2023 at 4:52 AM Aneesh Kumar K V
> > wrote:
> >>
> >> On 6/26/23 1:04 AM, Yu Zhao wrote:
> >>> On Sat, Jun 24, 2023 at 8:54 AM An
On Tue, Jun 20, 2023 at 1:48 AM Nicholas Piggin wrote:
>
> On Sat May 27, 2023 at 9:44 AM AEST, Yu Zhao wrote:
> > Implement kvm_arch_test_clear_young() to support the fast path in
> > mmu_notifier_ops->test_clear_young().
> >
> > It focuses on a simple case, i.e.
On Tue, Jun 20, 2023 at 05:41:57PM +0530, Sachin Sant wrote:
> 6.4.0-rc7-next-20230620 fails to boot on IBM Power LPAR with following
Sorry for hijacking this thread -- I've been seeing another crash on
NV since -rc1 but I haven't had the time to bisect. Just FYI.
[0.814500] BUG: Unable to
On Tue, Jun 20, 2023 at 12:33 AM Nicholas Piggin wrote:
>
> On Sat May 27, 2023 at 9:44 AM AEST, Yu Zhao wrote:
> > KVM page tables are currently not RCU safe against remapping, i.e.,
> > kvmppc_unmap_free_pmd_entry_table() et al. The previous
>
> Minor nit but the &quo
On Fri, Jun 9, 2023 at 3:08 AM Paolo Bonzini wrote:
>
> On 5/27/23 01:44, Yu Zhao wrote:
> > TLDR
> >
> > This patchset adds a fast path to clear the accessed bit without
> > taking kvm->mmu_lock. It can significantly improve the performance of
> > gue
On Fri, Jun 16, 2023 at 9:54 PM Yu Zhao wrote:
>
> On Thu, Jun 15, 2023 at 04:02:43PM -0700, Hugh Dickins wrote:
> > To keep balance in future, __update_tlb() remember to pte_unmap() after
> > pte_offset_map(). This is an odd case, since the caller has already done
>
On Fri, Jun 9, 2023 at 7:04 AM Marc Zyngier wrote:
>
> On Fri, 09 Jun 2023 01:59:35 +0100,
> Yu Zhao wrote:
> >
> > TLDR
> >
> > Apache Spark spent 12% less time sorting four billion random integers
> > twenty times (in ~4 hours) after this patchset [
On Thu, Jun 8, 2023 at 6:59 PM Yu Zhao wrote:
>
> TLDR
>
> Multichase in 64 microVMs achieved 6% more total samples (in ~4 hours) after
> this patchset [1].
>
> Hardware
>
> HOST $ lscpu
> Architecture:x86_64
> CPU op-mode(s):
> but my two naive attempts to clean that up did more harm than good.
>
> Tested-by: Nathan Chancellor
> Signed-off-by: Hugh Dickins
FWIW: Tested-by: Yu Zhao
There is another problem, likely caused by khugepaged, happened multiple times.
But I don't think it's related to your ser
On Wed, Jun 14, 2023 at 04:17:58PM -0700, Nathan Chancellor wrote:
> Hi Hugh,
>
> On Thu, Jun 08, 2023 at 12:17:24PM -0700, Hugh Dickins wrote:
> > Don't make update_mmu_cache() a wrapper around __update_tlb(): call it
> > directly, and use the ptep (or pmdp) provided by the caller, instead of
>
On Tue, Jun 6, 2023 at 2:34 AM Tzung-Bi Shih wrote:
>
> On Fri, May 26, 2023 at 05:44:26PM -0600, Yu Zhao wrote:
> > +/*
> > + * Architectures that implement kvm_arch_test_clear_young() should override
> > + * kvm_arch_has_test_clear_young().
> > + *
> &g
TLDR
Multichase in 64 microVMs achieved 6% more total samples (in ~4 hours) after
this patchset [1].
Hardware
HOST $ lscpu
Architecture:x86_64
CPU op-mode(s):32-bit, 64-bit
Address sizes: 43 bits physical, 48 bits virtual
Byte Order:
TLDR
Apache Spark spent 12% less time sorting four billion random integers twenty
times (in ~4 hours) after this patchset [1].
Hardware
HOST $ lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s):
TLDR
Memcached achieved 10% more operations per second (in ~4 hours) after this
patchset [1].
Hardware
HOST $ lscpu
Architecture: ppc64le
Byte Order: Little Endian
CPU(s):184
On-line CPU(s) list: 0-183
Model name:POWER9 (raw),
On Wed, May 31, 2023 at 5:23 PM Oliver Upton wrote:
>
> On Wed, May 31, 2023 at 05:10:52PM -0600, Yu Zhao wrote:
> > On Wed, May 31, 2023 at 1:28 PM Oliver Upton wrote:
> > > On Tue, May 30, 2023 at 02:06:55PM -0600, Yu Zhao wrote:
> > > > On Tue, May
On Wed, May 31, 2023 at 1:28 PM Oliver Upton wrote:
>
> On Tue, May 30, 2023 at 02:06:55PM -0600, Yu Zhao wrote:
> > On Tue, May 30, 2023 at 1:37 PM Oliver Upton wrote:
> > >
> > > Hi Yu,
> > >
> > > On Sat, May 27, 2023 at 02:13:07PM -0600, Yu Z
On Wed, May 31, 2023 at 1:56 PM Oliver Upton wrote:
>
> Hi Yu,
>
> On Fri, May 26, 2023 at 05:44:30PM -0600, Yu Zhao wrote:
> > Implement kvm_arch_test_clear_young() to support the fast path in
> > mmu_notifier_ops->test_clear_young().
> >
> > It focuse
On Tue, May 30, 2023 at 1:37 PM Oliver Upton wrote:
>
> Hi Yu,
>
> On Sat, May 27, 2023 at 02:13:07PM -0600, Yu Zhao wrote:
> > On Sat, May 27, 2023 at 12:08 PM Oliver Upton
> > wrote:
> > > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/p
On Sat, May 27, 2023 at 12:08 PM Oliver Upton wrote:
>
> Yu,
>
> On Fri, May 26, 2023 at 05:44:29PM -0600, Yu Zhao wrote:
> > Stage2 page tables are currently not RCU safe against unmapping or VM
> > destruction. The previous mmu_notifier_ops members rely on
> >
B after checking PTE young for page
reference" was included so that the comparison is apples to
apples.
https://lore.kernel.org/r/20220706112041.3831-1-21cn...@gmail.com/
Signed-off-by: Yu Zhao
---
Documentation/admin-guide/mm/multigen_lru.rst | 6 +-
include/linux/mmzone.h
kvm->mmu_lock. Complex cases fall back to the existing slow path
where kvm->mmu_lock is then taken.
Signed-off-by: Yu Zhao
---
arch/x86/include/asm/kvm_host.h | 7 +++
arch/x86/kvm/mmu/tdp_mmu.c | 34 +
2 files changed, 41 insertions(+)
diff --g
tdp_mmu_enabled and shadow_accessed_mask are needed to implement
kvm_arch_has_test_clear_young().
Signed-off-by: Yu Zhao
---
arch/x86/include/asm/kvm_host.h | 6 ++
arch/x86/kvm/mmu.h | 6 --
arch/x86/kvm/mmu/spte.h | 1 -
3 files changed, 6 insertions(+), 7
ing
kvm->mmu_lock. Complex cases fall back to the existing slow path
where kvm->mmu_lock is then taken.
Signed-off-by: Yu Zhao
---
arch/powerpc/include/asm/kvm_host.h| 8
arch/powerpc/include/asm/kvm_ppc.h | 1 +
arch/powerpc/kvm/book3s.c | 6 +++
arch/powerpc/kvm
oes not take kvm->mmu_lock. To implement
kvm_arch_test_clear_young() for that path, orphan page tables need to
be freed by RCU.
Unmapping, specifically kvm_unmap_radix(), does not free page tables,
hence not a concern.
Signed-off-by: Yu Zhao
---
arch/powerpc/kvm/book3s_64_mmu_radix.c | 6 +++
kvm->mmu_lock. Complex cases fall back to the existing slow path
where kvm->mmu_lock is then taken.
Signed-off-by: Yu Zhao
---
arch/arm64/include/asm/kvm_host.h | 6 ++
arch/arm64/kvm/mmu.c | 36 +++
2 files changed, 42 insertions(+)
diff --g
: rmap: Don't flush TLB after checking PTE young for page
reference" was included so that the comparison is apples to
apples.
https://lore.kernel.org/r/20220706112041.3831-1-21cn...@gmail.com/
Yu Zhao (10):
mm/kvm: add mmu_notifier_ops->test_clear_young()
mm/kvm: use mmu
u_lock. To implement
kvm_arch_test_clear_young() for that path, unmapped page tables need
to be freed by RCU and kvm_free_stage2_pgd() needs to be after
mmu_notifier_unregister().
Remapping, specifically stage2_free_removed_table(), is already RCU
safe.
Signed-off-by: Yu Zhao
---
arch/arm64/inclu
Replace test_young() and clear_young() with test_clear_young().
Signed-off-by: Yu Zhao
---
include/linux/mmu_notifier.h | 29 ++-
include/trace/events/kvm.h | 15 --
mm/mmu_notifier.c| 42
virt/kvm/kvm_main.c | 54
hen taken.
test_clear_young() can also operate on a range of KVM PTEs
individually according to a bitmap, if the caller provides it.
Signed-off-by: Yu Zhao
---
include/linux/kvm_host.h | 22 +++
include/linux/mmu_notifier.h | 52
mm/mmu_notifier.c
stage2_try_set_pte() and KVM_PTE_LEAF_ATTR_LO_S2_AF are needed to
implement kvm_arch_test_clear_young().
Signed-off-by: Yu Zhao
---
arch/arm64/include/asm/kvm_pgtable.h | 53
arch/arm64/kvm/hyp/pgtable.c | 53
2 files changed, 53
On Thu, Feb 23, 2023 at 1:29 PM Sean Christopherson wrote:
>
> On Thu, Feb 23, 2023, Yu Zhao wrote:
> > On Thu, Feb 23, 2023 at 12:58 PM Sean Christopherson
> > wrote:
> > >
> > > On Thu, Feb 23, 2023, Yu Zhao wrote:
> > > > On Thu, Feb 23, 2023
On Thu, Feb 23, 2023 at 12:58 PM Sean Christopherson wrote:
>
> On Thu, Feb 23, 2023, Yu Zhao wrote:
> > On Thu, Feb 23, 2023 at 12:11 PM Sean Christopherson
> > wrote:
> > >
> > > On Thu, Feb 23, 2023, Yu Zhao wrote:
> > > > > As alluded t
On Thu, Feb 23, 2023 at 12:11 PM Sean Christopherson wrote:
>
> On Thu, Feb 23, 2023, Yu Zhao wrote:
> > On Thu, Feb 23, 2023 at 10:43 AM Sean Christopherson
> > wrote:
> > >
> > > On Thu, Feb 16, 2023, Yu Zhao wrote:
> > > > kswapd (
On Thu, Feb 23, 2023 at 12:21 PM Sean Christopherson wrote:
>
> On Thu, Feb 23, 2023, Yu Zhao wrote:
> > On Thu, Feb 23, 2023 at 11:47 AM Sean Christopherson
> > wrote:
> > >
> > > On Thu, Feb 23, 2023, Yu Zhao wrote:
> > > > On Thu, Feb 23, 2023
On Thu, Feb 23, 2023 at 11:47 AM Sean Christopherson wrote:
>
> On Thu, Feb 23, 2023, Yu Zhao wrote:
> > On Thu, Feb 23, 2023 at 11:24 AM Sean Christopherson
> > wrote:
> > >
> > > On Thu, Feb 23, 2023, Yu Zhao wrote:
> > > > On Thu, Feb 23, 2023
On Thu, Feb 23, 2023 at 11:24 AM Sean Christopherson wrote:
>
> On Thu, Feb 23, 2023, Yu Zhao wrote:
> > On Thu, Feb 23, 2023 at 10:09 AM Sean Christopherson
> > wrote:
> > > > I'll take a look at that series. clear_bit() probably won't cause any
> > >
On Thu, Feb 23, 2023 at 10:43 AM Sean Christopherson wrote:
>
> On Thu, Feb 16, 2023, Yu Zhao wrote:
> > An existing selftest can quickly demonstrate the effectiveness of this
> > patch. On a generic workstation equipped with 128 CPUs and 256GB DRAM:
>
> Not my area o
On Thu, Feb 23, 2023 at 10:14 AM Sean Christopherson wrote:
>
> On Thu, Feb 16, 2023, Yu Zhao wrote:
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index 9c60384b5ae0..1b465df4a93d 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
&
On Thu, Feb 23, 2023 at 10:09 AM Sean Christopherson wrote:
>
> On Wed, Feb 22, 2023, Yu Zhao wrote:
> > On Fri, Feb 17, 2023 at 9:27 AM Sean Christopherson
> > wrote:
> > >
> > > On Thu, Feb 16, 2023, Yu Zhao wrote:
> > > > diff --git a/arc
On Thu, Feb 23, 2023 at 2:03 AM Marc Zyngier wrote:
>
> On Thu, 23 Feb 2023 03:58:47 +0000,
> Yu Zhao wrote:
> >
> > On Fri, Feb 17, 2023 at 2:00 AM Marc Zyngier wrote:
> > >
> > > On Fri, 17 Feb 2023 04:21:28 +,
> > > Yu Zhao wrote:
> &g
On Fri, Feb 17, 2023 at 9:27 AM Sean Christopherson wrote:
>
> On Thu, Feb 16, 2023, Yu Zhao wrote:
> > diff --git a/arch/x86/include/asm/kvm_host.h
> > b/arch/x86/include/asm/kvm_host.h
> > index 6aaae18f1854..d2995c9e8f07 100644
> > --- a/arch/x86/include/asm
I would
> > prefer to be Cc'ed on an entire series (to gather context) than just an
> > individual patch.
>
> +1
>
> >
> > On Thu, Feb 16, 2023 at 09:12:28PM -0700, Yu Zhao wrote:
> > > This patch adds kvm_arch_test_clear_young() for the vast majority of
&g
st an
> individual patch.
Will do. Thank you.
> On Thu, Feb 16, 2023 at 09:12:28PM -0700, Yu Zhao wrote:
> > This patch adds kvm_arch_test_clear_young() for the vast majority of
> > VMs that are not pKVM and run on hardware that sets the accessed bit
> > in KVM page tables
On Fri, Feb 17, 2023 at 2:00 AM Marc Zyngier wrote:
>
> On Fri, 17 Feb 2023 04:21:28 +0000,
> Yu Zhao wrote:
> >
> > On Thu, Feb 16, 2023 at 9:12 PM Yu Zhao wrote:
> > >
> > > This patch adds kvm_arch_test_clear_young() for the vast majority of
> >
On Thu, Feb 16, 2023 at 9:12 PM Yu Zhao wrote:
>
> This patch adds kvm_arch_test_clear_young() for the vast majority of
> VMs that are not nested and run on hardware with Radix MMU enabled.
>
> It relies on two techniques, RCU and cmpxchg, to safely test and clear
> the ac
On Thu, Feb 16, 2023 at 9:12 PM Yu Zhao wrote:
>
> This patch adds kvm_arch_test_clear_young() for the vast majority of
> VMs that are not pKVM and run on hardware that sets the accessed bit
> in KVM page tables.
>
> It relies on two techniques, RCU and cmpxchg, to saf
On Thu, Feb 16, 2023 at 9:12 PM Yu Zhao wrote:
>
> This patch adds kvm_arch_test_clear_young() for the vast majority of
> VMs that are not nested and run on hardware that sets the accessed bit
> in TDP MMU page tables.
>
> It relies on two techniques, RCU and cmpxchg, to saf
being freed while the latter clears the accessed bit
atomically against both the hardware and other software page table
walkers.
Signed-off-by: Yu Zhao
---
arch/powerpc/include/asm/kvm_host.h| 18 ++
arch/powerpc/include/asm/kvm_ppc.h | 14 +
arch/powerpc/kvm/book3s.c
25.35% rmap_walk_file
25.28% folio_referenced_one
23.87% __mmu_notifier_clear_flush_young
23.69% kvm_mmu_notifier_clear_flush_young
=> 18.98% _raw_write_lock
Signed-off-by: Yu Zhao
---
include/linux/mmzone.h | 6 +
KVM
page tables from being freed while the latter clears the accessed bit
atomically against both the hardware and other software page table
walkers.
Signed-off-by: Yu Zhao
---
arch/arm64/include/asm/kvm_host.h | 7 +++
arch/arm64/include/asm/kvm_pgtable.h| 8 +++
arch/arm64/include/asm
protects KVM
page tables from being freed while the latter clears the accessed bit
atomically against both the hardware and other software page table
walkers.
Signed-off-by: Yu Zhao
---
arch/x86/include/asm/kvm_host.h | 27 ++
arch/x86/kvm/mmu/spte.h | 12 --
arch
ing the corresponding bit in
the bitmap to 0 or 1, and the new value will be 1 or 0 for a young
KVM PTE.
Signed-off-by: Yu Zhao
---
include/linux/kvm_host.h | 29 ++
include/linux/mmu_notifier.h | 40 +
mm/mmu_notifier.c|
hensive benchmarks are coming soon.
Yu Zhao (5):
mm/kvm: add mmu_notifier_test_clear_young()
kvm/x86: add kvm_arch_test_clear_young()
kvm/arm64: add kvm_arch_test_clear_young()
kvm/powerpc: add kvm_arch_test_clear_young()
mm: multi-gen LRU: use mmu_notifier_test_clear_young()
arch/arm64/incl
56 matches
Mail list logo