Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp823164imm; Wed, 6 Jun 2018 06:33:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLO8wGz4lCOz71QxBnGar/G/7TyPo9skG0zgbKXrmLBH8hY8yRkFKwIjzFnh/OFp5xW7G9w X-Received: by 2002:a62:81c5:: with SMTP id t188-v6mr2499700pfd.146.1528292039179; Wed, 06 Jun 2018 06:33:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528292039; cv=none; d=google.com; s=arc-20160816; b=wrVLbFbyqw0gwzVVPPpjty8tICAzskqdlnDMT2tvAaZxM8bPVcr8Gzkg05ulkpbFJe y3Yd4N9cPqM+PNORbNLxHIpKnjVfwxw0PkQqOPe3YjcDiwecAkXhKUZIgamDBVPfsuCk dZ93PVthp1boqy0YogMFWMRyK699U44TdNK7BgyDT/I9sNo6W8UbAs9aV1FWZCxKRzt/ eOdkuJHV8lCoRTBJVBF/l3n4GUhsHx+8VQ1VmBzb8F/0I8Tj5t75qWiV1hr1V7y6qF9I 394YiruDjsA4U+UhIFmgBuYyi9f4toyHtDAe3CD5ksdkWyOfSkWvNut0bDWGhgoZvtH0 lVWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=JNJE/nE0gnY8daJKCD3h9GjFM3F1z+iToXGUy7t5vSU=; b=kECf1CEZDyvnK9D/XtooZseH92uur/26QhAd8AtUFwR6ep9zKdrwUqGI9uBC9AsxdK E6pfqqngJYpBGD4QA1+U40yX/q+pbDo0X9Z0arWAR4xZJV2tnpqACCrf7Ni3Yv87ygMC 4lIi0MrR20D+lMWgqOtq47AODQ6C60ywa1xcBcJOGLeNLBAY4WcB3lQvuD2+4SEE2qJV bV6QDgDJ/sAhWhKh7tIhYU5D9BBcHMwYSCJIqKtU4w8gyyTfmHd07aGZYtoor4tp3Vq8 PSiVysX8Lkq25P+Wln33lQiTQ5L3VZ1O9fV1gORPjg6TmlwLcpgi/zhtCspUMrwemdTM ymWg== 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 d90-v6si52125275pld.92.2018.06.06.06.33.44; Wed, 06 Jun 2018 06:33:59 -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 S1752356AbeFFNcp (ORCPT + 99 others); Wed, 6 Jun 2018 09:32:45 -0400 Received: from terminus.zytor.com ([198.137.202.136]:36963 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752326AbeFFNcn (ORCPT ); Wed, 6 Jun 2018 09:32:43 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w56DVs0X1794070 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Jun 2018 06:31:54 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w56DVsvX1794067; Wed, 6 Jun 2018 06:31:54 -0700 Date: Wed, 6 Jun 2018 06:31:54 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Thomas Gleixner Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, bp@alien8.de, tglx@linutronix.de, mike.travis@hpe.com, douly.fnst@cn.fujitsu.com, peterz@infradead.org, mingo@kernel.org, liu.song.a23@gmail.com, 0x7f454c46@gmail.com, jroedel@suse.de, tariqt@mellanox.com Reply-To: 0x7f454c46@gmail.com, mingo@kernel.org, liu.song.a23@gmail.com, peterz@infradead.org, tariqt@mellanox.com, jroedel@suse.de, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@alien8.de, douly.fnst@cn.fujitsu.com, mike.travis@hpe.com In-Reply-To: <20180604162224.471925894@linutronix.de> References: <20180604162224.471925894@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] genirq/migration: Avoid out of line call if pending is not set Git-Commit-ID: d340ebd696f921d3ad01b8c0c29dd38f2ad2bf3e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,FREEMAIL_FORGED_REPLYTO,FREEMAIL_REPLYTO_END_DIGIT autolearn=no autolearn_force=no version=3.4.1 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d340ebd696f921d3ad01b8c0c29dd38f2ad2bf3e Gitweb: https://git.kernel.org/tip/d340ebd696f921d3ad01b8c0c29dd38f2ad2bf3e Author: Thomas Gleixner AuthorDate: Wed, 6 Jun 2018 14:46:59 +0200 Committer: Thomas Gleixner CommitDate: Wed, 6 Jun 2018 15:18:20 +0200 genirq/migration: Avoid out of line call if pending is not set The upcoming fix for the -EBUSY return from affinity settings requires to use the irq_move_irq() functionality even on irq remapped interrupts. To avoid the out of line call, move the check for the pending bit into an inline helper. Preparatory change for the real fix. No functional change. Fixes: dccfe3147b42 ("x86/vector: Simplify vector move cleanup") Signed-off-by: Thomas Gleixner Cc: Joerg Roedel Cc: Peter Zijlstra Cc: Song Liu Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: stable@vger.kernel.org Cc: Mike Travis Cc: Borislav Petkov Cc: Tariq Toukan Cc: Dou Liyang Link: https://lkml.kernel.org/r/20180604162224.471925894@linutronix.de --- include/linux/irq.h | 7 ++++++- kernel/irq/migration.c | 5 +---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/linux/irq.h b/include/linux/irq.h index 65916a305f3d..4e66378f290b 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -551,7 +551,12 @@ extern int irq_affinity_online_cpu(unsigned int cpu); #endif #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ) -void irq_move_irq(struct irq_data *data); +void __irq_move_irq(struct irq_data *data); +static inline void irq_move_irq(struct irq_data *data) +{ + if (unlikely(irqd_is_setaffinity_pending(data))) + __irq_move_irq(data); +} void irq_move_masked_irq(struct irq_data *data); void irq_force_complete_move(struct irq_desc *desc); #else diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c index 8b8cecd18cce..def48589ea48 100644 --- a/kernel/irq/migration.c +++ b/kernel/irq/migration.c @@ -91,7 +91,7 @@ void irq_move_masked_irq(struct irq_data *idata) cpumask_clear(desc->pending_mask); } -void irq_move_irq(struct irq_data *idata) +void __irq_move_irq(struct irq_data *idata) { bool masked; @@ -102,9 +102,6 @@ void irq_move_irq(struct irq_data *idata) */ idata = irq_desc_get_irq_data(irq_data_to_desc(idata)); - if (likely(!irqd_is_setaffinity_pending(idata))) - return; - if (unlikely(irqd_irq_disabled(idata))) return;