From: "Jan Beulich" <JBeulich@novell.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: salvet@ics.muni.cz, Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH] linux/x86: eliminate nesting of run-queue locks inside xtime_lock
Date: Tue, 10 Aug 2010 15:10:26 +0100 [thread overview]
Message-ID: <4C6179F2020000780000F10F@vpn.id2.novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]
From: Zdenek Salvet <salvet@ics.muni.cz>
According to Debian bug 591362 this has been causing problems. While
no proof was given that the inverse lock order does actually occur
anywhere (with interrupts enabled), it is plain unnecessary to take
the risk.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
--- a/arch/i386/kernel/time-xen.c
+++ b/arch/i386/kernel/time-xen.c
@@ -666,6 +666,7 @@ irqreturn_t timer_interrupt(int irq, voi
s64 delta, delta_cpu, stolen, blocked;
u64 sched_time;
unsigned int i, cpu = smp_processor_id();
+ int schedule_clock_was_set_work = 0;
struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
struct vcpu_runstate_info *runstate = &per_cpu(runstate, cpu);
@@ -720,12 +721,14 @@ irqreturn_t timer_interrupt(int irq, voi
if (shadow_tv_version != HYPERVISOR_shared_info->wc_version) {
update_wallclock();
- if (keventd_up())
- schedule_work(&clock_was_set_work);
+ schedule_clock_was_set_work = 1;
}
write_sequnlock(&xtime_lock);
+ if (schedule_clock_was_set_work && keventd_up())
+ schedule_work(&clock_was_set_work);
+
/*
* Account stolen ticks.
* HACK: Passing NULL to account_steal_time()
[-- Attachment #2: xenlinux-x86-clock-was-set-work.patch --]
[-- Type: text/plain, Size: 1316 bytes --]
From: Zdenek Salvet <salvet@ics.muni.cz>
Subject: eliminate nesting of run-queue locks inside xtime_lock
According to Debian bug 591362 this has been causing problems. While
no proof was given that the inverse lock order does actually occur
anywhere (with interrupts enabled), it is plain unnecessary to take
the risk.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
--- a/arch/i386/kernel/time-xen.c
+++ b/arch/i386/kernel/time-xen.c
@@ -666,6 +666,7 @@ irqreturn_t timer_interrupt(int irq, voi
s64 delta, delta_cpu, stolen, blocked;
u64 sched_time;
unsigned int i, cpu = smp_processor_id();
+ int schedule_clock_was_set_work = 0;
struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
struct vcpu_runstate_info *runstate = &per_cpu(runstate, cpu);
@@ -720,12 +721,14 @@ irqreturn_t timer_interrupt(int irq, voi
if (shadow_tv_version != HYPERVISOR_shared_info->wc_version) {
update_wallclock();
- if (keventd_up())
- schedule_work(&clock_was_set_work);
+ schedule_clock_was_set_work = 1;
}
write_sequnlock(&xtime_lock);
+ if (schedule_clock_was_set_work && keventd_up())
+ schedule_work(&clock_was_set_work);
+
/*
* Account stolen ticks.
* HACK: Passing NULL to account_steal_time()
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2010-08-10 14:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 14:10 Jan Beulich [this message]
2010-08-10 14:25 ` [PATCH] linux/x86: eliminate nesting of run-queue locks inside xtime_lock Ian Campbell
2010-08-10 14:41 ` Jan Beulich
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=4C6179F2020000780000F10F@vpn.id2.novell.com \
--to=jbeulich@novell.com \
--cc=ian.campbell@citrix.com \
--cc=salvet@ics.muni.cz \
--cc=xen-devel@lists.xensource.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;
as well as URLs for NNTP newsgroup(s).