From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (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 67E023CAA49; Mon, 31 Aug 2026 07:58:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788163108; cv=none; b=NGy/LiQgsl8gATLZ7Tya8G+2fBXwaOVsc/iRIeazSPRnZ+FmAvAU0iriVEL38tjYpV2utLpxam5H1gtLRGpt6mngK4Y7wnkf73WP3tXbxfXsBngEIhozakG3BBCX4tFsCNq7Ap2P607EdsXHLynERcKOTQOLjqiBPCpApPu+yHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788163108; c=relaxed/simple; bh=xBEVX2+Qh4ybGtNp1SMpmRGAQq/nXmtgerGGK950Pp8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iKSc9aO2iHVDT1/mipo171rUavCm7v80UqKJtHcbyaybNY9cYUL4ZnvvF9lbyTexjgzjtyddx5V9eYONyj7qO10i1GD6iShuNSQpNWkiJPY8eBY+PS9Mk3zpV0yU0rCQnkAqzu9aMrnft/1caqM6wc2H+8ornRHRD29VSfkve/M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=cD3sn4at; arc=none smtp.client-ip=115.124.30.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="cD3sn4at" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1788163102; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=NpHd6qU1H/25OxIUyU+cfJ+VsF5+LmMRg2Jcq1Igf+k=; b=cD3sn4atswvhq3L422+74TaxEyVW7GZit52XN37XL1S+INtw8DMD3cpYTA0ur4103WgKnE4NUKILdw0aqwL+9bZgqUW3jIFb1HGl8lpaBu8ZEKDJ6YuWTyWPygqtl9pUaVkM76w0GfioVK3O8naMqB2/a0Pq4j4PKi5gmZbJ41o= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R751e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037026112;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0X9vVHwo_1788163099; Received: from 30.74.144.115(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X9vVHwo_1788163099 cluster:ay36) by smtp.aliyun-inc.com; Mon, 31 Aug 2026 15:58:20 +0800 Message-ID: Date: Mon, 31 Aug 2026 15:58:18 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] kselftest: mm: replace usage of /proc/self/smaps for check_huge_xxx() helper To: Yeoreum Yun , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Zi Yan , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Shuah Khan , Kevin Brodsky Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260828-fix_split-v3-0-374022586a4b@arm.com> <20260828-fix_split-v3-2-374022586a4b@arm.com> From: Baolin Wang In-Reply-To: <20260828-fix_split-v3-2-374022586a4b@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 8/28/26 4:11 PM, Yeoreum Yun wrote: > Since glibc commit 321e1fc73f (“malloc: Enable 2MB THP by default on AArch64”), > glibc may call madvise(MADV_HUGEPAGE) for sufficiently large allocations > made by memalign(). > > The underlying VMA may start at a different address from the aligned > address returned by memalign(). Furthermore, a subsequent > madvise(MADV_HUGEPAGE) call does not split the VMA because the flag is > already set. > > This causes split_huge_page_test to fail because the check_huge_xxx() > helpers incorrectly require the address returned by memalign() to > match the VMA start address reported in /proc/self/smaps. > > Fix this by using /proc/self/pagemap and /proc/kpageflags instead of > /proc/self/smaps to detect huge pages. > > Reported-by: David Hildenbrand (Arm) > Suggested-by: Zi Yan > Signed-off-by: Yeoreum Yun > --- LGTM, with comments from Lorenzo and Zi addressed. Reviewed-by: Baolin Wang Tested-by: Baolin Wang