From patchwork Tue Feb 12 09:27:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 158131 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3610366jaa; Tue, 12 Feb 2019 01:27:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMB6SxNKUPUy3yzd67gHL5yJeLGsIjAgTTlPURC8Mtkg32YDD1i9b9SZ9Traw34YKAJqAr X-Received: by 2002:a62:bd09:: with SMTP id a9mr2999298pff.24.1549963664880; Tue, 12 Feb 2019 01:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549963664; cv=none; d=google.com; s=arc-20160816; b=ZzNvrnSGICggK7dOVM75T0TXR9oQu/r/Mg+l1p+1ziEFFTPJL3+yqYtyPRCCKIsIwn Xev6NVJw+shucrBMzK0YgYY1hAhUJ5BoCLXmwg3DL0yfde0/C946xXwCBGoXB7Qg6ZxB 4PvUzpveaRjh/WYP9LMo9DQBvZOZ0zPV+ze6LB4zgPKAfu0dw3xvsNoafeRMVlCBUe2i fvxRjWYIQ1AdBm5eeMfQKxmVCAGXu0RXwSk/pM+saWWi0Q1F0+qI71CxAEERVYOLfspu RGYzntxqx/T7075ma7vLuDaD0I6ahBkNTUoH1v3KpRN7siafl6Ise6VYStxQDDuUExVJ cQ+Q== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=js2oV91gkpITswyRz8+4yttTulMcRdALQnRF5jRIEYc=; b=BV/nUp+stdI/RXjA7xs1MNSaRqryosIlm7VVTF30PFnq7GNQQ2scrMtM8pU+cyvyhp IM07cluQCouIMlegorTri0aTSU/DjsvufnV8l8nDy9Lisq3Lsx2dlXlNEiq+w56FMkmj w+iin2N/WqP0nad9hrgPohiT1kuFlNXSc/5/dkaUFSr1ZrhEqVaviXvYm/SsXM7PDO1V /S25SQuB9ZCkrhotikv10QMy5bWSQUfceDqcpcfKBxBqn5ze2fAzQ+CFEHbXgB3Ka9dP 2ixbiY1TjfOWb3BOvMpOdlkrHTLzSgZcFxTqkCf7YeYbR+pWCzHPYuqivxyWAflX2DZ4 /8YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Llvr7yni; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si11287125pgw.142.2019.02.12.01.27.44; Tue, 12 Feb 2019 01:27:44 -0800 (PST) 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=@linaro.org header.s=google header.b=Llvr7yni; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728813AbfBLJ1m (ORCPT + 31 others); Tue, 12 Feb 2019 04:27:42 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:35620 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbfBLJ1m (ORCPT ); Tue, 12 Feb 2019 04:27:42 -0500 Received: by mail-pf1-f193.google.com with SMTP id z15so282826pfa.2 for ; Tue, 12 Feb 2019 01:27:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=js2oV91gkpITswyRz8+4yttTulMcRdALQnRF5jRIEYc=; b=Llvr7ynibkY71NBRrPxV6NDJj7HyDNt0dJC2XSxJMA/H2xAh6cj6HxMz2DbTyIEqyX drVWryXJN8XJykdDY7L02BlNgymoFO9W7QDBnkOY192Fp6EgQd+FEX12uQmJqQ/C+J6X CHmKt25mWDsfHMki1dVYVsSQYj8frUZMKISVrr4ZvSEEkYgvOhLAbjtQlJl4ZeO4eopO UI1ndO2tGM85tRr3CJAYewmZfnK7M+wPw7j59IkS8sZYjXp4gP6HFr8+ErCacTSnSHv+ TagmqrAfBlzLYzqb42U35iX1u/dVLTPTOzv2jpITXO1ii3H7xzYOKGBfm/4JkWBEmsgG GRaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=js2oV91gkpITswyRz8+4yttTulMcRdALQnRF5jRIEYc=; b=qaDRV3ZzX/f1VlB8T55VOk1nxIJDnuU3cl4ntK7l1eHlk93kUBMhJTVlK8DiETWnQ5 vGR5g6lFzrrWKkeiu/pm26zBYft4jFXvsT17+qcL4vlelFId+6j+YvJnds69SKMIAezl Dm1/X0j1OgB+LQNfbDzvR6KN2EDu8W1BacFQsfU+KRwIorTlyf7zAjYM0cObllEbXN2D XGV2erz+kmc5JPMmMEuuNhZgsEVhd5pO1iKPItvGF4l/djMT6MZ/KJItaZurYglID+rU SInZIvMzRLAiCQGTfMlTBoohxp6BzKnapIXj5iDZbnK47R0eOd/5uUOaNTcN8XMlS983 cYOw== X-Gm-Message-State: AHQUAua6A0YmSkqRrMHuTOY+WrN1z5ar8NaP3Sc31RTspTAq+ljrQH4z VwRHwj57ukvGAR2Mj1+RETJ3WKwpqTI= X-Received: by 2002:a62:20c9:: with SMTP id m70mr998718pfj.118.1549963661232; Tue, 12 Feb 2019 01:27:41 -0800 (PST) Received: from localhost ([122.172.102.63]) by smtp.gmail.com with ESMTPSA id c18sm7661692pfc.63.2019.02.12.01.27.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 01:27:40 -0800 (PST) From: Viresh Kumar To: Ingo Molnar , Peter Zijlstra Cc: Viresh Kumar , linux-kernel@vger.kernel.org, Vincent Guittot Subject: [PATCH] sched: Use non-atomic cpumask_{set,clear}_cpu() Date: Tue, 12 Feb 2019 14:57:01 +0530 Message-Id: <2e2a10f84b9049a81eef94ed6d5989447c21e34a.1549963617.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.20.1.321.g9e740568ce00 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cpumasks updated here are not subject to concurrency and using atomic bitops for them is pointless and expensive. Use the non-atomic variants instead. Suggested-by: Peter Zijlstra Signed-off-by: Viresh Kumar --- kernel/sched/fair.c | 6 +++--- kernel/sched/isolation.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.20.1.321.g9e740568ce00 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8abd1c271499..8213ff6e365d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6097,7 +6097,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int bool idle = true; for_each_cpu(cpu, cpu_smt_mask(core)) { - cpumask_clear_cpu(cpu, cpus); + __cpumask_clear_cpu(cpu, cpus); if (!available_idle_cpu(cpu)) idle = false; } @@ -9105,7 +9105,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) { /* Prevent to re-select dst_cpu via env's CPUs */ - cpumask_clear_cpu(env.dst_cpu, env.cpus); + __cpumask_clear_cpu(env.dst_cpu, env.cpus); env.dst_rq = cpu_rq(env.new_dst_cpu); env.dst_cpu = env.new_dst_cpu; @@ -9132,7 +9132,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, /* All tasks on this runqueue were pinned by CPU affinity */ if (unlikely(env.flags & LBF_ALL_PINNED)) { - cpumask_clear_cpu(cpu_of(busiest), cpus); + __cpumask_clear_cpu(cpu_of(busiest), cpus); /* * Attempting to continue load balancing at the current * sched_domain level only makes sense if there are diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 81faddba9e20..b02d148e7672 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -80,7 +80,7 @@ static int __init housekeeping_setup(char *str, enum hk_flags flags) cpumask_andnot(housekeeping_mask, cpu_possible_mask, non_housekeeping_mask); if (cpumask_empty(housekeeping_mask)) - cpumask_set_cpu(smp_processor_id(), housekeeping_mask); + __cpumask_set_cpu(smp_processor_id(), housekeeping_mask); } else { cpumask_var_t tmp;