Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp43384pxb; Tue, 2 Mar 2021 18:28:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbwSR47qA+83uVy2DYTXftSxKLUa6UdJ4LvgGw90vvKMSzn8PClCVpuqrWlr+pLndp/5jf X-Received: by 2002:a17:906:3052:: with SMTP id d18mr24047414ejd.530.1614738532000; Tue, 02 Mar 2021 18:28:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614738531; cv=none; d=google.com; s=arc-20160816; b=zEPq2H0rDUG5pfgDt6B3ADk4t1x76PezBvXjkQz/ZmyUxgDwRI/RHpNvvS6ZU0C+tf m6OgzCvz73MqhvrnPLD7xd8fZ2Zd+lJnZuJlsChKC27JClGkLNhPwGq53D2TmZ0/cvwB JIOO7JMVjIKyG44Ouz6nb69/HgJ94XC2rZ36xiBo4vUbt5m4m0kOGfGOWKwRxSV3Sg9K BV6oBT1OWDAByu67AVi/QLr9yjbopjsLHL9UiNP6SshwkfBUMlYuPV4OoMfHtcEH6LSY wgWfSVKabs0PYKJrOrwCQdTtG0FpAT47E8b+0V8udNkNDC+U94lGCwLOXK2f5EBez9Vz 1z6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=+hz1wJcLAYNHFJgzU3OU4jiBvPybuLQJlRGaQTUJ23g=; b=maE5XnAzIEOebLJQu0PEvMig/rMrIU6X0p0+ZwFlmVwyZKsRAlYXL2BPloQpVHmKbr ANMSmmIPVhnFnS8k/gqtboDpTY9gv5iZRRcU69kvyQIs4dJ4ERJE4OfthcgmAlMOkxQl hed48JzVBIuslfStg3c8u2yYkvyHcaOE98LWZVftSXZ3EaUakhiW7FlZt5Z9IOdgnj4p yCG1x5DSSSNy4bhQ9OL1I2GcxY2fvqq1q9e50JIRAPvk8vjKw6tqu6/O6eX+qTNZUlne XtnawlC0tSLPil8/eHlPZ8c1yolj1WP6eiX3xLoGOC0R+vq8b0HsV9x0+ywKN0r/oov/ JOvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uAOIvn1P; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb4si13620161ejb.642.2021.03.02.18.28.30; Tue, 02 Mar 2021 18:28:51 -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=@linutronix.de header.s=2020 header.b=uAOIvn1P; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233420AbhCAKR6 (ORCPT + 99 others); Mon, 1 Mar 2021 05:17:58 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:58274 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232276AbhCAKQ7 (ORCPT ); Mon, 1 Mar 2021 05:16:59 -0500 Date: Mon, 01 Mar 2021 10:16:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1614593776; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+hz1wJcLAYNHFJgzU3OU4jiBvPybuLQJlRGaQTUJ23g=; b=uAOIvn1P7krq0205V1nX7suykKQS4Cln5SFE4hv6oNdXuy6DWUEmsYO7kbKhmN1UihoSTa GuA7MDPr4/gDpcAXQa6RsoPTUhgol0wQdtp79XbpKyhwg7cznm7GWiCN7giVxXpeKqCQSm PHlMiRWUtHWWpVCD521AedF+PCKG83csZfeyZPN0pThtSJduIpFAGJgdi8R7m++1G3VeXK bcnV+HCLdbH30BxtK+XO6eBfYMSxoqifKDvi4FvidMCmiwUFc4jBSTSxI01WXap/soZ8uO zlONX3xrpVbQHhXKaV9BBsz093a0a1VHSI/YHWT61LWjumyaPyRWR+H3jPslfA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1614593776; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+hz1wJcLAYNHFJgzU3OU4jiBvPybuLQJlRGaQTUJ23g=; b=m8rkJla7zB6AghKSbruGpjFvQQmT/E1maQ52Oo0BzfH+D02QllbGekzrjLcgpYI13Np8NG CEQsu3bY6jxZFWCg== From: "tip-bot2 for Mathieu Desnoyers" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/membarrier: fix missing local execution of ipi_sync_rq_state() Cc: Nadav Amit , Mathieu Desnoyers , "Peter Zijlstra (Intel)" , stable@vger.kernel.org, #@tip-bot2.tec.linutronix.de, 5.4.x+@tip-bot2.tec.linutronix.de, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <74F1E842-4A84-47BF-B6C2-5407DFDD4A4A@gmail.com> References: <74F1E842-4A84-47BF-B6C2-5407DFDD4A4A@gmail.com> MIME-Version: 1.0 Message-ID: <161459377595.20312.5845647845735679377.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/urgent branch of tip: Commit-ID: fba111913e51a934eaad85734254eab801343836 Gitweb: https://git.kernel.org/tip/fba111913e51a934eaad85734254eab801343836 Author: Mathieu Desnoyers AuthorDate: Wed, 17 Feb 2021 11:56:51 -05:00 Committer: Peter Zijlstra CommitterDate: Mon, 01 Mar 2021 11:02:15 +01:00 sched/membarrier: fix missing local execution of ipi_sync_rq_state() 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) Cc: stable@vger.kernel.org # 5.4.x+ Link: https://lore.kernel.org/r/74F1E842-4A84-47BF-B6C2-5407DFDD4A4A@gmail.com --- kernel/sched/membarrier.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/sched/membarrier.c b/kernel/sched/membarrier.c index acdae62..b5add64 100644 --- a/kernel/sched/membarrier.c +++ b/kernel/sched/membarrier.c @@ -471,9 +471,7 @@ static int sync_runqueues_membarrier_state(struct mm_struct *mm) } 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();