Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9184796pxu; Mon, 28 Dec 2020 08:42:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKSCRJZfMAQLeKaZcn81smH65mUNRTNGK9rlWJEcFqFvUPZh2atjasH7IPIrLtPkNZHzk0 X-Received: by 2002:aa7:cccf:: with SMTP id y15mr43038659edt.112.1609173733524; Mon, 28 Dec 2020 08:42:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173733; cv=none; d=google.com; s=arc-20160816; b=txJ01y9c28yGeNB3A6ebRTrf7xO6k4pZePDfbQ+B2GIn5iOX4ZYoe0wTI/GjfKaF3U I39mfZdsxB2kmnW/h1tWcbJxT8QyiBmSnU1CDAugvysFij2z/Kf9s/xEjWVohYHHmFpO wRenNPLrORXAuomiwah5W+bk1metdQkMFDHSrTg8DRr8nanBAiQ3mvHu6uDjNd/QZElW 56uid28ua27PHFmtHJSskTzNS08Yi8z+/GGXLjVjD2x1MTnGcSoy5pSrucsu83yahlxg C8X+T+8910CDYmMI6kNmfG3+5Op4rPoYchehkZT9XnPueeUidDNO8TLGsk5589BiE/ub nTEA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NrDAoo5X1UOTeTbgQM0L5RFV98QNGrXz6Ccdx5qvJHg=; b=aWtJCywkMSXIRtjtVjjRbHL2BBAUebWEO+EKLqSehF4NKzWzlhktlfWim3vIi3Kt0M /EqQ9nLJA4uhG5jsa69QixAI/uSKneI3jKRd2qNjmPYzZsq0749pbK2XDkhziaEzL68Q yE0C74FxQU3Fq1K98v868xmBA6YS/It8py+dBk3uLXQWF/0kQqoB4T0/QvbTqNzs7QqG SvmPv8n1TwNKiMYBdaa85phQuprt9G6ZESWxORY53WA3vqzBlfWfth6VCzjtBtNhSOXR zymJq+j4HOJgbjb4to+9B8CXxDlk+2l8IC6QqhcCPYwkvE/hNkKFRknOJGxj8DGJCdbV 6Azg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qQQPbh7k; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i24si20002330edg.295.2020.12.28.08.41.50; Mon, 28 Dec 2020 08:42:13 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qQQPbh7k; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441455AbgL1QkD (ORCPT + 99 others); Mon, 28 Dec 2020 11:40:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:55560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729338AbgL1M7w (ORCPT ); Mon, 28 Dec 2020 07:59:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17F8622AAD; Mon, 28 Dec 2020 12:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160376; bh=p8cUv/oV+lhTaejERzWhoZIIadUeGOr9m1vNrFINw/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qQQPbh7k8klgnGIt9PCpFgAQkAWi6W2qKrfU7wvAVAv/laCUVHf/86gn2ekcCMPlY pERKZkrXrpiF15enOVuOGMYOWn2W3KZXa0u8rQky+KvwJJaPObooiHLBUqUjtbHsMg Ewv5bkSDJLXmks0VM2MbyeTDh3STWtU/wPgGfHD4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , "Aneesh Kumar K.V" , "Peter Zijlstra (Intel)" , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 031/175] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling Date: Mon, 28 Dec 2020 13:48:04 +0100 Message-Id: <20201228124854.768878181@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 a542b5e583503..e005209f279e1 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -815,6 +815,10 @@ void __unregister_cpu_notifier(struct notifier_block *nb) EXPORT_SYMBOL(__unregister_cpu_notifier); #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