Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp762520ybt; Wed, 17 Jun 2020 13:19:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQOFGma8UpQpMGQpro55XZFp+DpjVE6zjkYRHnWDuRFawkLLxKdII8aPjdT8Q8OtdR7fqi X-Received: by 2002:a17:906:7283:: with SMTP id b3mr864865ejl.163.1592425185996; Wed, 17 Jun 2020 13:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592425185; cv=none; d=google.com; s=arc-20160816; b=ZRYm5l3Jd2V3nqF/aaUY6Im/qbDBlgy6cqocCfD4128nC5BHg3ZoUHFn765KoOewtN 8b0MIv1jNJn+ZrID2MC+n6VDmCNrKhTJLCr8yVVsRGR+mTmgl/xSAZPVirEHAnjr1WtA gBtUXdO5NRFLxZSyOp2e6IM4KlMmzf6UyZX4FTRMJygmGIT4aYWRrwDkmjKhtDxuXYn0 pRJEWI0e0H2N/CShKgy6jHTtUDcp4WyxIsiJCizX7HZuIBOwn6cVTumMlsSgAwm5Yh0U yWzA8mEzbJqvculkGTkul9jvr4GHjSuqy9t8nodPf6CGC8BDqbMLJIaw/RNKLueVUB+p RMZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=f/zTJhdatEqLBfSYNcdO1If3TDUmj7o382cxxIHdBfU=; b=TlQ4TUKV/fmF4YVchU14M2QKxihslMBpgnavSchEV3rOn7Z4/d955PPUDoW4u2Gpl+ 5xBd/93P7rnKeub4C+Y9Qc5Z5tiDDdBvv+YGOrgz+OtOnt8cXue6r5jgmKvbatrBQ0kF rWHZZi6YyOo2G29lt6hqEw1zw1WRU4yXj7duNtvlIFLg3fl8i29vQzZUryaRWd9CSnWc RQIfEYSrpnaJ1T5JOJIDUTMQQaL9P8M2SFuJ0Ec+F9q6qYMX17zWnKrajB6xb6Nmeet7 Zeon+hy73aOJVsOc4Wm9sCG7Igfj1bDnVanoUDeHBTx+/6a+GrAVeVEX3oU0fMzH5jnV Xdlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Q9jSqcl9; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu16si606030edb.146.2020.06.17.13.19.23; Wed, 17 Jun 2020 13:19:45 -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=@chromium.org header.s=google header.b=Q9jSqcl9; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726997AbgFQURO (ORCPT + 99 others); Wed, 17 Jun 2020 16:17:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbgFQURO (ORCPT ); Wed, 17 Jun 2020 16:17:14 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7D60C06174E for ; Wed, 17 Jun 2020 13:17:13 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id y17so1445280plb.8 for ; Wed, 17 Jun 2020 13:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=f/zTJhdatEqLBfSYNcdO1If3TDUmj7o382cxxIHdBfU=; b=Q9jSqcl9aMW6eVrCIUWsJrgL3ZTltl3LoBJx2e6hUDHUpBqDcjBZeEINAd7wdVWhTu AxKO8x6CAHjx9qOL/X2adEfxZGtZ2c5FyVgmnOh5vCjTEGUwO+6trcQYwvaKizTUF+9h CD0EpvHFaXF+ZU7eV8dabBIhP9bavlZWPe7rA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=f/zTJhdatEqLBfSYNcdO1If3TDUmj7o382cxxIHdBfU=; b=nb6WsNYCP+ZBHPpFC9x8QmD+/3KPInBSpqRSwU5icW5LjfH7lrvpILh7sOD7jpUs1g lZYMAP2PwwebHSBYfMi+EYwsJyCUtztVwNjB5rfXMFJ2nFejB0I6K4N0iOTvkVYnCWLU cvAiGKp/Bg6WVEXhLo50aoHOsbXkK39fVjKv6TzlmZuFL7POOcf8TQy88l3ROr1l0UyN eX20wgD75j2BxO0Ha2CjR1NUeL6AUp3JUbrBznHk1ZKVfNRY5/hTJzcy7cLHPVILyDUl 7sMwAKFVlkQFT/sW7Ay4ZjJd4njPwXDvjwe3sIpvJXH4H7mK8KKF07ueMpX3DxQk0WrY iT2A== X-Gm-Message-State: AOAM5328iIB9miNsbA6UNDUB2LzsoYveEuzZMnQGqvN/OyM7w8Xa8kj+ +zhFmCfU3mO2sNj3Q/c3cLvthQ== X-Received: by 2002:a17:90a:c258:: with SMTP id d24mr713016pjx.137.1592425033476; Wed, 17 Jun 2020 13:17:13 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id q92sm378725pjh.12.2020.06.17.13.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 13:17:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20200617113851.607706-4-alexandru.elisei@arm.com> References: <20200617113851.607706-1-alexandru.elisei@arm.com> <20200617113851.607706-4-alexandru.elisei@arm.com> Subject: Re: [PATCH v5 3/7] arm64: perf: Remove PMU locking From: Stephen Boyd Cc: mark.rutland@arm.com, Julien Thierry , Peter Zijlstra , maz@kernel.org, Jiri Olsa , Will Deacon , Arnaldo Carvalho de Melo , Alexander Shishkin , Ingo Molnar , catalin.marinas@arm.com, Namhyung Kim , will@kernel.org To: Alexandru Elisei , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Wed, 17 Jun 2020 13:17:12 -0700 Message-ID: <159242503203.62212.1690942414916053920@swboyd.mtv.corp.google.com> User-Agent: alot/0.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Alexandru Elisei (2020-06-17 04:38:47) > From: Julien Thierry >=20 > The PMU is disabled and enabled, and the counters are programmed from > contexts where interrupts or preemption is disabled. >=20 > The functions to toggle the PMU and to program the PMU counters access the > registers directly and don't access data modified by the interrupt handle= r. > That, and the fact that they're always called from non-preemptible > contexts, means that we don't need to disable interrupts or use a spinloc= k. Maybe we should add a lockdep assertion that the code isn't preemptible? I.e. add a cant_sleep() call? Or is it more that we don't need locking because we're just doing register accesses and don't need to protect those accesses from each other?