Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9447651pxu; Mon, 28 Dec 2020 16:55:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyxcuhIzI6iSLHym9SvjSlSZy2xh4lNW2WDiROqpmcJ7YfrykB1x5VBffllBw6Y8x0BoEx X-Received: by 2002:aa7:cfd7:: with SMTP id r23mr43938426edy.298.1609203322544; Mon, 28 Dec 2020 16:55:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609203322; cv=none; d=google.com; s=arc-20160816; b=XegP241eFG3gfIDbVcr8tZfiQ/gLUkrjIYjWp6G/5mdDkafCHrUpSO+NDJVZoLMr2t KY9PH2WV1IT9tBYG1vjL4nB6EQZqpxcK+oQiy4YsQOg28b5crf7bClC3HLYxQ7rWLX/1 qFgCenA9WJcTpIbGoJlDr9zON6675oVy/3RXGVvM/7a9ccCg4jB1rs316AdW2lmf5MGX hOGcPE2uK0M031e1aM9UOLB++1hrRqdANiRTulAcw3E93K/ZX4yxsMQDK9SxuRn2HF12 NUlJ6pl19anSs0qh5yqvHIO66poGSZfruWMS9tTQNtxRRtnOF8L1Dda1YRZpS02LnghO 9OZA== 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=r2xNSmVqfwE29ToQORbmc67wafe9oCAxYZrZGhSB4U4=; b=D4prOrW1Nbmo92jIc3wB4E/wRxGNfGXfNRWuBS0TYJMQKhCzzCuKWRvuOSTQRG6zpN /l3eMQAdU1CzpcuHEup3iRVT40auZal3/Habhea1dOXxeB9YiGJ8MD0sudMr+jV0sYds MB535w6JQI4L0NAcDdu66jP+R/PW42fSJffr4HWbpIuqxJQ2uxNyvct0INWOR38YcVSG eLo6/akViq4Tv2aKGFPrFSWHLVhnSxY/0UMALv4OHFvb4hOqCy26icA2NEwmV2DfUV5w TLa+4hUbywa/M2Wllssc/+ctWct3q0S/kDfRcvdiOFwXzs3FhWX9Atvv/rwdgOIKSSB4 Y7/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OM7aJA01; 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 i2si20596233edv.606.2020.12.28.16.55.00; Mon, 28 Dec 2020 16:55:22 -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=OM7aJA01; 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 S2394139AbgL1QLm (ORCPT + 99 others); Mon, 28 Dec 2020 11:11:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:50950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388346AbgL1NWs (ORCPT ); Mon, 28 Dec 2020 08:22:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC680207F7; Mon, 28 Dec 2020 13:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161752; bh=k4LNBYdqcC/d4phPKsQg+G+/GSM6jXgB1CblEQV7WeI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OM7aJA01wrrbShJ/UWLGKrys9zVkOcgbUKU15YS5stip3mjOBTO3VYrRXHQtdOlr8 TPdnLRAn9yCkaSJDHqyCQR6jldjJYPDJlDz+UnOBiKvIotJhid76iqSLWOFaa4lL9Z v/vdjLaolLpGVE3xE0uSflJ4WLahKzWl1VDd+cE8= 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.19 070/346] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling Date: Mon, 28 Dec 2020 13:46:29 +0100 Message-Id: <20201228124923.178774895@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124919.745526410@linuxfoundation.org> References: <20201228124919.745526410@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 08b9d6ba0807f..9a39a24f60253 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -776,6 +776,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 @@ -811,7 +815,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