From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCHv5] x86/xen: allow privcmd hypercalls to be preempted Date: Thu, 05 Feb 2015 11:11:20 -0500 Message-ID: <54D39628.4020508@oracle.com> References: <1423140077-32356-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJP2G-0005Gz-3J for xen-devel@lists.xenproject.org; Thu, 05 Feb 2015 16:12:08 +0000 In-Reply-To: <1423140077-32356-1-git-send-email-david.vrabel@citrix.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: David Vrabel , xen-devel@lists.xenproject.org Cc: "Luis R. Rodriguez" List-Id: xen-devel@lists.xenproject.org On 02/05/2015 07:41 AM, David Vrabel wrote: > + > +void xen_maybe_preempt_hcall(void) > +{ > + if (__this_cpu_read(xen_in_preemptible_hcall)) { Can you check should_resched() here? -boris > + /* > + * Clear flag as we may be rescheduled on a different > + * cpu. > + */ > + __this_cpu_write(xen_in_preemptible_hcall, false); > + _cond_resched(); > + __this_cpu_write(xen_in_preemptible_hcall, true); > + } > +} > +#endif /* CONFIG_PREEMPT */ >