From: Andrew Jones <drjones@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
christoffer.dall@linaro.org
Subject: Re: [PATCH 2/3] arm/arm64: speed up spinlocks and atomic ops
Date: Thu, 25 Jun 2015 18:55:52 +0200 [thread overview]
Message-ID: <20150625165552.GC6535@hawk.localdomain> (raw)
In-Reply-To: <558C2B14.7060807@redhat.com>
On Thu, Jun 25, 2015 at 06:23:48PM +0200, Paolo Bonzini wrote:
>
>
> On 25/06/2015 18:12, Andrew Jones wrote:
> > spinlock torture tests made it clear that checking mmu_enabled()
> > every time we call spin_lock is a bad idea. As most tests will
> > want the MMU enabled the entire time, then just hard code
> > mmu_enabled() to true. Tests that want to play with the MMU can
> > be compiled with CONFIG_MAY_DISABLE_MMU to get the actual check
> > back.
>
> This doesn't work if you compile mmu.o just once. Can you make
> something like
>
> static inline bool mmu_enabled(void)
> {
> return disabled_mmu_cpu_count == 0 || __mmu_enabled();
> }
>
> ...
>
> bool __mmu_enabled(void)
> {
> struct thread_info *ti = current_thread_info();
> return cpumask_test_cpu(ti->cpu, &mmu_enabled_cpumask);
> }
>
> ?
Agreed. But I might as well actually add the support for disabling
the mmu, if I'm going to add yet another variable dependant on it.
We should drop this patch from this series, and I'll submit another
series of a few patches that
- introduce mmu_disable
- switch to assuming the mmu is enabled, and then manage disabled
state instead
- optimize mmu_enabled()
Thanks,
drew
>
> Paolo
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-06-25 16:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 16:12 [PATCH 0/3] arm/arm64: tcg_baremetal_tests inspired patches Andrew Jones
2015-06-25 16:12 ` [PATCH 1/3] arm/arm64: spinlocks: fix memory barriers Andrew Jones
2015-06-29 10:27 ` Christoffer Dall
2015-07-03 17:42 ` Paolo Bonzini
2015-06-25 16:12 ` [PATCH 2/3] arm/arm64: speed up spinlocks and atomic ops Andrew Jones
2015-06-25 16:23 ` Paolo Bonzini
2015-06-25 16:55 ` Andrew Jones [this message]
2015-06-29 10:28 ` Christoffer Dall
2015-06-29 10:44 ` Andrew Jones
2015-06-29 12:53 ` Christoffer Dall
2015-06-25 16:12 ` [PATCH 3/3] arm/arm64: allow building a single test Andrew Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150625165552.GC6535@hawk.localdomain \
--to=drjones@redhat.com \
--cc=christoffer.dall@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox