Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp320951imm; Tue, 5 Jun 2018 20:49:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK/nC5SPh1uVmbl5PfRnLw8FN6tnmnpezp864E6eDlh73RaDD3BaVIHklYxBnU7qBTWmzKl X-Received: by 2002:a65:4e8e:: with SMTP id b14-v6mr1169547pgs.392.1528256989606; Tue, 05 Jun 2018 20:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528256989; cv=none; d=google.com; s=arc-20160816; b=gleZZVAzREn3EFvnQAVSFRP7vM/UIwyoX1Yl/68C6ZBlp840+yF1HgSxOsNWsiMeWZ rfk4TEPCcyU0O5K7g6yMeA0QifUsL77EFN+Tsw+wEqnZbMpKBZnr23+X3FxyEgCsa/0i mPE1xiTgcn04vJqP5z53dCocdeZYB+Bx+IPXRyG17bOo6YUd3rjI0iZjrj0WtoDe5c0x mo5hgrWf70MRfCUWipaHSEz/Tx5Lj5K9u7u/O+4dhAFpeEIoEP1Puh5fNoFTWZPSiNPV v583zcWop3QxC/nlX2v+F+yeiu+bu9PzehBiphPiKk5psBt/AtHjjTYRT7vESy8HWBHL OngQ== 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=8ay78RRaQpbWp0yz+VtjibgL/voaIgo6nuDVzckKP9s=; b=HjCh/Ksf1zYld2pPQ5mcKUQ2X7GxdqJASw/XOu2Qi7VXm35IaNWygOHKjt5iqHoH69 KY3SzUI/dGi2MDdOmQ7B3L3qKBqZxAJyS/mbjrzbHnYyPIcLm9DMnuaDcbZHY+MKm51q nUpFkwLaCPQ3w1BKIV0OIXePiOgLP0TLzZQ0VTV3BMrOXHCHTwte2K9e+KpHd4txze32 OLADRPEZgIKMrY4wJ9op+zUR+MdU/r/yR/Xm3KeyLJ7QiSnaRRpULrFb4iOpqXPeEiC8 lwGj6K1f3r0w0IlSpN9o+fAzQ64xl1b3nS0QUD9m3H78XS43uvWYGgb2rshpL2h4PS1t jCJA== 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 t25-v6si4052306pfh.101.2018.06.05.20.49.35; Tue, 05 Jun 2018 20:49:49 -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 S932144AbeFFDtE (ORCPT + 99 others); Tue, 5 Jun 2018 23:49:04 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:9314 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932089AbeFFDtD (ORCPT ); Tue, 5 Jun 2018 23:49:03 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="40784484" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 06 Jun 2018 11:48:58 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id 8DBF44B41E79; Wed, 6 Jun 2018 11:48:55 +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; Wed, 6 Jun 2018 11:48:56 +0800 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 , Song Liu , Joerg Roedel , Mike Travis , References: <20180604162224.471925894@linutronix.de> <94117bd8-352b-1077-e8ae-8722d7ec213f@cn.fujitsu.com> From: Dou Liyang Message-ID: Date: Wed, 6 Jun 2018 11:48:55 +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: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 8DBF44B41E79.AE35F 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/05/2018 07:41 PM, Thomas Gleixner wrote: > On Tue, 5 Jun 2018, Dou Liyang wrote: >>> +{ >>> + 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 > > That requires to fix all call sites in ia64 and that's why I didn't. But I didn't express clearly, I meant remove the if(...) statement from apic_ack_irq(), it doesn't require to fix the call sites in ia64. +void apic_ack_irq(struct irq_data *irqd) +{ + irq_move_irq(irqd); + ack_APIC_irq(); +} BTW, If apic_ack_irq() can accept _any_ irq_data when hierarchical irqdomains are enabled[1]? If it is true, If there is a situation in the original code that we should avoid:   If the top-level irq_data has the IRQD_SETAFFINITY_PENDING state, but non-top-level irq_data state not, when using non-top-level irq_data in apic_ack_irq(), we may skip the irq_move_irq() which we should call. [1] commit 77ed42f18edd("genirq: Prevent crash in irq_move_irq()") > we can make irq_move_irq() an inline function and have the check in the > inline. > I don't know why do we need to make irq_move_irq() an inline function. And, yes, irq_move_irq() has already had the check ... if (likely(!irqd_is_setaffinity_pending(idata))) return; ... Thanks, dou