From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCHv5] x86/xen: allow privcmd hypercalls to be preempted Date: Fri, 6 Feb 2015 10:01:18 +0000 Message-ID: <54D490EE.3000504@citrix.com> References: <1423140077-32356-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJfj1-0001KT-1x for xen-devel@lists.xenproject.org; Fri, 06 Feb 2015 10:01:23 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andy Lutomirski , David Vrabel Cc: "xen-devel@lists.xenproject.org" , Boris Ostrovsky , "Luis R. Rodriguez" List-Id: xen-devel@lists.xenproject.org On 06/02/15 00:50, Andy Lutomirski wrote: > On Thu, Feb 5, 2015 at 4:41 AM, David Vrabel wrote: >> Hypercalls submitted by user space tools via the privcmd driver can >> take a long time (potentially many 10s of seconds) if the hypercall >> has many sub-operations. >> > >> + >> +void xen_maybe_preempt_hcall(void) > > I think this should be asmlinkage __visible. Other than that, this > looks good to me. I like your solution to the tracking problem. > >> +{ >> + if (__this_cpu_read(xen_in_preemptible_hcall)) { > > Hmm. That being said, is there any issue with nested interrupts? The should_resched() check in _cond_resched() already handles this because irq_enter() sets the preempt count as non-zero. FWIW, XenServer has been using something like this in production for about a year without any problems. David