Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4344444ybp; Mon, 14 Oct 2019 03:11:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyolVcpqa5sw8ZjiegGvdU51BAJ9i7m2fqT5UdaH1wYFdsKzsvgi0U7nV3WTIoHhNqhniME X-Received: by 2002:aa7:d905:: with SMTP id a5mr27203195edr.88.1571047908183; Mon, 14 Oct 2019 03:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571047908; cv=none; d=google.com; s=arc-20160816; b=a1KpS1V+dyz6y20emUI+5kOw339jin9xDHeedP1COf7dVV18I+NIBOyAKjHsSoMUrw QV0LpsCGohPygcq+lV4RXoDvc5rj3ZOoxgSTbvGVbjIBBOb5iAS6GZNtpxdpWLuTwi1m niRMEVzFJdgqlsJBCdnqCWFbuOPWC/3UZrfEdlvBulF2TZvmBx2xiawyg1w2FqnE7FR3 Jm7SHRuBqnCo4vgsCBs0W5fntTxK6Oate/zAAcyn0uooUcflFHugQKx0b+RH4vTVI2tn k3rf7cClXk2JLfHMz539uDcbi4IVmjwev+oXh8/Xn1w6ADfof3mByOtoJYeK/VdChC48 6srg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=E6p0bTaggZPOOhLqkvXPLpzpIFmpAaeYjWUIyMg2BDs=; b=bbM9IRYD/3goqFismi9285aOcmx7lUC/W8BZ1qNvqa40YSuCDzB2u7ois0SkATZWYD tVvGW/ovWxuOm+s1yrjSTwZwPd8ShftICnxbgcU56AzY1+n9m8/O59Ikfhvu5ZPrOS+Y tsWYih4InsOhZoFAfLCI28fTojf8UQFTwFtWxwoolZRWZQkLLKvJuuwwrKyQ+O+hRRtM qZCoDX4+1KScSFFz/t/JwmxNe8BOZqGnYQ1VGdpbrKZeqZjvVQ4w7Z4bxApAjczbw64z +EzF4AcpNp2GFJDKq0N365WikPXgYr5dk3fjYWD7xHBWEL9m+5MK2bPJUAwPCflh2WOt 3awA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si10501391ejx.295.2019.10.14.03.11.24; Mon, 14 Oct 2019 03:11:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731387AbfJNKJv (ORCPT + 99 others); Mon, 14 Oct 2019 06:09:51 -0400 Received: from foss.arm.com ([217.140.110.172]:39488 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731235AbfJNKJv (ORCPT ); Mon, 14 Oct 2019 06:09:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D22B3337; Mon, 14 Oct 2019 03:09:50 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2CDAD3F718; Mon, 14 Oct 2019 03:09:50 -0700 (PDT) Date: Mon, 14 Oct 2019 11:09:45 +0100 From: Mark Rutland To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Marco Elver , Thomas Gleixner Subject: Re: [PATCH] stop_machine: avoid potential race behaviour Message-ID: <20191014100943.GA41626@lakrids.cambridge.arm.com> References: <20191007104536.27276-1-mark.rutland@arm.com> <20191008083637.GI2294@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008083637.GI2294@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 08, 2019 at 10:36:37AM +0200, Peter Zijlstra wrote: > On Mon, Oct 07, 2019 at 11:45:36AM +0100, Mark Rutland wrote: > > Both multi_cpu_stop() and set_state() access multi_stop_data::state > > racily using plain accesses. These are subject to compiler > > transformations which could break the intended behaviour of the code, > > and this situation is detected by KCSAN on both arm64 and x86 (splats > > below). > > I really don't think there is anything the compiler can do wrong here. > > That is, I'm thinking I'd like to get this called out as a false-positive. I agree that in practice, it's very unlikely this would go wrong. There are some things the compiler could do, e.g. with re-ordering of volatile and plain reads of the same variable: https://lore.kernel.org/lkml/20191003161233.GB38140@lakrids.cambridge.arm.com/ ... and while I agree that's vanishingly unlikely to happen here, I couldn't say how to rule that out without ruling out cases that would actually blow up in practice. > That said, the patch looks obviously fine and will help with the > validation effort so no real objection there. Great! Can I take that as an Acked-by? I assume this should go via the tip tree. Thanks, Mark.