Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3772412yba; Tue, 23 Apr 2019 09:20:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzE1ORl73oTuhpHfIjT6OysLBCjD6akE8HslEm/sQOgj+62WdUhn7eXY8rlkG6n+r/cdJoz X-Received: by 2002:a62:f20e:: with SMTP id m14mr28684800pfh.228.1556036456580; Tue, 23 Apr 2019 09:20:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556036456; cv=none; d=google.com; s=arc-20160816; b=ko3jp8jb/qgaABZrx/+tKpgPf4judXbDF6Iu9/EdEqyp57wUIJDFwdEnbfHyDRUJU6 dwFooc3xGMcBhmDMqhvj8GsZLt7KLO53/6S1lQo7xs3djpiEyfPWRqvatQMHMYMKofLJ jinvEB0TnEahtH3bIHIMnABbte56FS6TL+VkscPUmgm34Vnu+AwsxzG1W9O3nrboy9aL 0ybKafO3u8CXrHe8W7Re/phNlJc55llXDiqvGKigODKb5nv2EY/vI+Q242u25C6mO5kj dew9YgMfGlyzw7mS7L9EqFsGnIpnflyF6Zd7qWKzJJeGpbB9HU6Lhh2Yc2cxxcdoIMwG BoRQ== 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=5YlqB4t5Oeylx2eqRPB5pvKArp3TlTYkhE9cZx8QlnU=; b=L5YFtzjAaAan4aedYqNfcFf0T6K8m4PVBSZc+FTiBoe+AEduct/0WTmJ0Lff+JHM4C BbLvvnehbQyzBmlyluc1sb1vA7DZ5NXzS8/c3vXb7m2EOvXMcz49tTfKQxeW6tYYayWN nDX5jo6nhJ8PzJKl5NTxd7wBhUdEzxeJdKSTGeFvNej6XlV4mpNfeQcrX8MKXHgX2I3P pGAUnqSuWG6/Ms0MlNgViO+9s9XCXludvWRnwWFSqRSg63T/ZroEh1gPkUNS6O1iGwx3 ebNwVlr27K8kXSzAVKpFEAFmtWsdrCE0d9sPx0k9+og4m9Me4qnBajEWr5v5L943uIVh 9mNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=KkeAQpww; 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 e6si15257363pgc.62.2019.04.23.09.20.41; Tue, 23 Apr 2019 09:20:56 -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=KkeAQpww; 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 S1728569AbfDWQSg (ORCPT + 99 others); Tue, 23 Apr 2019 12:18:36 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:34344 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728523AbfDWQSf (ORCPT ); Tue, 23 Apr 2019 12:18:35 -0400 Received: by mail-io1-f67.google.com with SMTP id n11so13072862ioh.1 for ; Tue, 23 Apr 2019 09:18:34 -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=5YlqB4t5Oeylx2eqRPB5pvKArp3TlTYkhE9cZx8QlnU=; b=KkeAQpwwRNnbuzH4io511LGOK6N1BulJ8fFIKkva9ZNVsHZNLqei/b+UVXttC04Pf1 5iYVSXOlAk9uItON67O5u27al8JPb7RUze7WEyvbLUSoGoVC34qwWU0NQ3OBNXl4XX1F TtM9L+ZvxvkWs5sCNC7fWfcbugt041wWIC6G4= 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=5YlqB4t5Oeylx2eqRPB5pvKArp3TlTYkhE9cZx8QlnU=; b=ds1vqf+DH17j10AFiguKl+l9WwHodmto6gYYb19SogsOwBrhG3DKFonX65SqAZ9SgM 6PY5epItJ3SBcsMJAq+M2tBEYqIf1KZBkPLlznknZLlHgOBP01Svhapi6HwalzUJ9fQ8 CsyF7idFAUy39isLgK08udsxG3JSmAP0oK9ou9gNGbkDMMnHOgog7EKwgTXMzIJNW9tk gzLubTla4UnR8VM6BOioQB4voRMEMCwJI+usV5PSa1OdZzw3MyErsHNIc9RIj54Vnyf9 PUHQMK0ECgM3wiueoRolygrLs1Dgh82mIrppc2gKHUxEYg0bRwzM4EHWvX5iBWmq92xk 5FSg== X-Gm-Message-State: APjAAAW9rPFIINaXQT2lZIs1YRyTuyTH0jFBpiYNsb9/9XlO8nu/XL+2 5FaLSMAu5vrSoxisItKlhYxN0Q== X-Received: by 2002:a5d:8196:: with SMTP id u22mr16662558ion.202.1556036313802; Tue, 23 Apr 2019 09:18:33 -0700 (PDT) Received: from swap-tester ([178.128.225.14]) by smtp.gmail.com with ESMTPSA id f5sm2327578iob.58.2019.04.23.09.18.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 09:18:33 -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, subhra.mazumdar@oracle.com, 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 v2 01/17] stop_machine: Fix stop_cpus_in_progress ordering Date: Tue, 23 Apr 2019 16:18:06 +0000 Message-Id: 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 (Intel) 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 067cb83f37ea..583119e0c51c 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -375,6 +375,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; @@ -383,6 +384,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