Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3528342pxf; Mon, 15 Mar 2021 11:33:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnzhDGtsg6SMLI0yTgxv+XDrdxNkQ1fWt7XyKH7FfsIcupV4Qto8M9o9xvpIqVHrLknCz9 X-Received: by 2002:a05:6402:3049:: with SMTP id bu9mr32177672edb.104.1615833232350; Mon, 15 Mar 2021 11:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833232; cv=none; d=google.com; s=arc-20160816; b=xNjKwEYv+bvjsj90wNkeDhWScgGwqKN+DJJHIlhXSE8KR2QrFlWM5YqNTKpgtqBTxY gnUWuoqgLNSfAW1AI5hRY7I5VOdOnSwsYDhjgPch9Uqnew73T7v5SLKNU43DYMqH1heG 82Y86AGjXJ3dw7G8mZFDyGmuG8w+VLip5prMZjU3GwA04xNWMJ3dN1VevGrqpMFx6pT3 1doDiDVpmTaX7v3gJP0gAl35NOIMMxzGj2Z7D0uDzMwsnkcrGxYxMyuDgJacBpXJJMXY ejXHQjBNOCJXWRdJrHnosn/6VD4HyUA6rnC/henugZzPlAy3ThhFpHl9ZgB7iRmAl3c2 Ypig== 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=GNFj9Hys99KZwOMMICKXtp3jje4dgzLgIceFaroLFzc=; b=KdLVTbVWz/ktb/jlukVqya/2DQ0f1Gu2wC+xNBLdXOYDKQjFSVmLh5P7yLkfZZ+Sef S2vReRW5i+xmnSZU8ve6b2Z0RN9Bmcso4pnbzp0JZ4P+ur46/0xmG7Qqbgv5IsFnljR3 FgwSwa5NBcBm7MsTGJ4a9EOku2XGpIi6x0I71C+MRZO9SrQwuuT8MJeXkqierd7B25o4 2GE8cVRoRf7NyHV7tAbh3ZfwVz3nKTA7+aBVWKyl+oz5VBcaTPPBkBScGYEfcUtJLHgP k2mA/HlvTn/vqc5KQFNNspkYhiP+Nf3B2l/4lKxl7jBKrZJmLXJWSxSeTSG9Mw+sMz5B oX7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zW9GCTYv; 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 dn18si10754136ejc.590.2021.03.15.11.33.29; Mon, 15 Mar 2021 11:33:52 -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=zW9GCTYv; 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 S231366AbhCOOpB (ORCPT + 99 others); Mon, 15 Mar 2021 10:45:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:51650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234530AbhCOOEM (ORCPT ); Mon, 15 Mar 2021 10:04:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 521B8600EF; Mon, 15 Mar 2021 14:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817051; bh=r2UAjOeMn+72T6EI3NXNl9nT+pi26cLFPqm9+jlfKg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zW9GCTYvXA3ZUoiJsOXj3IyYh22pntxPWLey/s+sA+iN4oCUyCMZtGS+Jc1BF0cOF D5qLgobap3y5UbGvNY04stY849WReHbJqdynmkL1Q+93PDpC0f6E+EnRBiZ3faRbwW eTSbiwhVy2XjWYzoxyTMEkZZwfnmGbfWAqEkIx9c= 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.10 263/290] sched/membarrier: fix missing local execution of ipi_sync_rq_state() Date: Mon, 15 Mar 2021 14:55:56 +0100 Message-Id: <20210315135550.905336188@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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 @@ -332,9 +332,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();