Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6677434ybh; Thu, 8 Aug 2019 04:00:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDWPTIcFFGUoSnge7tsa66r+YUAgpbsAN1cPXNrwtL8Y2FE6yjH/NgB1Kbe+K5VpdNbm++ X-Received: by 2002:a05:6a00:4c:: with SMTP id i12mr15005256pfk.134.1565262046966; Thu, 08 Aug 2019 04:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565262046; cv=none; d=google.com; s=arc-20160816; b=XSsnWq6epHaYYiG1uECSI3sCVkZuI5ll+90UspUI7eD8JA8eA5tcavQ11p3XliJqIi nja0RPiXHWv1jBdpp2z2j0v8QAEcmhueVu+fNMa2+BvKsIa4cIFy1HJm7bBJT1XmJC+p x/ULTcZ5eF4pFtskV7YYZX9e8yT1YZf7Muks37bzBsBN0Z7A29HW+j6lOJ1a2U3TX5Oh yH70B4l354AfiWU663mlcUkd8yOhW9Xy2euh8lugftNM8dKm/5Pvk40IQXOaiv7XPnQt jTT+z2nScRpGuBmQqTuhwD6/O23xx9X/SgCJ/EAhdXQ6DOj5Ke/ugM1LCHNkCwJcKhX1 K8Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=uzbeeHqVgjUyiCK6krtHxJDeX6i1CDXl0yqQghz+kjM=; b=0LtQqYXYqrAYwo9h8QfR5XtqJVEnhwyAQ/nxxiReZd+F0TH+FVK3xAEesoVSudsbWs LKFscXcXXWohsPsThR5xycF11mxvWLGM8rc8TKw0fmbffWDYjvpQAjztg8l+SaaNUyW0 0rpyU3tQWbNHeBcKixUgNVuM8/l2DZxz4aa9B21fh2suCPZzoKxAYRx4558ROZUlxsJN 3HRUdUhDosZJrBI4V/LGYNogUdNIujz257ZTkjbFxmIcFbzk3ABtr+g92GgRpFnw7mBb EyrC6IT7UXu5gOswtBkYg4tnyeY0EIw3cYkZLluROfArMqz9CFCqxrw5By9JLwtN7gzG KbYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=3OCdb49T; 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=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h36si48211824plb.199.2019.08.08.04.00.31; Thu, 08 Aug 2019 04:00:46 -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=@zytor.com header.s=2019071901 header.b=3OCdb49T; 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=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732216AbfHHKyg (ORCPT + 99 others); Thu, 8 Aug 2019 06:54:36 -0400 Received: from terminus.zytor.com ([198.137.202.136]:58697 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726721AbfHHKyg (ORCPT ); Thu, 8 Aug 2019 06:54:36 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x78AsJnj3127174 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 8 Aug 2019 03:54:19 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x78AsJnj3127174 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1565261659; bh=uzbeeHqVgjUyiCK6krtHxJDeX6i1CDXl0yqQghz+kjM=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=3OCdb49Td9a+imJQtwndIAYOQ9do5pxGKLFQFr8YieSBnPM2bm3DtJ3L37+gAXfV3 KOGY3ie4uAFrrj2uaV04pgqWPa+qsuxjCwo0PpREh46PCXy8LJBxeSiTvmJ6z8kz+f 8kU3l6rzhI0c3nikFlB9ou6qx0yEWpF05Mv24j6yI/IMPEXZRZ1tgCPfpqzwkKb83U Fo+HL2mQtjQVZpzunlPz0vCZyVg7p1J9uE+tO/IWkhhGbG4tjoY1IYJDoRrvvjvqzt 8aOJVtPm674cbWqEVqDtdm54VeAzldT6W05d0CyxRVUq93J2RJjUgyLxZo1zOvrRne /6pl2Jo2JAErg== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x78AsIXA3127171; Thu, 8 Aug 2019 03:54:18 -0700 Date: Thu, 8 Aug 2019 03:54:18 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Peter Zijlstra Message-ID: Cc: linux-kernel@vger.kernel.org, aaron.lwe@gmail.com, naravamudan@digitalocean.com, valentin.schneider@arm.com, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com, jdesfossez@digitalocean.com, pauld@redhat.com, mingo@kernel.org Reply-To: tglx@linutronix.de, peterz@infradead.org, valentin.schneider@arm.com, naravamudan@digitalocean.com, mingo@kernel.org, hpa@zytor.com, pauld@redhat.com, jdesfossez@digitalocean.com, aaron.lwe@gmail.com, linux-kernel@vger.kernel.org In-Reply-To: <0fd8fd4b99b9b9aa88d8b2dff897f7fd0d88f72c.1559129225.git.vpillai@digitalocean.com> References: <0fd8fd4b99b9b9aa88d8b2dff897f7fd0d88f72c.1559129225.git.vpillai@digitalocean.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] stop_machine: Fix stop_cpus_in_progress ordering Git-Commit-ID: 99d84bf8c65a7a0dbc9e166ca0a58ed949ac4f37 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=1.8 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, FREEMAIL_FORGED_REPLYTO autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 99d84bf8c65a7a0dbc9e166ca0a58ed949ac4f37 Gitweb: https://git.kernel.org/tip/99d84bf8c65a7a0dbc9e166ca0a58ed949ac4f37 Author: Peter Zijlstra AuthorDate: Wed, 29 May 2019 20:36:37 +0000 Committer: Peter Zijlstra CommitDate: Thu, 8 Aug 2019 09:09:30 +0200 stop_machine: Fix stop_cpus_in_progress ordering Make sure the entire for loop has stop_cpus_in_progress set. Signed-off-by: Peter Zijlstra (Intel) Cc: Aaron Lu Cc: Valentin Schneider Cc: mingo@kernel.org Cc: Phil Auld Cc: Julien Desfossez Cc: Nishanth Aravamudan Link: https://lkml.kernel.org/r/0fd8fd4b99b9b9aa88d8b2dff897f7fd0d88f72c.1559129225.git.vpillai@digitalocean.com --- 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();