Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp557776imm; Tue, 5 Jun 2018 00:08:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKhO5pCI4NWBRo7EllBuHd0EDyqRgu/EW5uI106QUBpzhx7bmCeFRetiWDqgSQAyy7177B8 X-Received: by 2002:a62:5281:: with SMTP id g123-v6mr24327197pfb.22.1528182517395; Tue, 05 Jun 2018 00:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528182517; cv=none; d=google.com; s=arc-20160816; b=L/ikumUp+OQ4xYjrSwAyrq1LnrQfEm3mu2ssR4ku0iQ7G6qs+AG6h6Ct7h3dAHyL9z C+AZVT28gdyz7d6mOh/PKeDQ6WYxaTU4DLVfICrAThCmYVrRe4yHl3r921jnxcKX8R14 3UM98j7IEJswaoVOF/lfMAQYrxPXL7sIuoz363Cl6FYaf8vZwW2Zj0i2xStg1m4F2HS2 DypQ0Y4BzYyApMqjn2UWrSjlCcTErSvQKFkeQ48896ypr0tvbdvlIjZRezaLI47LjRMb epoD/fM4zYDw1BodSYBkXchkFzGzS0wTi9PrxCUXIdvaNlIEgvhoZLXcW98ak9mI2JPM hbag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=jofdVv/Kpp75WWpfT2KSM8ZfjF4TG12pBhayjnPlBqw=; b=azsNgblfVloPBRLAdF9TxDg7I59p2hUIVKuQKpTitWmmWgTunXWf/b/CPB+XT9Fort 194cH8TNmZuxWikQIZVCh/8QYWeMYdjxc/e8KYR1uGaixSY3gqzeOvDWRe7Wox4UpbHH q63X3lWd7+idmwh6Qc+CnLOfdD3TrIMbzACECAQSykjOoJQM4YeBERugWI6JcCkFCUuX sRTFXi/34fjT2TCOxci9/9w3A4gpeBuPJkQpZ7S1D+pEMdWqtU+5cfa+Xho+9B3DgRP0 M7M2pObvK5aW1CQcBs0a5DUewXlxysSr15Jj5kuJ/ot64xDB01yGqiMGL/kvzIFpIm3h ArNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IDEDpoRO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6-v6si13468015pls.21.2018.06.05.00.08.23; Tue, 05 Jun 2018 00:08:37 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IDEDpoRO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751889AbeFEHHv (ORCPT + 99 others); Tue, 5 Jun 2018 03:07:51 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:46029 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751497AbeFEHHt (ORCPT ); Tue, 5 Jun 2018 03:07:49 -0400 Received: by mail-oi0-f67.google.com with SMTP id b130-v6so1084751oif.12; Tue, 05 Jun 2018 00:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jofdVv/Kpp75WWpfT2KSM8ZfjF4TG12pBhayjnPlBqw=; b=IDEDpoROtjsDHJDGck1miHscyFwYNKpWxUbYSR8WxmKOSXk3mEWh0GuHLw12YPTa5+ AapYe23xyffRSCbJlkglMr4EODmMZiGkhNRTGSxU0Ogb881CJY4XXBjtaRzecOP33Vwi kyYG5OWkBaSXOir1uLGhtQ7dQ+TEeHh/uXCeILsUzb1R6P2CCMxqfNwm2rifhWqkT7Kc +gAK3lVgikPhKV5m+wQGYuOt9DGAjbu6QHVQgQUnXRcT/Y6PRRyaOaphkvuCrrX1Dhi0 K1ciVmj0/+ir8P1IMAkHTdeOnRPI6Sv51lFnPl0ePsKO4lXndKwRt2XLQL3E3RCfYXYQ YYUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jofdVv/Kpp75WWpfT2KSM8ZfjF4TG12pBhayjnPlBqw=; b=PPVxOueS0zQO9E7krXNt9AP6wqe6W5VoLWp5OPd+q5JVD9kcZ+EV4UVVcQ1jptnXYc ZTB7QyQsuSFwB/5nygBlelNSYLNMQQAcrX9xNJjDh9j9C+PPE7ksXksP82T9eF8Ae2+v E/L8W9+wn+ubWGSJyUee3AxAx5FCTLRCiB5e0G3NdkuQiz8B3eGgj1pGqBWBMmVJNMRs j7sFrSs7rhbPBxITFqYgLk+Z9KFimmyFnwMe/IOzxX5WTvy5OeTnV8j0yT4RV77b08+R C2vHL6+y30Z0TTyoccqGmNQx4pK2O2IAqnPQLu3NPQvDHry6qxQ9VRMqxA3lEkKdLCNh jBmg== X-Gm-Message-State: APt69E0Ov79KwhQvmFklLwaTZGD63K6NTfDjFsBmQ/VHaeW2PIYKkAaq hPEflrQco4ZvszS9D5C+5FTGBu5zFpI5/+vWoUM= X-Received: by 2002:aca:a6cb:: with SMTP id t72-v6mr14146680oij.261.1528182469250; Tue, 05 Jun 2018 00:07:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:349c:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 00:07:48 -0700 (PDT) In-Reply-To: <20180604162224.471925894@linutronix.de> References: <20180604162224.471925894@linutronix.de> From: Song Liu Date: Tue, 5 Jun 2018 00:07:48 -0700 Message-ID: Subject: Re: [patch 3/8] x86/apic: Provide apic_ack_irq() To: Thomas Gleixner Cc: LKML , Ingo Molnar , Peter Zijlstra , Borislav Petkov , Dmitry Safonov <0x7f454c46@gmail.com>, Tariq Toukan , Joerg Roedel , Mike Travis , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 4, 2018 at 8:33 AM, 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 Tested-by: Song Liu > --- > 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))) > + irq_move_irq(irqd); > + 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 = { > >