From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH 3/3] xen/events: schedule if the interrupted task is in a preemptible hypercall Date: Wed, 12 Feb 2014 12:54:40 +0000 Message-ID: <52FB6F10.8040307@citrix.com> References: <1392146352-16381-1-git-send-email-david.vrabel@citrix.com> <1392146352-16381-4-git-send-email-david.vrabel@citrix.com> <52FB7042020000780011BAD0@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <52FB7042020000780011BAD0@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Andrew Cooper , Boris Ostrovsky , xen-devel@lists.xen.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 12/02/14 11:59, Jan Beulich wrote: >>>> On 11.02.14 at 20:19, David Vrabel wrote: >> --- a/drivers/xen/events/events_base.c >> +++ b/drivers/xen/events/events_base.c >> @@ -1254,6 +1254,12 @@ void xen_evtchn_do_upcall(struct pt_regs *regs) >> >> irq_exit(); >> set_irq_regs(old_regs); >> + >> +#ifndef CONFIG_PREEMPT >> + if ( __this_cpu_read(xed_nesting_count) == 0 >> + && is_preemptible_hypercall(regs) ) >> + _cond_resched(); >> +#endif > > I don't think this can be done here - a 64-bit x86 kernel would > generally be on the IRQ stack, and I don't think scheduling > should be done in this state. _cond_resched() doesn't look that different from preempt_schedule_irq() which is explicitly callable from irq context. David