From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: the arch/x86 maintainers <x86@kernel.org>,
Xen-devel <xen-devel@lists.xensource.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Nick Piggin <npiggin@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Rusty Russell <rusty@rustcorp.com.au>,
Zachary Amsden <zach@vmware.com>,
Alok N Kataria <akataria@vmware.com>, Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Subject: [PATCH 6/9] x86/paravirt: allow preemption with lazy mmu mode
Date: Wed, 18 Feb 2009 14:30:15 -0800 [thread overview]
Message-ID: <bb490ee65960b57a95874510baf766bc2b8574fd.1234988621.git.jeremy.fitzhardinge@citrix.com> (raw)
In-Reply-To: <cover.1234988621.git.jeremy.fitzhardinge@citrix.com>
In-Reply-To: <cover.1234988621.git.jeremy.fitzhardinge@citrix.com>
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Lift restrictions on preemption with lazy mmu mode, as it is now allowed.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
arch/x86/kernel/paravirt.c | 7 ++++---
arch/x86/xen/mmu.c | 8 +-------
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 554dadd..1a81ce9 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -248,7 +248,6 @@ static DEFINE_PER_CPU(enum paravirt_lazy_mode, paravirt_lazy_mode) = PARAVIRT_LA
static inline void enter_lazy(enum paravirt_lazy_mode mode)
{
BUG_ON(__get_cpu_var(paravirt_lazy_mode) != PARAVIRT_LAZY_NONE);
- BUG_ON(preemptible());
__get_cpu_var(paravirt_lazy_mode) = mode;
}
@@ -256,7 +255,6 @@ static inline void enter_lazy(enum paravirt_lazy_mode mode)
static void leave_lazy(enum paravirt_lazy_mode mode)
{
BUG_ON(__get_cpu_var(paravirt_lazy_mode) != mode);
- BUG_ON(preemptible());
__get_cpu_var(paravirt_lazy_mode) = PARAVIRT_LAZY_NONE;
}
@@ -273,6 +271,8 @@ void paravirt_leave_lazy_mmu(void)
void paravirt_enter_lazy_cpu(void)
{
+ BUG_ON(preemptible());
+
if (percpu_read(paravirt_lazy_mode) == PARAVIRT_LAZY_MMU) {
arch_leave_lazy_mmu_mode();
set_thread_flag(TIF_LAZY_MMU_UPDATES);
@@ -282,6 +282,8 @@ void paravirt_enter_lazy_cpu(void)
void paravirt_leave_lazy_cpu(void)
{
+ BUG_ON(preemptible());
+
leave_lazy(PARAVIRT_LAZY_CPU);
if (test_and_clear_thread_flag(TIF_LAZY_MMU_UPDATES))
@@ -301,7 +303,6 @@ void arch_flush_lazy_mmu_mode(void)
preempt_disable();
if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
- WARN_ON(preempt_count() == 1);
arch_leave_lazy_mmu_mode();
arch_enter_lazy_mmu_mode();
}
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 2669c58..92c6463 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -412,10 +412,6 @@ void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags)
void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t pteval)
{
- /* updates to init_mm may be done without lock */
- if (mm == &init_mm)
- preempt_disable();
-
ADD_STATS(set_pte_at, 1);
// ADD_STATS(set_pte_at_pinned, xen_page_pinned(ptep));
ADD_STATS(set_pte_at_current, mm == current->mm);
@@ -436,9 +432,7 @@ void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
}
xen_set_pte(ptep, pteval);
-out:
- if (mm == &init_mm)
- preempt_enable();
+out: return;
}
pte_t xen_ptep_modify_prot_start(struct mm_struct *mm,
--
1.6.0.6
next prev parent reply other threads:[~2009-02-18 22:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-18 22:30 [PATCH 0/9] *** SUBJECT HERE *** Jeremy Fitzhardinge
2009-02-18 22:30 ` [PATCH 3/9] x86/paravirt: remove lazy mode in interrupts Jeremy Fitzhardinge
2009-02-19 0:53 ` Zachary Amsden
2009-02-19 0:17 ` Jeremy Fitzhardinge
2009-02-18 22:30 ` [PATCH 4/9] x86/pvops: replace arch_enter_lazy_cpu_mode with arch_start_context_switch Jeremy Fitzhardinge
2009-02-18 22:30 ` [PATCH 5/9] x86/paravirt: flush pending mmu updates on context switch Jeremy Fitzhardinge
2009-02-18 22:30 ` Jeremy Fitzhardinge [this message]
2009-02-18 22:30 ` [PATCH 7/9] mm: allow preemption in apply_to_pte_range Jeremy Fitzhardinge
2009-02-18 22:30 ` [PATCH 8/9] x86/paravirt: use percpu_ rather than __get_cpu_var Jeremy Fitzhardinge
2009-02-18 22:30 ` [PATCH 9/9] x86/paravirt: finish change from lazy cpu to context switch start/end Jeremy Fitzhardinge
2009-02-18 22:36 ` [PATCH 0/9] Make lazy mmu update mode pre-empt safe Andrew Morton
2009-02-18 22:43 ` Jeremy Fitzhardinge
2009-02-18 22:52 ` Jeremy Fitzhardinge
2009-02-18 22:55 ` Ingo Molnar
2009-02-18 23:04 ` Jeremy Fitzhardinge
2009-02-18 23:13 ` Ingo Molnar
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=bb490ee65960b57a95874510baf766bc2b8574fd.1234988621.git.jeremy.fitzhardinge@citrix.com \
--to=jeremy@goop.org \
--cc=akataria@vmware.com \
--cc=akpm@linux-foundation.org \
--cc=avi@redhat.com \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mtosatti@redhat.com \
--cc=npiggin@suse.de \
--cc=peterz@infradead.org \
--cc=rusty@rustcorp.com.au \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xensource.com \
--cc=zach@vmware.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
all inboxes | Powered by JetHome®