Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp113446ybx; Wed, 30 Oct 2019 12:10:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGa0DJmAjP6msW7C714eLoTsJCsDgG+50zxVdvEmE50XuKG++mIalc4VwB6NaeRql0QN5E X-Received: by 2002:a17:906:c801:: with SMTP id cx1mr1214087ejb.266.1572462625092; Wed, 30 Oct 2019 12:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572462625; cv=none; d=google.com; s=arc-20160816; b=MHe+3y/16K/e0stRdCSQ8CmeHKqE9JciQHa/456cZ03Dj+4RJvzwG6EskxuvL/xsy6 jrNKrTY/+IoU/6/H7rsHjV2DyVxmHOO1HjaV6pxb7/Sw6qUfROQEC0bUwJ0ZAM0YvBVa DqmOw2ULv28Q0S6b8mThAGQflNGaTIJ8iEA67rnkxfRjGkILR6bac6OkEQPCUjwIxkLs tKzkvJoxdkvP7qWMZCTfjI01sIC/NG2hZ65YRG2+s8gaPGzxLVBCyOJdyymwXpCnkltm TqMPPAEwEhTovHz8wST9usCm1/WhvQ5uaSMn+saX40td35Dyd59pEB3W6/ZBqnBZsZtJ Onbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=UAcDNxbsHyp6817IEPmuzBCq+EObPVndn4RGShy3l04=; b=WjHrMY5ecOSKsKOEnVuPNFOitscqHfoGEzzJzseptiLxwboBrP9mWLotXprBWuC2Pa AqCuVXxRheZgbxV7ztZCOyALcNADNMFS0sJfPm6kxwS32cbif4WuVUhAkcLRx+K/l091 upti2mMjLngyorTCHpkj6de6L3qScgmz0Q25pcx3i/FF56WcpOgNZU8QfbdxiZGaqi/o l8fsi7Z6AhgQkU+oJmg0FgSs47YN7h6HgkrD5e+2zk9ZAQaoYalgmueeXgLmgTmmw6A3 xtNL3cYLXjRqdbiXJdKFpg3Y3AQMYsQrBe8nRJkO2KaeJXExRCnGXDacRhNl+qK26pSN MFdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b="UqN/glHb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f19si2080473eda.435.2019.10.30.12.10.00; Wed, 30 Oct 2019 12:10:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b="UqN/glHb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727644AbfJ3Sd5 (ORCPT + 99 others); Wed, 30 Oct 2019 14:33:57 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:43408 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726973AbfJ3Sd5 (ORCPT ); Wed, 30 Oct 2019 14:33:57 -0400 Received: by mail-yw1-f67.google.com with SMTP id g77so1179344ywb.10 for ; Wed, 30 Oct 2019 11:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalocean.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=UAcDNxbsHyp6817IEPmuzBCq+EObPVndn4RGShy3l04=; b=UqN/glHb2+oS0U30aEukrVIc5WYNVKImT1rr2eKuX4KJSu9753FFW2yorN8CpQidy1 UtF40MQzG0X/XWKez440BeIWKreETp4ifFuRwAU51XX9zoug0JC18+YV1VIa2ALvLU3F odmg8GPx2g2O5GL/lmw/wQ5MY2+Fc6uAz32ts= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=UAcDNxbsHyp6817IEPmuzBCq+EObPVndn4RGShy3l04=; b=F3pyPrMasqMNsibpo9iIMu5Sbd9q/r2bkfBC3izIdW3mZ9id+HedRF6qU36ltPFVTT +DcJoz/FHOTB0hvOlSMDqFdaWvxVDQIXLPpqO5SWLm8fr9ATOhEN6AX8RdI/m8kT3Iau ItjTwBQhC8yD1I2LF/zQXNPxaJUbIvf5Qx8ujT4U4M4JQqH5EVRyUoS4tT0J/yOHtbog bGSqaqzApSDkKiHywwpyPBScXifJxzVVHRETGYMITYdth51Nmt/C0gWjaqfKBkgP6zvO BquPsNBFNlulxA+dS1fPiEFwT27OBvOwVAlyrBe+EO7SHrscjAIG9fw5mev4J1Us29JF os5A== X-Gm-Message-State: APjAAAWdI8Pa/IqUNeX//D+qKzbxIZzCBQPNibaSmIjn+KUz8cGLnRg/ zqw3HJStglrqC2CusXmA9tsNvA== X-Received: by 2002:a81:5ed4:: with SMTP id s203mr882046ywb.340.1572460436197; Wed, 30 Oct 2019 11:33:56 -0700 (PDT) Received: from vpillai-dev.sfo2.internal.digitalocean.com ([138.68.32.68]) by smtp.gmail.com with ESMTPSA id u7sm1020549ywu.45.2019.10.30.11.33.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Oct 2019 11:33:55 -0700 (PDT) From: Vineeth Remanan Pillai To: Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , mingo@kernel.org, tglx@linutronix.de, pjt@google.com, torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Dario Faggioli , fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Aaron Lu , Aubrey Li , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Subject: [RFC PATCH v4 01/19] stop_machine: Fix stop_cpus_in_progress ordering Date: Wed, 30 Oct 2019 18:33:14 +0000 Message-Id: <94254706c6b697b6351d604642c404ace101d3fb.1572437285.git.vpillai@digitalocean.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra Make sure the entire for loop has stop_cpus_in_progress set. Signed-off-by: Peter Zijlstra (Intel) --- kernel/stop_machine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index b4f83f7bdf86..c7031a22aa7b 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -383,6 +383,7 @@ static bool queue_stop_cpus_work(const struct cpumask *cpumask, */ preempt_disable(); stop_cpus_in_progress = true; + barrier(); for_each_cpu(cpu, cpumask) { work = &per_cpu(cpu_stopper.stop_work, cpu); work->fn = fn; @@ -391,6 +392,7 @@ static bool queue_stop_cpus_work(const struct cpumask *cpumask, if (cpu_stop_queue_work(cpu, work)) queued = true; } + barrier(); stop_cpus_in_progress = false; preempt_enable(); -- 2.17.1