From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 E046F10EC for ; Thu, 11 Jan 2024 02:08:39 +0000 (UTC) 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="IH1ZeZrj" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1704938917; 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=qmEEcsA0fyriEKAX8TlwhNLaVQANlK3RwRydup4EB8s=; b=IH1ZeZrj6G+es7br9lTnFYyTgS8/NZ0PXntEb9/Z50vjKtlOktUF47bs/H13CEyBNEL2G4 Rtdm1BiJg+oE9KqACaizjUPUDDtYR5OwEN4CIDMNootAWjFqNFtLBWJ976MsR1q1AcffSr nHPjaiVp52YhioD9c5kbusjZypUg/44= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Subject: Re: [PATCH 1/1] selftests: mm: hugepage-vmemmap fails on 64K page size systems. X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20240110075351.f4b6f43e31629ddcb96503cc@linux-foundation.org> Date: Thu, 11 Jan 2024 10:07:58 +0800 Cc: linux-kselftest@vger.kernel.org, Aneesh Kumar , Linux-MM , linuxppc-dev@lists.ozlabs.org, LKML , Geetika Moolchandani Content-Transfer-Encoding: quoted-printable Message-Id: References: <3b3a3ae37ba21218481c482a872bbf7526031600.1704865754.git.donettom@linux.vnet.ibm.com> <20240110075351.f4b6f43e31629ddcb96503cc@linux-foundation.org> To: Donet Tom , Andrew Morton X-Migadu-Flow: FLOW_OUT > On Jan 10, 2024, at 23:53, Andrew Morton = wrote: >=20 > (cc Muchun) > On Wed, 10 Jan 2024 14:03:35 +0530 Donet Tom = wrote: >=20 >> The kernel sefltest mm/hugepage-vmemmap fails on architectures >> which has different page size other than 4K. In hugepage-vmemmap >> page size used is 4k so the pfn calculation will go wrong on systems >> which has different page size .The length of MAP_HUGETLB memory must >> be hugepage aligned but in hugepage-vmemmap map length is 2M so this >> will not get aligned if the system has differnet hugepage size. >>=20 >> Added psize() to get the page size and default_huge_page_size() to >> get the default hugepage size at run time, hugepage-vmemmap test pass >> on powerpc with 64K page size and x86 with 4K page size. >>=20 >> Result on powerpc without patch (page size 64K) >> *# ./hugepage-vmemmap >> Returned address is 0x7effff000000 whose pfn is 0 >> Head page flags (100000000) is invalid >> check_page_flags: Invalid argument >> *# >>=20 >> Result on powerpc with patch (page size 64K) >> *# ./hugepage-vmemmap >> Returned address is 0x7effff000000 whose pfn is 600 >> *# >>=20 >> Result on x86 with patch (page size 4K) >> *# ./hugepage-vmemmap >> Returned address is 0x7fc7c2c00000 whose pfn is 1dac00 >> *# >>=20 >> Signed-off-by: Donet Tom >> Reported-by : Geetika Moolchandani (geetika@linux.ibm.com) >> Tested-by : Geetika Moolchandani (geetika@linux.ibm.com) Acked-by: Muchun Song >=20 > I'll add=20 >=20 > Fixes: b147c89cd429 ("selftests: vm: add a hugetlb test case") > Cc: Yes. It should be a real bug fix. Thanks.