[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/xen: remove unneeded preempt_disable() from xen_irq_enable()
- To: Juergen Gross <jgross@xxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 21 Sep 2021 09:53:38 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=x+tEN8D5GCwudAasmF+KAlvekOlZNbe3X9JtFJBl+DU=; b=jXbJK9TDe4pSKn2BFPtIwflx1P6Mvd+X9EqsfBc/gS8IRmQAEBydT1Lb3iWwYFLa3Ssz3c2TYXbF7Bu6MB21BEc+c0Gy6M/jc25RbTqwWmQtftvo94bLSfM5bwnMfktU8mlX84h2VeknW1qxyZIgie7ECt2GUk0t2QFsjFmZXBIHe7reBHsx568UNn/Yaf412iRWiP+F7p+Kg98Jsm08j2Pr/4bLw84Be6iCLM0r/jO8+2S6tSVp5tDOGP4DGmPA/2PaPUIQqeLahjyixBZ7c1mcMINKtQA658tVuqlKjabdjAKDuNhFaIk4xV9IKrL17Lj0Goc7EhdzlBqN0mdiqg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CkvOOV642MgBjfJJd1M5tXX1mQS5mU2yXyScRHJlJ0VS7jiXE+8UiKV1ldsdK5gUX0YkSxWEt9I7eCR7C7lPCZMsfwVXE5bQI20KLANVk7yyM/4nNBWmtqbQZJDGjKOw/JcRYpe9qYYLcJnKDymifjbyGXHR4inDaeSlX8tGoKOygk5jkEOdLdGxOGZhh2ICqt646X+Y8v9awriStSqbtHpcZpdgOl7yLrvfH7biIKUHQg/UJl7Ja1/KaxvGWT6sKJD9lk/lIwcwiK5OxsWMjF1ZeAff785F+hZLUGraiGYsSIamEJvWil49cA60EsJSTJI6abzLSxjVs5/ymmBV3w==
- Authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=suse.com;
- Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, x86@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- Delivery-date: Tue, 21 Sep 2021 07:53:53 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 21.09.2021 09:02, Juergen Gross wrote:
> --- a/arch/x86/xen/irq.c
> +++ b/arch/x86/xen/irq.c
> @@ -57,24 +57,20 @@ asmlinkage __visible void xen_irq_enable(void)
> {
> struct vcpu_info *vcpu;
>
> - /*
> - * We may be preempted as soon as vcpu->evtchn_upcall_mask is
> - * cleared, so disable preemption to ensure we check for
> - * events on the VCPU we are still running on.
> - */
> - preempt_disable();
> -
> vcpu = this_cpu_read(xen_vcpu);
> vcpu->evtchn_upcall_mask = 0;
>
> - /* Doesn't matter if we get preempted here, because any
> - pending event will get dealt with anyway. */
> + /*
> + * Now preemption could happen, but this is only possible if an event
> + * was handled, so missing an event due to preemption is not
> + * possible at all.
> + * The worst possible case is to be preempted and then check events
> + * pending on the old vcpu, but this is not problematic.
> + */
I agree this isn't problematic from a functional perspective, but ...
> barrier(); /* unmask then check (avoid races) */
> if (unlikely(vcpu->evtchn_upcall_pending))
> xen_force_evtchn_callback();
... is a stray call here cheaper than ...
> -
> - preempt_enable();
... the preempt_{dis,en}able() pair?
Jan
|