Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5032618ima; Tue, 5 Feb 2019 05:25:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IbGyu0JhWaTalWdbj5gBoZwXmIYEAasXXoZQf0MfN6/0wV+xuDerCEBB2jtDIw+i2w7Wem8 X-Received: by 2002:a63:ec4b:: with SMTP id r11mr4506980pgj.44.1549373148292; Tue, 05 Feb 2019 05:25:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549373148; cv=none; d=google.com; s=arc-20160816; b=s3yExu9DVLjknZF24sK9fsZ6J2h5lko8hsWNeDrZBaTJTmPmrwuqvSfs8kMouwf17n OjXYfgoc6pJolKUB9mTL7gkx9nRQC1PiEqopwvLpJ9jyaoQEDoTO7x00eaqXk0yyfLGm wEcbM/f49ON4LY2ebGLXjYPFYd8Ugas/YOATl/t3VJUU6gAOthSBhN/8GjxDb78vuDgu bZT5csA+GC8I7XVMUfF7y20iUKm+5ek3zdZpE034oR0iJ3MPRyyS7IoEwXo0b9WlC0Jy sxXSkcPiKaxh3Xe3q96g6bYMetxcvSJhHPtDdGlAQPcljHAMCDlEJOQGTiz46bmuGs9v bwMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=+u9xyKi7BFyHNFMMNbmO1knt9bQ3qF0N1wLACZmqHMo=; b=uyw/FFrPEOc773dDf5v+qRHNx/O8Z5noQ0v2DfM6uJpFGTQRJ2cSy1ay6CEW/Vg+b2 aB+VUHLYkWHgAt1Uab8PVBMn8AKkYDYANUqfhPHLxWHDOmB1qq196TtRnFRCOOKgtngx LbjejAN7DGKt/4haqg+iP/gAakE6CeZ61yTf/dgBL3goQaaxCxpgxqkT/JyTOpVStSCx Q5IBeigBEknHRPLSFiS7R2Y33lZyxoIJfs//45zfcmQq2cyfa9E/K+cNt0aIySxV6kr+ lG1CyX+LfE2Or5hZk5oYbACNaBxwUsHyHu346/ZNQS5YVXu99b3tg/rAARelOHtzS56j n8OQ== 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 b60si2272687plc.95.2019.02.05.05.25.24; Tue, 05 Feb 2019 05:25:48 -0800 (PST) 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 S1728921AbfBENE1 (ORCPT + 99 others); Tue, 5 Feb 2019 08:04:27 -0500 Received: from foss.arm.com ([217.140.101.70]:41082 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727635AbfBENE1 (ORCPT ); Tue, 5 Feb 2019 08:04:27 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7B30180D; Tue, 5 Feb 2019 05:04:26 -0800 (PST) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 22BDB3F675; Tue, 5 Feb 2019 05:04:24 -0800 (PST) Subject: Re: [PATCH 5/5] perf/arm_dsu: Fix CPU hotplug races To: Suzuki K Poulose , will.deacon@arm.com, mark.rutland@arm.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peterz@infradead.org, tglx@linutronix.de, bigeasy@linutronix.de References: <9fcf862c-0d07-cece-852f-6c09128aa0c5@arm.com> From: Robin Murphy Message-ID: <84bdba44-9ce1-906c-0575-f931435de886@arm.com> Date: Tue, 5 Feb 2019 13:04:23 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <9fcf862c-0d07-cece-852f-6c09128aa0c5@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Suzuki, On 05/02/2019 11:40, Suzuki K Poulose wrote: > On 04/02/2019 17:09, Robin Murphy wrote: >> Like other system PMUs which associate themselves with an arbitrary CPU >> for housekeeping purposes, arm_dsu has a race between registering the >> hotplug notifier and registering the PMU device, such that the hotplug >> niotifier can potentially fire and attempt to migrate the PMU context >> before the latter is valid. This is easily resolved by inhibiting >> hotplug until both the notifier and PMU device are successfully set up. >> >> For the same reason, also suppress any synchronous notifier calls in the >> cleanup path if PMU registration fails. >> >> Signed-off-by: Robin Murphy > > Should we add : > > Fixes: commit 7520fa99246dade7ab6 ("perf: ARM DynamIQ Shared Unit PMU > support") > > Either way: > > Reviewed-by: Suzuki K Poulose Thanks for the reviews! I think this patch is worthwhile for cleanliness and consistency, but since it's neither self-contained (with the dependency on #4) nor "fix[ing] a real bug that bothers people" I'm not convinced it really deserves backporting - unlike the preemption issue, actually getting a crash from this race in practice is unlikely enough that it would probably require some determined, deliberate effort to trigger it with just the right conditions. Cheers, Robin.