From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74CE2C02193 for ; Tue, 4 Feb 2025 23:20:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B4A9F280001; Tue, 4 Feb 2025 18:20:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AD47A28000B; Tue, 4 Feb 2025 18:20:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 956EB280001; Tue, 4 Feb 2025 18:20:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6E1E06B00A1 for ; Tue, 4 Feb 2025 18:20:08 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1F129801F6 for ; Tue, 4 Feb 2025 23:20:08 +0000 (UTC) X-FDA: 83083832496.09.A902444 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf14.hostedemail.com (Postfix) with ESMTP id 7DA48100014 for ; Tue, 4 Feb 2025 23:20:06 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=s04Mrvza; spf=pass (imf14.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738711206; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OdZPsWM80/SwcXIRugWi1aniusEE35pgpCpmvrN8RSk=; b=GySF/kuGf4ngCQkLZI497isqf0t4kXfYx1L1jGgUCbk0U9BJ/Vj4neyrF0q3iw3MopndLX L/iGUzJVSTYmQGExSVX2Ut3I0GPEhIHp0qxORX2Ur8uo5p0GLvYys5s2RB9ztPqg7NInAc kh2Zvft5CC49roUD9Mtx+R5kEkqvwKA= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=s04Mrvza; spf=pass (imf14.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738711206; a=rsa-sha256; cv=none; b=YfLciRWpZLvSHAnawqQe4ZmoxUrQ7qPcx/TMJh4V0x86NGpasWEMj1pqHx95x9lSd/lCvL L7QFPNuJ5BmTxyyPOpen5Eo3+3evAyeauhqbUD9Tw7p68gvPxLFBCKXtkU/zB6Ko7ugfIY B66Ld12Y3+1rDS0a8l82KzitMVr6RZI= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id A3156A41B80; Tue, 4 Feb 2025 23:18:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CCA1C4CEDF; Tue, 4 Feb 2025 23:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738711205; bh=qUJBcRU8IzR2g8eWA3vSTJFCSmJSY9exr/DxrolVxDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s04MrvzaBkgZ4Q4djHNy2uT4ydLPVjUHpv9OBsBiiPkS9psd4EJ7WrIjI+9Qh05rR jbeBCbpT0Xmn6e8qghS5oywOQTy8RBvBYmIJk/kvclYRFlDg+ILlNJdcI/o5Na+iWd RFqYh0z8b4aN9kLIEEitPLp19eWjatoTe343G5aVo+RwYGmyenKc/gSxA908Edmwsd qXjzNOqGz7+t7cqx1cmljFwi2n+6kbsAB7S0UQ/+sfaeN5F/tvpu7nuIrWK+7Sew1k G9yQtbBmW/4kjK4k42fWtIuPb1nqLo5q4h1Lrxi/Ls9H70QsgFto9U7za019C0AUs1 36dowCzpGanAA== From: SeongJae Park To: Usama Arif Cc: SeongJae Park , akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, hannes@cmpxchg.org, david@redhat.com, kernel-team@meta.com Subject: Re: [PATCH v4 0/6] mm/damon: add support for hugepages Date: Tue, 4 Feb 2025 15:20:02 -0800 Message-Id: <20250204232002.2951-1-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250203225604.44742-1-usamaarif642@gmail.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 7DA48100014 X-Stat-Signature: 1rkpqyjm56sacxfmejw9fpugjut6s46s X-Rspam-User: X-HE-Tag: 1738711206-602634 X-HE-Meta: U2FsdGVkX1+LI3IxUnBtiKvzSXxiGNE+A88mySofvfaOlU9WAvRwnL8y6EIpOKudUPV2MFFN2yKT1f41jKfhAZfZ5LnwTPVdaHbfwB1dCAMONsYYmsGTWJh3J1WpuIBzFomfJgkmq0yq3xPLvBrsN+1XnvdygjuChs/xwGZ7CuvhCskZGZNs8bHDo/ZK0j6NEwvLSGhJPJEQBeJnp6Z8icPttm+HeUGO10SZqq1V4Z52FzQ0Xvgi7QfMDaM+gUTsRQ95Lw8eVa18QWR9GzjcZ7nZWd1s/KC5TdBGiev8Chaa/5be6CcFRh+B9UCK3/fS2w+Eha7Cj7KPjqAlNrkPVCbvQKAXOol4ujCviSNruzdUT53j8e2+5/GpppmrN1AXrI+7rO3hr+h0SgMexvXUftv1Eo8zCnWpeWGs5rcN2Ga0dmF35N1HNrDPLGqqBYqia7WPr6nKNBcY64bQQxDPoIO+0VQXQb1wVtiFcgc3YCpuDbKKN3JaXet681iEyn9DSsxt5Xfqf8W1Zi2w2B5oniTp1FKnyn7NRyOEDk8HY7RBtjGr5rZuAuxXktQXdLNf83HqvuzlRKOEMkaQrycvLnP+QCWUXZ3UozU5gcveo1mVva/zDwSM16GYZMjoiitHYbOIRUBJ5tXbk0Z+onwUkAxLzbnW1vRH24CXGjaEOWnJlT+qv3jcVVxqTX3QXI2XCtnfUSmw7elP02bhay0mdLjpjot9ivtj3Ej9rfAama/9GyXDmDiULpR8VJGeUYdsjSj5oel2fr+XlNrLSi13ZGZIW5QCiEtePQqAtPF5xpS1N31G5QwUUWaEvhtRVGp8www8gvE0tQRNcX1OpZ6yzGuNdjixNIm1QwBvUgvCuurPejaTKCB4nTHJRe/irGP8x1sd8P/d0DCMje1AyCSx8O0WTeUg5y4kn6SZsSGSO9+NG2da/IjZtXLwBnHr2MhiRMs2EWonQo6waxlW3WZ K1ZYTR/K 3/p9tFSRMrOjDJhtkkPaUJV2jvbQ4uqAu9L1VUP4h6sCEEetHU7YS6Gl4hAJNyRg54hBZoMeQdK7KRC9zh7Ax6rxrtemXIqw8rb/UTAVlOOuFJP4PJjatA8r21pB1SMfkzLqjHaRw48iszpo1WUGKH+lonroYnvRoTdNwpKap3VtT/NjAxnlo4/Vj7SWI6MhuzvH7zXAV1HGOYTo/QwJlWhIfPDzEgsFCOrOD6cbMte1dGf8QETJNqGOP1ihv2BpdQ/jf X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Usama, Thank you for continuing this great work! On Mon, 3 Feb 2025 22:55:27 +0000 Usama Arif wrote: > This includes adding support for larger folios in damon for paddr, nit. s/larger/large/ > which means largers folios will have their access checked and will > be considered for different DAMOS actions like pageout, prioritization > and migration. Technically speaking, 'paddr' was supporting large folios, but the support was implemented in a very poor or broken way. And you're not adding a support that didn't exist before, but improving or fixing the existing support, right? Can we make the sentence more accurate in the way? > > Patches 3-6 add support for DAMOS hugepage filter type. This is to > gather statistics to check if memory regions of specific access > tempratures are backed by hugepages of a size in a specific > range. This filter can help to observe and prove the effectivenes of > different schemes for shrinking/collapsing hugepages. > > I have kept patches 1-2 as part of these series as the later patches > are dependent on them. I understand the two patches will make patches 3-6 more completely work, but not necessarily a blocker of those. So please feel free to split those out to another series if you want. Also I think the second patch need to be revised, but even in the case, it might introduce unnecessarily huge complexity for small problem. Please refer to the comments on the patch and let me know if I'm missing something. I'd also ask you to put logic and API implementation before sysfs implementation. Added more comments in detail to each patch files except the first one, which already got my Reviewed-by: and not changed in this version. > > The corresponding damo PR is at https://github.com/damonitor/damo/pull/20. > > v3 -> v4: > - Add support for large folios of all sizes, and not just > PMD mapped hugepages (David and SJ). > - only get folio while checking access/ applying DAMOS > scheme if the head page is also part of that region. > > v2 -> v3: > - expose hugepage via sysfs even if the kernel is > built without hugepage support. DAMON will just > just return 0. (SJ Park) > > v1 -> v2: > - Wrap DAMOS_FILTER_TYPE_HUGEPAGE case with > CONFIG_PGTABLE_HAS_HUGE_LEAVES (SJ Park) > > Usama Arif (6): > mm/damon: have damon_get_folio return folio even for tail pages > mm/damon/paddr: use damon_get_folio_in_region to obtain folio > mm/damon/sysfs-schemes: add files for setting damos_filter->folio_size > mm/damon: introduce DAMOS filter type hugepage > Docs/ABI/damon: document DAMOS sysfs files to set the min/max > folio_size > Docs/admin-guide/mm/damon/usage: Document hugepage filter type > > .../ABI/testing/sysfs-kernel-mm-damon | 12 +++ > Documentation/admin-guide/mm/damon/usage.rst | 17 +++-- > include/linux/damon.h | 13 ++++ > mm/damon/core.c | 3 + > mm/damon/ops-common.c | 2 +- > mm/damon/paddr.c | 75 +++++++++++++++---- > mm/damon/sysfs-schemes.c | 54 +++++++++++++ > 7 files changed, 151 insertions(+), 25 deletions(-) > > -- > 2.43.5 Again, thank you for continuing this great work! Thanks, SJ