Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp643251lqt; Mon, 18 Mar 2024 21:26:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqkP3p/eBGWihqpfNM7s3qlyu7leHrVUBHkN+cmXLLcfmUD8vGCreTWOw4AInsJRZi46hkVZCUpSdYZekNbpGAPMV2V4ab5p0LHSNOHw== X-Google-Smtp-Source: AGHT+IFjm8g6wXkt+VNM7KfXeNtvX/aZdNz1qSlJJHfvCXkCK/+uEHx/k5+Ex3CqqyKPbFvU6AJG X-Received: by 2002:a0c:e3d3:0:b0:690:d7a4:30ab with SMTP id e19-20020a0ce3d3000000b00690d7a430abmr12900186qvl.4.1710822404715; Mon, 18 Mar 2024 21:26:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710822404; cv=pass; d=google.com; s=arc-20160816; b=C8YTPdpLFwveVeFlUHZGSjoN44i6393Sae7G407Yv8y+z7LN1PRDeXd0dZ31+Qaxml hK/s2SgMhCfcMzN0g3g2I72f1q0lWTm/3liBxPsKUoriUOIGrLAEiefCkiDhB+6ahNgZ CF32MZZ7oI3fUx07wTZk5Xxu6Wau/RJmMa7oUpxKcg/9CGpx8v9bt4/nIuUgKECvXx7W DPdN++JUvzNzsq2NkCV9DemZe0Pw4epHLk8FVGQ+e0QoxihEyVvhjgUhZpIFW5/SBRi5 8Xwue3ZPzIX1moUjQdyOVZxsds49CdUknijJ0C6TPtzR4Cpu4U6fI7EdhFHe9qa2pVf+ vpFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=kgOYrA8AEdh1woTHtD2vW3ca3PCtrZkdcZD77qbWikM=; fh=HO+QISPyCr2CXQXuCwkmjuMSrOC5+MCaUg7Pzri55MA=; b=C4c2N2mL8vQho4/SFLK3JBhPLiwNHUI6+NHtBY6zDjQGmnMfyZy/+lLDJw/aGaoevy 9Gfk4QpMwwfFwMrbQqB4lARU2c0ENSym193ZIhYpx+o45xLZicBEpIJkdRH+eDc45qtY +gSL6E2hsSwwyKjuRE4qSZxgxtKacCkVTujvEpZF841JY/2hOV5pVjlF1WlhXvsl7bAb aEVRHKOGdhHdcoS+ypSSiuJq6J3ojpF+5f3t0LzHEmxgwu/VP13pJoB8KnL2uGSxvU81 Qp393qRs0PIPrw9dLUARtfRLdixfJ9b3adQTc12Mp0+N5g7HSz/aASrSXqcD/6ZaELfw 72BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZTAFK3kI; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-106992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e13-20020a0562140d8d00b0068f70c5195bsi9906750qve.614.2024.03.18.21.26.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 21:26:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZTAFK3kI; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-106992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 711861C2142F for ; Tue, 19 Mar 2024 04:26:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A29C7C6E3; Tue, 19 Mar 2024 04:26:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ZTAFK3kI" Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A53217C0BE for ; Tue, 19 Mar 2024 04:26:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710822384; cv=none; b=UQtpsyfKMj4k1vidUS6bGNxRP50hvYhaMS/siVGzJpEsP2UHTW4WrblYSqmbPYbef26YlQtITun24z2A1+IVwB3JJQFomEQ1G4rlGneLbMEK+nqKLPzTsPeGAlyEOjzMG0XQ44UB1eBAsBxkkCIGGFnpc2LAbeZ0s943fcWfc8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710822384; c=relaxed/simple; bh=u02e9JnhtgF01wLoGi9eloHZoYbmUfQfrlrPML9EgIU=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=Dl0Ijahw1cpLwcvo7hsZs+tLSlCr4WjRO5+IzRYrQbGKkG+9h1NlNMTqYQLR8KorY10mFraC9HZ7r8ddVa9mc/ck87AujZxX6FfDfDPIiF3duCFwnWCbwYICiglU2N4tZj0K0p0AivtdZefhUGLNEsw98BQ29zBOUs/YJTfIEOY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ZTAFK3kI; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1710822380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kgOYrA8AEdh1woTHtD2vW3ca3PCtrZkdcZD77qbWikM=; b=ZTAFK3kIV8AKtSNFLFj4r5t0E2RLRk79ahMgFgMUh3jepMgCaS/mVJWw+RNCCrBHBN52gG NXM8ti3nDdYB1W5KBlYW6GIieZZXNfTfpKEBYqCv/yKV1dd9Ool2dQxzcp3DvEWHCDX49h rpX1jczrZg5j7IQxr3uyYzwVPdmEh3E= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Subject: Re: [PATCH v2 05/14] mm/sparc: Change pXd_huge() behavior to exclude swap entries X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20240318200404.448346-6-peterx@redhat.com> Date: Tue, 19 Mar 2024 12:25:39 +0800 Cc: LKML , Linux-MM , Andrew Morton , x86@kernel.org, Mike Rapoport , Matthew Wilcox , sparclinux@vger.kernel.org, Jason Gunthorpe , linuxppc-dev@lists.ozlabs.org, Christophe Leroy , linux-arm-kernel@lists.infradead.org, "David S . Miller" , Andreas Larsson Content-Transfer-Encoding: quoted-printable Message-Id: <744C19CB-4AE0-472B-ABD8-2064EB04FDA0@linux.dev> References: <20240318200404.448346-1-peterx@redhat.com> <20240318200404.448346-6-peterx@redhat.com> To: Peter Xu X-Migadu-Flow: FLOW_OUT > On Mar 19, 2024, at 04:03, peterx@redhat.com wrote: >=20 > From: Peter Xu >=20 > Please refer to the previous patch on the reasoning for x86. Now = sparc is > the only architecture that will allow swap entries to be reported as > pXd_huge(). After this patch, all architectures should forbid swap = entries > in pXd_huge(). >=20 > Cc: David S. Miller > Cc: Andreas Larsson > Cc: sparclinux@vger.kernel.org > Signed-off-by: Peter Xu > --- > arch/sparc/mm/hugetlbpage.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c > index b432500c13a5..d31c2cec35c9 100644 > --- a/arch/sparc/mm/hugetlbpage.c > +++ b/arch/sparc/mm/hugetlbpage.c > @@ -409,14 +409,12 @@ pte_t huge_ptep_get_and_clear(struct mm_struct = *mm, unsigned long addr, >=20 > int pmd_huge(pmd_t pmd) > { > - return !pmd_none(pmd) && > - (pmd_val(pmd) & (_PAGE_VALID|_PAGE_PMD_HUGE)) !=3D _PAGE_VALID; > + return pmd_leaf(pmd);; There is a redundant semicolon in the end. Thanks. > } >=20 > int pud_huge(pud_t pud) > { > - return !pud_none(pud) && > - (pud_val(pud) & (_PAGE_VALID|_PAGE_PUD_HUGE)) !=3D _PAGE_VALID; > + return pud_leaf(pud); > } >=20 > static void hugetlb_free_pte_range(struct mmu_gather *tlb, pmd_t *pmd, > --=20 > 2.44.0 >=20