From: Ian Campbell Subject: Re: [PATCH] linux/x86: eliminate nesting of run-queue locks inside xtime_lock Date: Tue, 10 Aug 2010 15:25:19 +0100 Message-ID: <1281450319.24292.3945.camel@zakaz.uk.xensource.com> References: <4C6179F2020000780000F10F@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C6179F2020000780000F10F@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: "salvet@ics.muni.cz" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Tue, 2010-08-10 at 15:10 +0100, Jan Beulich wrote: > From: Zdenek Salvet > > 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 I'm right in thinking this is for traditional Xen/Linux kernel only, aren't I? Acked-by: Ian Campbell > > --- 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() > > >