Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3529453pxf; Mon, 15 Mar 2021 11:35:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQQ8tePKckxbZDstVECLgjT6XiDVMnNopqVz5o8Ax/zKaTQVWNh/UwoC/vOP4qu776cKlu X-Received: by 2002:a05:6402:4309:: with SMTP id m9mr32556380edc.25.1615833326256; Mon, 15 Mar 2021 11:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833326; cv=none; d=google.com; s=arc-20160816; b=gQn8BGWYZad1cl2XVw7tS89loDjMx79eRseYYEIW7tnzfWKda/GXPSoZjn6PWo1KQU uuWezOFI6/XDoJlrZrL0NTNuoBRquP+E0PKmSwUCh7J9owpqN/KgFP4gJvz+SENYhHiP 9/mliDsHV7U0xQgUEg1YfBsbOQJZgYJFHbZHeYk5SeHqDbilPUTb27ipMefl4ej+JWWO 9JORHs10dBYGozqcW+EncDdIoScR+p/iJwb+vj3oLK0L6fdWPd93zB6VOkGqFI8bFP0u yFXxJBn2Zim4BVgkdnXCuGIeEyYpp5Imr7GizMafXhSl9lP2No8VRj1lmQA9MZgNwNvx kV8Q== 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=R5m0EIMYZTBpT8l5Gwp3CD7UW8ekWUTXNLaYMp/tFrM=; b=gYR9J7CTsFo13vYuCW4PFl6eIO3t25kj/PwBF+LhemmW3viCHByUgVRtHuOQgvUwKq RLMRdwH22JTfriw9y30oHY9J+kJbD1SpvzJ10lbo4cogAK1RH1o9PB+mLGRWQ0GgEhln /7aRWXHB1dwEDv1ENbUSjfyd/3jH9P1HWOThm47R89YSEyCXcXRF0VybKqRnWPShgjQ0 jH816/a8cT1uZOtd375aiNOn9+zlJXv0Pae/UBuGZtBKHC5/RdHAkYP3EgmYznVdzLsu hmfLE90SqU8QGbmGnqBmlVaH6yjMMqpInX10x6kOKuM9ODoXob5k9c86pwwdBbJH6Mmm DG0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CqiT+lUU; 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 g17si11746970eds.403.2021.03.15.11.35.03; Mon, 15 Mar 2021 11:35:26 -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=CqiT+lUU; 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 S238775AbhCOOo7 (ORCPT + 99 others); Mon, 15 Mar 2021 10:44:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:51322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233818AbhCOOEH (ORCPT ); Mon, 15 Mar 2021 10:04:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E89E064F14; Mon, 15 Mar 2021 14:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817046; bh=VAI+JS20/fut6PfLINwRKqo3fVIlRUWYxvJi9LvGuD4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CqiT+lUUoqjMECW1tAKB2WN/otEIN7mJ1j6FyLJbXbBDedSUoiPg33+zUXovLt3Q8 JedE9LUTO9NGDevLqvMiXPNnj0tu796WU1uLwRC9aYDgBzYOLQbEl10/5+oBMY2a/7 tul1G1hYN751tF6qRXqd7obza7Vo3CgMO+sSd/yQ= 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.11 273/306] sched/membarrier: fix missing local execution of ipi_sync_rq_state() Date: Mon, 15 Mar 2021 14:55:36 +0100 Message-Id: <20210315135516.889665733@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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 @@ -471,9 +471,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();