Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2335640ybt; Fri, 3 Jul 2020 06:47:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz298HsJzvQLumsnMwu7amRXTdJtPqP/GN16Ahvt3YZ7+phiN4koHs+BdoBJJ6y4TA3f8fe X-Received: by 2002:a17:906:ca4c:: with SMTP id jx12mr29831528ejb.231.1593784075845; Fri, 03 Jul 2020 06:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593784075; cv=none; d=google.com; s=arc-20160816; b=j7IBAGSpQBI56eawzK0CQI6txILxaRui56LFgRwO/mfqGGc/yq20XtHVqYnVKJpILp IxGp8Dlj+OuqM5ak8JiA3GvGfKar6J71UYDTX6+TjZB9wUHaxRo145aNdsAkj4iDMYEI dF7dy6PHothXy64JWyIokTj4fJAjdFMKstEea+T5GhcCDncCsH12hwKQvLLy6b9bQMpA SCkyZswql8r6Mc7wwGmIRG6b10fQf/BSJthj3uf2WulpQFZ01oiXzeEUFZ2fERIFULq9 tCJSpt9A7Dz9o7wiHKtC857ZIlzZMI/C1K8CLx642+lX4BRWSrqMQ58tE4h7iDUKGIcm 9VBA== 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:dkim-signature; bh=dT6a7SRUecSa7cTklFOAZTVE/T4VPp3jHSz+CJ5Oj1g=; b=WjjvjxbqJB5dNx4BYP4637ZqVMR8Zm/BqIRvNw7sAFQ2wJ/niibjSE4vPslzKd1EHM kl8WiwTEKHkGZY+/uirv5cJH8p4j3QciITpGJnZccw81Yoz20QCAIxtFI6fvlHpaTP0r DQjomrn44scPVEBBKCI538zUdQNYFnqL7SOiZcena08YKEUPyH3gZLYIoWpkktw1XjLz S3HnLC8W0mdp/zaonMfo9+2RHzUFFFvK66bUB3cBnG27nwnOCPI7+ZXzf/P0gOP38SjC wthuKF9cpuBG1hagQf7C0UMLx6uRWc2MrcwSxdfeuZ3+1riASY6YVvCktwkXVM/cpcYu jojg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jXGop+ok; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si7939668ejb.510.2020.07.03.06.47.33; Fri, 03 Jul 2020 06:47:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jXGop+ok; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726258AbgGCNpW (ORCPT + 99 others); Fri, 3 Jul 2020 09:45:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:36632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbgGCNpW (ORCPT ); Fri, 3 Jul 2020 09:45:22 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F10320826; Fri, 3 Jul 2020 13:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593783921; bh=hm3Moh7xHMlFJvAAJ9OOz3vc20Ys5RgWmTwwcOCFC4M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jXGop+ok38hzk7QdHVtN0HtuYUcBxp395jqRjI6yYNHKdC+4CWmuGgM/jDbgpN9Jb W8jI0RaxPNXsAVQjw4meJCfSpmnZKWUDAz0s6BGZTviRf3Bj6gz9BVpSXym2hRmjxY wDg8LS8/YBKzPcDpvmj/ZuNSE3rC2tNhpPiJD9F0= Date: Fri, 3 Jul 2020 14:45:16 +0100 From: Will Deacon To: Stephen Boyd Cc: Alexandru Elisei , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, Julien Thierry , Peter Zijlstra , maz@kernel.org, Will Deacon , Arnaldo Carvalho de Melo , Alexander Shishkin , Ingo Molnar , catalin.marinas@arm.com, Namhyung Kim , Jiri Olsa Subject: Re: [PATCH v5 3/7] arm64: perf: Remove PMU locking Message-ID: <20200703134515.GF18953@willie-the-truck> References: <20200617113851.607706-1-alexandru.elisei@arm.com> <20200617113851.607706-4-alexandru.elisei@arm.com> <159242503203.62212.1690942414916053920@swboyd.mtv.corp.google.com> <159255539947.62212.6059916295459835174@swboyd.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <159255539947.62212.6059916295459835174@swboyd.mtv.corp.google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 19, 2020 at 01:29:59AM -0700, Stephen Boyd wrote: > Quoting Alexandru Elisei (2020-06-18 03:51:31) > > The armv8pmu_{start,stop}() functions are called from the irq handler, so we're > > safe from preemption in this case. They are also called via > > pmu->pmu_{enable,disable} callbacks, and I didn't find an explicit contract > > regarding preemption in include/linux/perf_event.h. I've checked the other call > > sites, and I didn't find any instances where they are called with preemption > > enabled, which makes sense as we don't want to disable the PMU on a another CPU by > > accident. > > If they're all callbacks then it's overkill to add this. Presumably it > is better to enforce this wherever the callbacks are called from so as > to not litter the callee with random cant_sleep() calls. Probably best > to ignore my suggestion. > > > > > I would be inclined to add cant_sleep() calls to armv8pmu_{start,stop}(). In the > > previous iteration, there were WARN_ONs in these functions, and Will said [1] they > > can be removed because they are per-CPU operations. Will, what do you think about > > adding the lockdep assertions? > > > > [1] https://www.spinics.net/lists/arm-kernel/msg745161.html > > > > If I read it correctly Will is saying the same thing in that thread. Right, in the cases where perf core already relies on things not being preemptible, we don't need to add extra checks. Will