Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527412pxf; Mon, 15 Mar 2021 11:32:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzxWqIHbuMUEsSm+RCdG6uNNRl6neQmZ9v2ottchtmjo7p994PDNZHEHNb7qRz5ocV8J7q X-Received: by 2002:a17:906:f44:: with SMTP id h4mr24656276ejj.204.1615833158735; Mon, 15 Mar 2021 11:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833158; cv=none; d=google.com; s=arc-20160816; b=PKuNZNBGz7Gkc3NAG6WKpxjt9q0XOeQoCRtaoVqZS3dVfM9uhfcIJdOU8p1ziSYjcy IzcSXDM9QDPpyfATdUNq1cFTzgidfebrE8VhNguHsaRegqORlSusOpT8ytJuGEHJjcGc YSfoYkWy4wDiaUq3I7rHtVPR20xOTePTZReK7X3POdlZj0tq4Wn7Dx6vBxj9Z4E2HW1Z ps7UYWLtHyYH9Yy8CSsFJzKgPu2fgqLwByy+LDqEZt6HETKiVEbeZLvloYDzCSfMJZsa Aj9aXs4rOFZX8rASJzKEIIbzYiifldVzHQKvwSQIJUSm/m05LdH8ETqZSeZvwf8NWils sFuw== 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=AUOg06c9Y/EymGekrUbIggjBirGAnnQULS8zt6nVW3Q=; b=h4Q1B+mG5iSV8xDLobFNGbCvwhOfJd5GEBKXceAkws63KXwwcIrJzkq5FfCNn2l97J +704E5CoWOIj+bc5lbTbhjBBH5Wh3DPJXH86QsAve1JXpiNYVTJl3kkX7j/deOssYbLM nnrfUadI11UqybOqSHsY1XFot85u8K/xsM4MPg9Xq16TkVzstzZJ1c9KFHVBnSp61BXa HBiE3X/bDQ10UPwouwlooD9zlQj+3hDO7a3hKeXCK+yg4YMECe2wQK5aZMCXmwESqiz7 9f+tBjHiSOOiKHHqIzRjulV785NKSzSe528h9S7H269HiLdiwMtALsKKUnzrn1IgDSXE hZDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ne4J8DPn; 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 cw19si11289705edb.211.2021.03.15.11.32.15; Mon, 15 Mar 2021 11:32:38 -0700 (PDT) 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=Ne4J8DPn; 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 S240494AbhCOOiB (ORCPT + 99 others); Mon, 15 Mar 2021 10:38:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:37476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233303AbhCOOBX (ORCPT ); Mon, 15 Mar 2021 10:01:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 437B964F4C; Mon, 15 Mar 2021 14:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816861; bh=ymXPU7eyKX4VD6ej22W5UdfweekdAlrmG5I/6QPCzbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ne4J8DPnuSvtdvmdD6w5EafYf1Oh2wyK6cnk4qYsp+tx9dSBCjv831OUapGO9O8AP JWF2d+O2zcOlqKyd0cGo+5Y+ivfkBaL2EP5QeItZli9lBlvxFyx+D+llPWmTB1fIa7 c064dJkB6EwABOlMKmuF7nJ9FvkTzj10FPsA+yFs= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nadav Amit , Mathieu Desnoyers , "Peter Zijlstra (Intel)" , Ingo Molnar Subject: [PATCH 5.4 157/168] sched/membarrier: fix missing local execution of ipi_sync_rq_state() Date: Mon, 15 Mar 2021 14:56:29 +0100 Message-Id: <20210315135555.505804803@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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: Greg Kroah-Hartman From: Mathieu Desnoyers commit ce29ddc47b91f97e7f69a0fb7cbb5845f52a9825 upstream. The function sync_runqueues_membarrier_state() should copy the membarrier state from the @mm received as parameter to each runqueue currently running tasks using that mm. However, the use of smp_call_function_many() skips the current runqueue, which is unintended. Replace by a call to on_each_cpu_mask(). Fixes: 227a4aadc75b ("sched/membarrier: Fix p->mm->membarrier_state racy load") Reported-by: Nadav Amit Signed-off-by: Mathieu Desnoyers Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Cc: stable@vger.kernel.org # 5.4.x+ Link: https://lore.kernel.org/r/74F1E842-4A84-47BF-B6C2-5407DFDD4A4A@gmail.com Signed-off-by: Greg Kroah-Hartman --- kernel/sched/membarrier.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/kernel/sched/membarrier.c +++ b/kernel/sched/membarrier.c @@ -265,9 +265,7 @@ static int sync_runqueues_membarrier_sta } rcu_read_unlock(); - preempt_disable(); - smp_call_function_many(tmpmask, ipi_sync_rq_state, mm, 1); - preempt_enable(); + on_each_cpu_mask(tmpmask, ipi_sync_rq_state, mm, true); free_cpumask_var(tmpmask); cpus_read_unlock();