Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1930051pxu; Sun, 13 Dec 2020 07:56:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxATstrRXBnt/m/2WDeiOZakKhFhtbgt+ABgsyfimstN92eKty8+UN9axyVuXjJw1J2AOvu X-Received: by 2002:a17:906:d62:: with SMTP id s2mr19367102ejh.61.1607875015000; Sun, 13 Dec 2020 07:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607875014; cv=none; d=google.com; s=arc-20160816; b=0akAvt9+tctJJYc8YWkSADxUdvWHl0a0p3Xrkya7eWSpRlgT08xMCMqOIP91v/bPWl Zx6oqh2gBdQcFBD7s7lsJABGP4HMOsZ2D/eikLSkRgDWH1nlmJOFZAbHSmIZLr9HD2co 6xdEbLaYV9CJkm1Ofm2WDZuXGt9D5Q2iILZzr7JdkDJDyL/ick1SltRwXE8+ahAW7HaR zKd5yYpihzI8OD3Jn89GGyU/LDrhKVVzCdAy4UHaBS5nVJ7nl/6n2RI4teLiC+oYHWOO wlAVgfVUixOCi1HhUzAh/ZNdc/w4OhSq6h2KB6rOPQKqG42T3UY4CMIWg19NgrpceS/x /VLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Kk5kbcwuD/uvtKdAP3FML+yhUjLimx8fUFCJWO7L5tA=; b=zvllJwSysfWGiyCVaMjbkoSNBlykpL5/I7Mmu/7yVsbFZzVx5NDOeGXu27Lo1SAcky BPiPZ6/hfGjBZjz0YPl0UzdhkAtdy2Y2HcFNtEYlwffHyXFAJYELtY3RI5tNinkEqn5Z lvvoNYcYqpsohQqMalcIvBcO+YXbkTBOgnhCE6LmqyDJ3ieYuK4bPF+acejlIeaB59JE ySkLnR6NNexJdOKvAmICJ23o2U9SRSrN6uDiEV4OcsfJZH5h7LKDTFI5Ye4JaOeKeDv4 YZapuA1vRmSqSaL3omOjx/jRZdltNv27YPhJBDbyHfBl42E+DHoe2hMeUE8I/c6lXrZc rX8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si9199965edu.601.2020.12.13.07.56.32; Sun, 13 Dec 2020 07:56:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393459AbgLLQLc (ORCPT + 99 others); Sat, 12 Dec 2020 11:11:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:57714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439381AbgLLQJg (ORCPT ); Sat, 12 Dec 2020 11:09:36 -0500 From: Sasha Levin Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicholas Piggin , "Aneesh Kumar K . V" , Peter Zijlstra , Michael Ellerman , Sasha Levin Subject: [PATCH AUTOSEL 5.9 07/23] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling Date: Sat, 12 Dec 2020 11:07:48 -0500 Message-Id: <20201212160804.2334982-7-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201212160804.2334982-1-sashal@kernel.org> References: <20201212160804.2334982-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Piggin [ Upstream commit 8ff00399b153440c1c83e20c43020385b416415b ] powerpc/64s keeps a counter in the mm which counts bits set in mm_cpumask as well as other things. This means it can't use generic code to clear bits out of the mask and doesn't adjust the arch specific counter. Add an arch override that allows powerpc/64s to use clear_tasks_mm_cpumask(). Signed-off-by: Nicholas Piggin Reviewed-by: Aneesh Kumar K.V Acked-by: Peter Zijlstra (Intel) Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20201126102530.691335-4-npiggin@gmail.com Signed-off-by: Sasha Levin --- kernel/cpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index 6ff2578ecf17d..2b8d7a5db3837 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -815,6 +815,10 @@ void __init cpuhp_threads_init(void) } #ifdef CONFIG_HOTPLUG_CPU +#ifndef arch_clear_mm_cpumask_cpu +#define arch_clear_mm_cpumask_cpu(cpu, mm) cpumask_clear_cpu(cpu, mm_cpumask(mm)) +#endif + /** * clear_tasks_mm_cpumask - Safely clear tasks' mm_cpumask for a CPU * @cpu: a CPU id @@ -850,7 +854,7 @@ void clear_tasks_mm_cpumask(int cpu) t = find_lock_task_mm(p); if (!t) continue; - cpumask_clear_cpu(cpu, mm_cpumask(t->mm)); + arch_clear_mm_cpumask_cpu(cpu, t->mm); task_unlock(t); } rcu_read_unlock(); -- 2.27.0