Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1334300ybd; Sun, 23 Jun 2019 05:18:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIQIwXn4ogkhuj/Np5fkE+p4PlMK3bO/67ldbZCecaJLRnfxHu8cz/mYPLLRQF8Wt/S9AC X-Received: by 2002:a63:50f:: with SMTP id 15mr14364660pgf.148.1561292284523; Sun, 23 Jun 2019 05:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561292284; cv=none; d=google.com; s=arc-20160816; b=GsbDlSGMPURz2B+Hxi8AAtsGE19zlGEOvE3zTqnOh+JE4qo45Ahi+iTT2KLP7+u/Ad 6Y4JBkZQD34vuEGh0XJBXgjTBh2thIeRCigHk+OevCiIJg7Awe2HdSXtQ+RXXzp20IOS tg9u4Cl0PlQ+bAAVszLc5Vg/fcoz/a5uq5/NgB+iq5JhCv4cCiT/hdu79l9rWhDZqROt 9EYiVbhnIaPwFecQdpnIpE8rDR2g+QEX1GGfw9nst5mpbqGfczeTDw0X4YtZ3DS7IAYk 2A2NaM7jRV/BqzBdiElcRSQsBhALXx4pJqJ003cO5HNzV08v3pb6fYbn/DIGZiRNjf/i x3dw== 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:dkim-signature:dkim-filter; bh=W2/TO928gvP0dcSWSbNsBo/E6mSsInsl5Qy9X27bdL4=; b=hGgKFwEsMDoHwX66iTUoZ6+WdTQgyEXbBhEuVz8QWsM00gVsT5P4JSP1Cg5DcCVgIb 5FDI34GAAWXuxyGX9b+pkK4UyWtzGe9UBa4PQZbU+roZ9mmyc/AN2m8ZEKFIToXM7DZH ZAJEQVqDRz7rawqHGMoludIDloD5U6qhzSTU0zIcDMwuiyRmnVxSvkgzyNfpbCxs8u8j 8smbfiBYLnt53vvajHr0+T7niQS5/IwuZbjhFCoP9Xug2a8S+o1EsKf7a4kzZ4AhBy5H YCxrNAsCH318KY0JUqj6NpkHKwyHqEenRA8yCiRg801/sFw7/yeiaN+Fa8bbRKfmMlR4 4K7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=QE8WrCXT; 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=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p97si8048202pjp.34.2019.06.23.05.17.47; Sun, 23 Jun 2019 05:18:04 -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=@zytor.com header.s=2019061801 header.b=QE8WrCXT; 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=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726524AbfFWMQ4 (ORCPT + 99 others); Sun, 23 Jun 2019 08:16:56 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37867 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726417AbfFWMQ4 (ORCPT ); Sun, 23 Jun 2019 08:16:56 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x5NCGFds2628585 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 23 Jun 2019 05:16:15 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x5NCGFds2628585 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019061801; t=1561292176; bh=W2/TO928gvP0dcSWSbNsBo/E6mSsInsl5Qy9X27bdL4=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=QE8WrCXTGQYhZMSlpOYvRYd02e//LcbvHYplTgFrTHtHZCTRvkhzE+lu1qpYv4+Bn LBWvhA6sQppoT/D3WXcXvc0I0jnmrqL5B2uhnbnMqD7ICh6IsKtMGSZGcV1MCNq4DH zm1/Wln7BvgcEJAjIkvNDmlk7c+H1BvXVatJqeKrrG5liEJY8pOX8TJ43OvInzDk/7 P3aUy6mBAc+t2xLKbtwDFc9U4ttDNe7BbKxqklu4mzIHG8c9NakuZYMlTXc5Zjo6Rv m/evqZJwVIQfiEowZ1qMJukwsqcA9jpJ+PauVA0JR1TqGqHnff6i8/t1UmLATgG2QE bZN8qIw/Z686w== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x5NCGEQD2628582; Sun, 23 Jun 2019 05:16:14 -0700 Date: Sun, 23 Jun 2019 05:16:14 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Nadav Amit Message-ID: Cc: peterz@infradead.org, luto@kernel.org, dave.hansen@linux.intel.com, bp@alien8.de, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, namit@vmware.com, tglx@linutronix.de Reply-To: hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, namit@vmware.com, peterz@infradead.org, luto@kernel.org, dave.hansen@linux.intel.com, bp@alien8.de In-Reply-To: <20190613064813.8102-10-namit@vmware.com> References: <20190613064813.8102-10-namit@vmware.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/apic: Use non-atomic operations when possible Git-Commit-ID: dde3626f815e38bbf96fddd5185038c4b4d395a8 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=-1.2 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: dde3626f815e38bbf96fddd5185038c4b4d395a8 Gitweb: https://git.kernel.org/tip/dde3626f815e38bbf96fddd5185038c4b4d395a8 Author: Nadav Amit AuthorDate: Wed, 12 Jun 2019 23:48:13 -0700 Committer: Thomas Gleixner CommitDate: Sun, 23 Jun 2019 14:07:23 +0200 x86/apic: Use non-atomic operations when possible Using __clear_bit() and __cpumask_clear_cpu() is more efficient than using their atomic counterparts. Use them when atomicity is not needed, such as when manipulating bitmasks that are on the stack. Signed-off-by: Nadav Amit Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Link: https://lkml.kernel.org/r/20190613064813.8102-10-namit@vmware.com --- arch/x86/kernel/apic/apic_flat_64.c | 4 ++-- arch/x86/kernel/apic/x2apic_cluster.c | 2 +- arch/x86/kernel/smp.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index 0005c284a5c5..65072858f553 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c @@ -78,7 +78,7 @@ flat_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector) int cpu = smp_processor_id(); if (cpu < BITS_PER_LONG) - clear_bit(cpu, &mask); + __clear_bit(cpu, &mask); _flat_send_IPI_mask(mask, vector); } @@ -92,7 +92,7 @@ static void flat_send_IPI_allbutself(int vector) unsigned long mask = cpumask_bits(cpu_online_mask)[0]; if (cpu < BITS_PER_LONG) - clear_bit(cpu, &mask); + __clear_bit(cpu, &mask); _flat_send_IPI_mask(mask, vector); } diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index 7685444a106b..609e499387a1 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c @@ -50,7 +50,7 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest) cpumask_copy(tmpmsk, mask); /* If IPI should not be sent to self, clear current CPU */ if (apic_dest != APIC_DEST_ALLINC) - cpumask_clear_cpu(smp_processor_id(), tmpmsk); + __cpumask_clear_cpu(smp_processor_id(), tmpmsk); /* Collapse cpus in a cluster so a single IPI per cluster is sent */ for_each_cpu(cpu, tmpmsk) { diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index 04adc8d60aed..acddd988602d 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -146,7 +146,7 @@ void native_send_call_func_ipi(const struct cpumask *mask) } cpumask_copy(allbutself, cpu_online_mask); - cpumask_clear_cpu(smp_processor_id(), allbutself); + __cpumask_clear_cpu(smp_processor_id(), allbutself); if (cpumask_equal(mask, allbutself) && cpumask_equal(cpu_online_mask, cpu_callout_mask))