[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADrL8HXLGj-V0Qd8U3xRXnJeMTKOJqB-TsyLTOo8j0sGo2byBw@mail.gmail.com>
Date: Mon, 15 Jul 2024 16:15:06 -0700
From: James Houghton <jthoughton@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Yu Zhao <yuzhao@...gle.com>, Andrew Morton <akpm@...ux-foundation.org>,
Paolo Bonzini <pbonzini@...hat.com>, Ankit Agrawal <ankita@...dia.com>,
Axel Rasmussen <axelrasmussen@...gle.com>, Catalin Marinas <catalin.marinas@....com>,
David Matlack <dmatlack@...gle.com>, David Rientjes <rientjes@...gle.com>,
James Morse <james.morse@....com>, Jonathan Corbet <corbet@....net>, Marc Zyngier <maz@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>, Raghavendra Rao Ananta <rananta@...gle.com>,
Ryan Roberts <ryan.roberts@....com>, Shaoqin Huang <shahuang@...hat.com>,
Suzuki K Poulose <suzuki.poulose@....com>, Wei Xu <weixugc@...gle.com>,
Will Deacon <will@...nel.org>, Zenghui Yu <yuzenghui@...wei.com>, kvmarm@...ts.linux.dev,
kvm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v5 4/9] mm: Add test_clear_young_fast_only MMU notifier
On Fri, Jul 12, 2024 at 8:06 AM Sean Christopherson <seanjc@...gle.com> wrote:
>
> On Wed, Jul 10, 2024, James Houghton wrote:
> > 1. Drop the WAS_FAST complexity.
> > 2. Add a function like mm_has_fast_aging_notifiers(), use that to
> > determine if we should be doing look-around.
>
> I would prefer a flag over a function. Long-term, if my pseudo-lockless rmap
> idea pans out, KVM can set the flag during VM creation. Until then, KVM can set
> the flag during creation and then toggle it in (un)account_shadowed(). Races
> will be possible, but they should be extremely rare and quite benign, all things
> considered.
So I think you're talking about .has_fast_aging bool on struct
mmu_notifier, and we would do look-around if that is set, right? So
we'd need to have something like mm_has_fast_aging_notifiers() to
check if any of the subscribed mmu notifiers have .has_fast_aging.
We could toggle it in (un)account_shadowed(), but I think I'd need to
demonstrate some performance win to justify it.
Powered by blists - more mailing lists