Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp782906imm; Tue, 5 Jun 2018 04:31:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIG2D4XcC96Vmiqv0xeHdSdoF5Jr1RSKhhOLu44BZeet39VVgRxyqIwCvp5EC62iwdzqPkf X-Received: by 2002:a63:65c2:: with SMTP id z185-v6mr18935236pgb.163.1528198317302; Tue, 05 Jun 2018 04:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528198317; cv=none; d=google.com; s=arc-20160816; b=JGKr/LSV/6MwwQ4I2ino91ldMaSxqIiJmvZwwQUkloJM++48ty5QuP4w0EFHm3ErfF h5BA6IOcHzGA9YZS86gRFrP7oLXKuz1yToO/vNkEsH77BM2jZTmpf+3KrTYWf2QVUI33 2rTcpz4Z3/J79gHS9U7br+I2sLc31gonSYiPg55yW1CvwCEzUBKW9lDfbNEnmLmEVXIO hcTQ21CnuiPGMoPcwjIt8sIsLvYtrA5wUn6+5F4a99nwwbADiOMdbTj0MgyJuZi4iYbK e6TxAeJbvBLjqbN/U8SHsfHhNyzTtUBPlTlEgOF3VeQYZ0qy+/H44+j4GrENYyuGlZP/ xqcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=A8bxIxmJrsEnQDVRgMKkoD0ZVbCopgPRwjBblbFrdbg=; b=Z7hzo5eCKYeBTutMmwpYeR71vty53E471eDxjj4McZe9ghNXMBYMC8R4tEXTXBhjTX jyvc8h3NUgBoXwHJUUEibrABaCG4BS1hKECJXOw/8ANH/NDWHL+omvmXvntsYIESXqDg hEuq60gv4pX31KIvQEDDS8jJWzLpBO4t4q90F0Ds9IDoqXKBYC/FGTub7ruPD+yafa8a Sbc/pXamPTyCgV423rOHHisnxgPtxhFiRZyZyB4z/AdaUfTA7ZBqrCLb2Z2kkv6DcS/V Aqpv7yytr0dKH9S+ibUuFEish0KH40slVrCcagFKJ6wkJpq13LLpEQiLL9MTxVtYfjTE MGQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16-v6si6321351pgt.477.2018.06.05.04.31.42; Tue, 05 Jun 2018 04:31:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751667AbeFELbS (ORCPT + 99 others); Tue, 5 Jun 2018 07:31:18 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:61529 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751572AbeFELbR (ORCPT ); Tue, 5 Jun 2018 07:31:17 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="40759063" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 05 Jun 2018 19:31:14 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id C23954B41E80; Tue, 5 Jun 2018 19:31:11 +0800 (CST) Received: from localhost.localdomain (10.167.226.106) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.399.0; Tue, 5 Jun 2018 19:31:11 +0800 Subject: Re: [patch 3/8] x86/apic: Provide apic_ack_irq() To: Thomas Gleixner , LKML CC: Ingo Molnar , Peter Zijlstra , Borislav Petkov , Dmitry Safonov <0x7f454c46@gmail.com>, Tariq Toukan , Song Liu , Joerg Roedel , Mike Travis , References: <20180604162224.471925894@linutronix.de> From: Dou Liyang Message-ID: <94117bd8-352b-1077-e8ae-8722d7ec213f@cn.fujitsu.com> Date: Tue, 5 Jun 2018 19:31:11 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180604162224.471925894@linutronix.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: C23954B41E80.AA595 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, At 06/04/2018 11:33 PM, Thomas Gleixner wrote: > apic_ack_edge() is explicitely for handling interrupt affinity cleanup when > interrupt remapping is not available or disable. > > Remapped interrupts and also some of the platform specific special > interrupts, e.g. UV, invoke ack_APIC_irq() directly. > > To address the issue of failing an affinity update with -EBUSY the delayed > affinity mechanism can be reused, but ack_APIC_irq() does not handle > that. Adding this to ack_APIC_irq() is not possible, because that function > is also used for exceptions and directly handled interrupts like IPIs. > > Create a new function, which just contains the conditional invocation of > irq_move_irq() and the final ack_APIC_irq(). Making the invocation of > irq_move_irq() conditional avoids the out of line call if the pending bit > is not set. > > Reuse the new function in apic_ack_edge(). > > Preparatory change for the real fix > > Fixes: dccfe3147b42 ("x86/vector: Simplify vector move cleanup") > Signed-off-by: Thomas Gleixner > Cc:stable@vger.kernel.org > --- > arch/x86/include/asm/apic.h | 2 ++ > arch/x86/kernel/apic/vector.c | 10 ++++++++-- > 2 files changed, 10 insertions(+), 2 deletions(-) > > --- a/arch/x86/include/asm/apic.h > +++ b/arch/x86/include/asm/apic.h > @@ -436,6 +436,8 @@ static inline void apic_set_eoi_write(vo > > #endif /* CONFIG_X86_LOCAL_APIC */ > > +extern void apic_ack_irq(struct irq_data *data); > + > static inline void ack_APIC_irq(void) > { > /* > --- a/arch/x86/kernel/apic/vector.c > +++ b/arch/x86/kernel/apic/vector.c > @@ -809,11 +809,17 @@ static int apic_retrigger_irq(struct irq > return 1; > } > > +void apic_ack_irq(struct irq_data *irqd) > +{ > + if (unlikely(irqd_is_setaffinity_pending(irqd))) Affinity pending is also judged in > + irq_move_irq(irqd); If we can remove the if(...) statement here Thanks, dou > + ack_APIC_irq(); > +} > + > void apic_ack_edge(struct irq_data *irqd) > { > irq_complete_move(irqd_cfg(irqd)); > - irq_move_irq(irqd); > - ack_APIC_irq(); > + apic_ack_irq(irqd); > } > > static struct irq_chip lapic_controller = {