From patchwork Thu Mar 7 03:00:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13584997 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 5007BC54E41 for ; Thu, 7 Mar 2024 03:00:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9CAF36B00EC; Wed, 6 Mar 2024 22:00:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B1906B00E9; Wed, 6 Mar 2024 22:00:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 72C676B00EB; Wed, 6 Mar 2024 22:00:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5FD456B00E7 for ; Wed, 6 Mar 2024 22:00:26 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8B5D841099 for ; Thu, 7 Mar 2024 03:00:25 +0000 (UTC) X-FDA: 81868739610.05.BA02AAD Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf23.hostedemail.com (Postfix) with ESMTP id 844E214000F for ; Thu, 7 Mar 2024 03:00:23 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MNWVZ5Ua; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709780424; 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:references:dkim-signature; bh=r5r7qrJjtIVjLMR0fRmsUwbbYodGkNXh3lv0AWtGVO0=; b=Szd3MSYmNSqRMiBLEqE3JG0zQcC4eHqQfa7ZxjzmfcWORg+DoyVJ/KbOs1OXboUZM8pUk2 qk85du5RZoHmMEuNVOB79Ae1AurrxiqUjLKqhq6GOM1O2NNjurWlmWpP1h4rHxtIB7Yc1l WVdiZsLe/vJFw/39gpZhCeCi+bYE7NE= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MNWVZ5Ua; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709780424; a=rsa-sha256; cv=none; b=xniYNYw8aV3+bGgiJH86x+yYcc3lBZfwTZDsxR31gPbsWx2a/ApiU1QFQR77YGaj7ctBqN t5zz/ZfrSZGC+H0GovSROUM8XJeCb44NyxhZ+0spwUqbyVhr/B3GbOiuxlk4SGaIWDnSSG LwPdPFxo+sh228bpJpTZDefpq8bbJ1A= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 20F61CE08D2; Thu, 7 Mar 2024 03:00:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0F5FC433C7; Thu, 7 Mar 2024 03:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709780418; bh=SKDskSd9+RHTYzohWkfkmurFwjgubMDTQl6vfvCQs5Y=; h=From:To:Cc:Subject:Date:From; b=MNWVZ5UaOouUV0GmS9soRfvZz7uEDLs0c9qjfpsMFIyYID5x1KTMaegxXZoOlRuZN trL7xfGG4vS3gFvPPGpX5x0J1DPYqJD1dwSLAG1fwqMiLpQ3RwG07ErEiT1rAm7aLj bVuuPMrbUwmZ2QMMBPt4yCvO6f+KrvKCqGLKMQ2aSxSsgh1LNw8qTIrSnnmXcRPY7C kepNZ50op2NzFicOAZOu2amTBgA3aOaqfsrKnLv590qXwZi/N8EL2CGVEnyNeVKhBs WwzOzZ0rou2lMvnV6+lOjnBAMlp6GvtIatIj7xYnydboCnleokcqV1SjqS3vbiaArH Gt22LHfxmGU4Q== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , honggyu.kim@sk.com, hyeongtak.ji@sk.com, kernel_team@skhynix.com, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/3] mm/damon: add a DAMOS filter type for page granularity access recheck Date: Wed, 6 Mar 2024 19:00:10 -0800 Message-Id: <20240307030013.47041-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 844E214000F X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: xj8kiug6sbdcue7u4a7h38p9shst3b51 X-HE-Tag: 1709780423-748973 X-HE-Meta: U2FsdGVkX18wvwQ+QB4LE0LtOYNPMe9/2F7r45irU76HEkxVpK0KEpmNeZI8bTvNraNMjok7BgYHdPD6wUYons4d/69aqC50yiWHOhmGOwXm43eMQzqGO4614rV555LjzF3iw0neFVaSSea7y0Lo5WB4bIzfY2YLwPSKmWxNaPI8L1GHTlH7LagKMnzrlyK5Oby0ZoRvU+dG7mYQqVQwmPDyxLRs2X4vJ6vfZczKVhhMw5sc5zATheUY4HW7LpYGmvYTqXt8KMbS8TOTJLUH7U6QYOmPUkWWxZVuv+htcoryg7B2r2BcaTRjb6r9+mhx5s/oCO7djzc/cKd43je7kJ94kpRVcm0ObqQJTLDrkbIMs0t0V2DjGiv63wcujouKEovFEvhW8pTROZ1Semg6n60Q9ovkrMTuXC2Y5drWZsj5z+kVpe1GGvigqv8o1/dsrZPZVsj9dhSRAlIfJNUCLB2b0zxnW1/pIHlN5Ah178qbVnWlsmhFPB06MbUXGMqEIM0O4rJJDZAt9pqLck8hJepkNQ4JyceHyVzgNhO+FsImf4YCRC5A6LdT5g+3++RnewRCJsbXWaW7u6bGYStwLB9iDedvDex3Y/mTiksMXv/e3owdflJn+Ej4qdBwrkAYp/RBM15vCIQdQn/4QUOmtA4aSK53C8EupHYc8JD78W1TzwhxwmKPO7ZyV2mNhNW62Sifv6M67OrHoFqlnpS3RKQziqfwzaHSe2c8SRJmVArjgUKEixu7FChGWDr+ajtLAkt31ctR2AZzJOR5oMNJ/lmofjBm/vf5E8vRMlch3RJcjX+sCq6MiH/3GTCqmuBFWNA2ubeyp2oXvxunVW8V6idpdNY2KN6JyYysgADSBEVpKgmy5g/2RaN4rLssw1KAf+2tCVYUoiNGa/E6U95+9oSlKS5dF/FYJ5xazY92cRWO5zGRLK5UDCADn5EGIclD8Jstz0ZeD/6cOH14H4Q 7mH65F8k FrJf8fDqQoMBMB9Fo8BRZfvSzwYQUlFaDLYZqNiBotESSOAJuRQQlGEn9gWHIvmuqiB7MBE4SS4I7VSdAJzVEBOsLehXRfvY2vm0MaApKNYJabgEIm98Z6XfVM+F5e1TRIwVNzZAY7UElyURaa533iJ0IuK5btTsLFet9kK2t44THbLcibxMx74ZceFT1G/lKRIYO+EQab+E8tvGFrQzPhAz0YxwtK/4Ikf+FALhiHHSDMUM= 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: DAMON allows users to specify desired ranges of overhead and accuracy of the monitoring, and do its best effort to make most lightweight and accurate results. A recent discussion for tiered memory management support from DAMON[1] revealed that the best effort accuracy may not suffice in some use cases, while increasing the minimum accuracy can incur too high overhead. The discussion further concluded finding memory regions of specific access pattern via DAMON first, and then double checking the access of the region again in finer granularity could help increasing the accuracy while keeping the low overhead. Add a new type of DAMOS filter, namely YOUNG for such a case. Like anon and memcg, the type of filter is applied to each page of the memory region of DAMOS target memory region, and check if the page is accessed since the last check. Because this is a filter type that applied in page granularity, the support depends on DAMON operations set. Because there are expected usages of this filter for physical address space based DAMOS usage[1], implement the support for only DAMON operations set for the physical address space, paddr. [1] https://lore.kernel.org/r/20240227235121.153277-1-sj@kernel.org SeongJae Park (3): mm/damon: add DAMOS filter type YOUNG mm/damon/paddr: implement damon_folio_young() mm/damon/paddr: support DAMOS filter type YOUNG include/linux/damon.h | 2 ++ mm/damon/paddr.c | 29 +++++++++++++++++++---------- mm/damon/sysfs-schemes.c | 1 + 3 files changed, 22 insertions(+), 10 deletions(-) base-commit: 78a854de1f605e99ccc20df1775f237120cca47c