Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2338959imm; Sat, 28 Jul 2018 14:57:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdiLxogr8u8BcZqnA0pLVDDZBj8pBgMDcA4EXdZomr/z/XDl6Dex5U6QcVH9QKqXn/zZXT/ X-Received: by 2002:a63:dc53:: with SMTP id f19-v6mr11029893pgj.56.1532815043772; Sat, 28 Jul 2018 14:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532815043; cv=none; d=google.com; s=arc-20160816; b=axhZMlrvlfzfDD2K4aufrziee8cPwfjygVCW8awwBoAPLj2N31rO7h2QBuTCXOCFEg pwoOeg/cUQH63mbF/POy4kbpmOv8Hu1bVhHCmiJ11yR8HM0OLfESycsT0yyIt6p/7nUx mAG+OWyhKN31fYkWDxR/uPTpuzZLk/CK0q6uYfuLrI1p6p61Xxv70dD+D2iUllB+hdkX rJUSqe0kLiHhnXm/FuPr8i5qJDuQHyoEPOqIf0kP64PBJJZlFbQdzJsttdgtecL+HNEG WnTqQWgG8Jn8WMnaT0Dqs/imYQFkyuuYwropCUcRgB+Ic8dqpYTqJZG45w246v4vE/Re aKJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=DTu7Uj0dXfei5+f3v7Fy30RpBaCiJabQ/FNLLb7w/rg=; b=ehntl75HMEcaTY9ZYb2DqmioL+1GaaJJWgWm+1zPpOoBVXhJjKec4DyHCTQS15mf+M ofJ//6GvZ5FWpxqlr8W+Ep+Kgg9c2DH7+78t5NiCkxJUc1tPvXozk0warcbV6tH/aXrS mpaFltMYyhM+gATUTYjVUpfFURQhbsdCJaxTfG8StDoHh3QpzN7jje0kxOpfRcEWi7aN CNrjUS1WuQUBdqSAIwUKpq4DmA7F6MO3R/9zK9yl9jcZ3cnyrdMQ9zM92xxO4RYgqxxK Kx/GJY6gkvjlRVwtoR5TWox/o1iLaw7axISgJRJ+Oiwi83yMCa5rwxmtol9Qn70jl+k0 DmPQ== 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 q74-v6si7951219pfq.32.2018.07.28.14.56.33; Sat, 28 Jul 2018 14:57:23 -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 S1731443AbeG1XWW (ORCPT + 99 others); Sat, 28 Jul 2018 19:22:22 -0400 Received: from shelob.surriel.com ([96.67.55.147]:44204 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731429AbeG1XWV (ORCPT ); Sat, 28 Jul 2018 19:22:21 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fjXA0-0000QZ-KV; Sat, 28 Jul 2018 17:54:00 -0400 From: Rik van Riel To: linux-kernel@vger.kernel.org Cc: kernel-team@fb.com, peterz@infradead.org, luto@kernel.org, x86@kernel.org, vkuznets@redhat.com, mingo@kernel.org, efault@gmx.de, dave.hansen@intel.com, will.daecon@arm.com, catalin.marinas@arm.com, benh@kernel.crashing.org, Rik van Riel Subject: [PATCH 02/10] smp: use __cpumask_set_cpu in on_each_cpu_cond Date: Sat, 28 Jul 2018 17:53:49 -0400 Message-Id: <20180728215357.3249-3-riel@surriel.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180728215357.3249-1-riel@surriel.com> References: <20180728215357.3249-1-riel@surriel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code in on_each_cpu_cond sets CPUs in a locally allocated bitmask, which should never be used by other CPUs simultaneously. There is no need to use locked memory accesses to set the bits in this bitmap. Switch to __cpumask_set_cpu. Suggested-by: Peter Zijlstra Signed-off-by: Rik van Riel --- kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/smp.c b/kernel/smp.c index 084c8b3a2681..2dbc842dd385 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -680,7 +680,7 @@ void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info), preempt_disable(); for_each_online_cpu(cpu) if (cond_func(cpu, info)) - cpumask_set_cpu(cpu, cpus); + __cpumask_set_cpu(cpu, cpus); on_each_cpu_mask(cpus, func, info, wait); preempt_enable(); free_cpumask_var(cpus); -- 2.14.4