From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796483355; b=aNDjBOa8MnLMRBnd9sW4KAzN+uEMzawnJj/z5iunufjcfC0dhL4jElj/7PVQqAnE98fA 35XhfbBh2+UeV+ZThehKq0uTPZAQONxoVVMp3URciubCY7TIt50Jzkm7bV3vJL/xd1x03 LpJzNo3ejZHDrrsFrsnmdvo5nhRLQ0/0LcdFljO8bW5ijKkn0N1WAXKE+07hMK536JM5d fkggbx4se3BFkZj/vfbRcK+JPJzz3KYvcFHLUW/ngHcZY2Xnca2caGhy1vF2OkZWs3+dF jfXSxcu/it2pBSUICM6X6ibthh9QGqXAnprgLNC6WC4VXGbI9rrblifgOzUB7c5Z91Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796483355; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=2zT9BEDFQDJ4aAl/m2rAA7LTDMDOtS5dxNLV/6Rky4s=; b=TwybR4q2hXoGeYytYbDpoigW5/RC9SFhLThOpprP7fAPIfA7hZC6SJp/PX9IQ0f8NENd jasFpJHBzSDzk9E38darZvFmMvgVfl0ZdzlHUY02Vu6ZHe75y0+m5GzhzL8QHQhHEy3cq OOA4oxTbZUn0Hzs8ltklcQ4zImt/t85r9ygxOgka2miCHfvoeT4pbnHZP4BZeACIDQHd8 KaLhFxkpGxpXos7sZLx/lnuitYohrgxd5CrO5n6Y4CtRQww1Mof2Q+mqp154R/ffWgHPk ZqQgdLxd7Jfy5E6/H5+cbHoWQqQT6cvXlDSkU5HtVCeXLV6HUgDdvbQhC2vQiNlNW+Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LTXtlr6Y; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70A9A606A322 for ; Sat, 5 Dec 2026 15:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LTXtlr6Y Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECFB71F0092B; Sat, 5 Dec 2026 15:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796483355; bh=2zT9BEDFQDJ4aAl/m2rAA7LTDMDOtS5dxNLV/6Rky4s=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=LTXtlr6YulklVjf+wEYumRhrmJHP3tqxp9OI9nxC848Vyu1QJJUYgjhGBNaNFy0QY FSQkzdjV1l7OaYIhrcFT8A1dfMtF/yeobn2RtPqlsCy9NfxcYDDfGo8GW1Z7ToXBld VGzN0AMZoP7XqErgtEHeJ4fVlFmNSKKgixqySrsqAAICEQgh1aZ+eLD1VTh1M2x7Te Hi90LR2eSXcVeoAdujizAvSx+K0E2RDHyQDpShSRPc6QuG0tpHje1ZCXs+G4thCS+F iHWoJXFo34Wd/yyRui/CfXObPPZSuWCgEbtvYgEk/36zyfk8DN5yJeNgyOCigqWpxn GqESC9M+aPRKQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] selftests/damon/access_memory: disable THP for deterministic access pattern Reply-To: sashiko-reviews@lists.linux.dev To: "Enze Li" Cc: damon@lists.linux.dev In-Reply-To: <20261205145917.875356-1-lienze@kylinos.cn> References: <20261205145917.875356-1-lienze@kylinos.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 15:09:14 +0000 X-Mailing-List: damon@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > The WSS estimation selftest always reports zero with a 100% error when > the system runs with THP=3D'always'. The reason is that DAMON clears the > page table Accessed bits but does not flush the TLB. If the TLB still > covers the whole workload, the CPU never walks the page table again, so > DAMON sees no accesses at all. >=20 > Commit 891d206e27dc ("selftests/damon/wss_estimation: test for up to 160 > MiB working set size") tried to fix this by making the workload bigger. > That only works with base pages, though. With THP=3D'always', khugepage > turns the workload into 2MB pages, so even a big working set fits in > just a few TLB entries. TLB sizes also differ a lot between CPUs, so > there is no single working set size that works everywhere. >=20 > On a 4 vCPU / 8 GB x86_64 VM, the test fails with THP=3D'always': >=20 > 50-th percentile error 1.000000 (expect 10485760, result 0) >=20 > Setting THP to 'never' makes it pass at 20MB: >=20 > 50-th percentile error 0.001758 (expect 20971520, result 20934656) > 75-th percentile error 0.002734 (expect 20971520, result 21028864) >=20 > So make the workload itself predictable: turn off THP for access_memory > with prctl(PR_SET_THP_DISABLE). Then it only uses base pages and DAMON > can see the accesses no matter how the system is configured. It is a > process-wide setting, so one call before the allocations is enough. >=20 > Signed-off-by: Enze Li Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205145917.8753= 56-1-lienze@kylinos.cn?part=3D1