From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E1BE29AB05; Tue, 24 Feb 2026 10:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771927710; cv=none; b=i4HWq7irqF9HjJg2Fkp4haZ0ufn3MTW7IeVobrMABByYPSRJvIfGv/bAfM0wN8abPEq5AJGzS0/uZm94xCI9rc96CeK8i+W/UjCgISKGVcUcG17No9/1hXQ4DDUs84ibNB3wUjl/a3T8IRYfJhZOnQe/BuK9wtZLO1HSojGfwMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771927710; c=relaxed/simple; bh=aJz4JtR+6h+Ulv2Tc0g3k1KHy4lApIw/gHZ4U7cIgOY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D3SyJn2V4CZEng3DUqMiZMv0bIiBIVAIHBEwgV+mC6G8RuCaeSRa0DZQxuABG9yAH8oDuNwK3cVJlR10paCX/WhCIIipcAZEkRGn0oL6RbOFaELgnhvI11M2dfMfAerjexbItEqs/E2vI9FFrpga4c6uUk0hlCxsOVZ7IjxiUoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 96CE2339; Tue, 24 Feb 2026 02:08:22 -0800 (PST) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9AF0B3F62B; Tue, 24 Feb 2026 02:08:26 -0800 (PST) Date: Tue, 24 Feb 2026 10:08:21 +0000 From: Mark Rutland To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Ryan Roberts , Lorenzo Stoakes , Andrew Morton , David Hildenbrand , Mike Rapoport , Linu Cherian , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , linux-perf-users@vger.kernel.org Subject: Re: [RFC V1 04/16] perf/events: Replace READ_ONCE() with standard pgtable accessors Message-ID: References: <20260224051153.3150613-1-anshuman.khandual@arm.com> <20260224051153.3150613-5-anshuman.khandual@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260224051153.3150613-5-anshuman.khandual@arm.com> On Tue, Feb 24, 2026 at 10:41:41AM +0530, Anshuman Khandual wrote: > Replace READ_ONCE() with standard page table accessors i.e pxdp_get() which > anyways default into READ_ONCE() in cases where platform do not override. For each of the patches where you make this sort of change, please explain in the commit message *why* it is necessary to do this. IIUC the entire point of this is that in subsequent patches, arm64 will need to use something other than READ_ONCE() for all pXX levels in order to support D128 translation tables. Spelling that out in the commit message makes it much easier for reviewers to see what's going on, and to focus any discussion/questions, e.g. *why* won't READ_ONCE() work? Mark. > > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Arnaldo Carvalho de Melo > Cc: Namhyung Kim > Cc: linux-perf-users@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > kernel/events/core.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/kernel/events/core.c b/kernel/events/core.c > index ac70d68217b6..4ee151cd2c6d 100644 > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -8422,7 +8422,7 @@ static u64 perf_get_pgtable_size(struct mm_struct *mm, unsigned long addr) > pte_t *ptep, pte; > > pgdp = pgd_offset(mm, addr); > - pgd = READ_ONCE(*pgdp); > + pgd = pgdp_get(pgdp); > if (pgd_none(pgd)) > return 0; > > @@ -8430,7 +8430,7 @@ static u64 perf_get_pgtable_size(struct mm_struct *mm, unsigned long addr) > return pgd_leaf_size(pgd); > > p4dp = p4d_offset_lockless(pgdp, pgd, addr); > - p4d = READ_ONCE(*p4dp); > + p4d = p4dp_get(p4dp); > if (!p4d_present(p4d)) > return 0; > > @@ -8438,7 +8438,7 @@ static u64 perf_get_pgtable_size(struct mm_struct *mm, unsigned long addr) > return p4d_leaf_size(p4d); > > pudp = pud_offset_lockless(p4dp, p4d, addr); > - pud = READ_ONCE(*pudp); > + pud = pudp_get(pudp); > if (!pud_present(pud)) > return 0; > > -- > 2.43.0 >