From patchwork Thu Mar 7 03:00:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13584996 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 89A81C54E4A for ; Thu, 7 Mar 2024 03:00:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E5AA26B00E5; Wed, 6 Mar 2024 22:00:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E08C06B00E7; Wed, 6 Mar 2024 22:00:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5C106B00E8; Wed, 6 Mar 2024 22:00:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B6F196B00E5 for ; Wed, 6 Mar 2024 22:00:25 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 89B27A1716 for ; Thu, 7 Mar 2024 03:00:25 +0000 (UTC) X-FDA: 81868739610.04.06C5A86 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf20.hostedemail.com (Postfix) with ESMTP id 7980E1C0009 for ; Thu, 7 Mar 2024 03:00:23 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Xfvl0OYl; spf=pass (imf20.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=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:in-reply-to:references:references:dkim-signature; bh=KW7k2yEs1IhNFivzAY8dNuVjq4m3njEs7sEi/VP7zyk=; b=zveswa2oii0OXOG/mWUlG6t/1AW/Q01FHoF/HKxPg3P127SJtUAG7weYVYhTlZ+iRqDJoG XauvW28ajPP5mQ7BTAIvQszwJncALavh3NRYt2La5qGkYRDs244AdaJBJyqBaeMViofZ1B Vw00bxUUNZhEj142PiXJHpAuyyeVVgk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709780424; a=rsa-sha256; cv=none; b=vNT4uy1aIukT8hCwpQNPKqieGL5sFct1tFruY1tx23BbXkCS9jpxvEu4Ktb0Z3B9COyR1P qmQunM2Aw2vpjpW5ADRRftYSMT0kuWxXJ1/I3e5T0UwT3ZdpT/Rde7l7k8fg7i41LA7mGq veSPwNK3LHWfG9BwMF4mO3MzLKVPf5s= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Xfvl0OYl; spf=pass (imf20.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 230F8CE23C5; Thu, 7 Mar 2024 03:00:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C52C9C433F1; Thu, 7 Mar 2024 03:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709780419; bh=LO88k+dd/BebwXvUzvdC1iypWVc1Mb6U9juVYlKD5Nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xfvl0OYlXalMPZ5OQy3u2by1UcGM63J6lYhw6OnPh5BnjI7XbNx9yehBIe98iibpT mVEKZQGkrZK0nQgcWw/M7VsDKZGgiUz/6W5vvgcZScmUgyu7T75nOC9STn59mm8Bte mJfbJOPDheRHml1ByYZpQbHQdeRj120Sjddcr/1nHUd70BI54sCBVgXEXYJketb0Jt z9IUEX3UDo9GyhOR8XDgyW5k+0gxOUQs29Ld4RSIAngv7MO0XbF7f8apdD49lPDFvA NZyTKlEO/ta8kLgllFMMiE92wUPs0XsSDFR+vGs9TLrlKLcicF3HkPvRcWv7Ffq43e QpdZFfAX9k+5Q== 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 1/3] mm/damon: add DAMOS filter type YOUNG Date: Wed, 6 Mar 2024 19:00:11 -0800 Message-Id: <20240307030013.47041-2-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307030013.47041-1-sj@kernel.org> References: <20240307030013.47041-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 7980E1C0009 X-Rspam-User: X-Stat-Signature: dic5bso78joe39m1wxh4n5m4h9p3gq76 X-Rspamd-Server: rspam03 X-HE-Tag: 1709780423-805317 X-HE-Meta: U2FsdGVkX1+dNiVSqZfB05VKj3T+DzVTEv/6484NhogtXhPJroGwzL3yIBPBNX7rl7D1C4AtU3hmQ4SrThJFkHLzkb/S8sbNEgmQ/4zeFIEAjLOvnnipnI0Qdt3kqcZgFq8e/p3Q4yy0Ppnu1c87rFZFXqMwGknaGdQOuwaIWyk3d+nXWoW7TBT/A0EJj5Rm/6L+GUD1zcY9Hr4rYpYraIGJ8fafNWxiISHuVBPIGuh1KWAyGOOX0oMbFCaYkIHFkarmsaW1xC1IWd9ySYtBH3tBQpNHlHZIwhA6LpEtQDaXPl5ahxJT+H6jhtNmCuY1DrB483KPWJyE2+IUsflWEfgfbaES0Ihbey1h+m/C4KuHO9e+c38w4z7M7/6efGGtXNpnEGbHGRpE1lISPj1/jq5je3LTmjMVNBnZCUK1Ce2ea2BdlfjCYDP6qijGk336TIQDJrck+L6s3HTkczx6JTyS5s79XrVSwD9uJujEGPVUjHQehyho2NbG/Z+sRLtf5CoG+JbmZdduPztVe36kNIOZX88W8PVsvpW7ai1J65NUx8A2hDmPzb+UygXlRXabZoLqdjIRxH/owVwfoXAOsrya4oTlxoKQzLkY7btv4s0BZcNhvok4R/P68M/YAsUj41vtDV2j/ApI6GRy2Pl/TvRSU6S4SrTdPTRVZW9GwZ7QiN8TQWubh/zQixr8I/5U2RC3k5Sp42Mln/YN+q60qRnISbniaQgNp3DA7EZlPinkcQvoumzfdEnHJ3CGSlLfoRiBLi6g0HLp4HmbwkfabSuoTnTt3QpnAnMrajhh4vEnpyWObvv5bNepHsnOPmvcyS0DXIB5CIEEaixm+5UJMt8jBKdcDOUeoF3sqtShwh668X8F/rIHH067xZOVDEGSyO63UrCsqI3v6+eaB85z2QY6aCgQ/mna2SpgJEqro8Tj6LxlJ+0kh1KlSZxEWDVML78Q9erZ23ZbEmQB1FI vP6FLR6w xIeEaLtU6mBa9ffd+WB9B2Vzs7otkC8NlWINfvqXixmatdynG7ReLEKM334fF4rcVmTiPjhrLfPa0R77P/JQRrrs9pXmuqN1/qRNLHjouYkCsJu3nbYt5b//mG4AHFC2KxcJoH9Oc488ArSweZd8T2wnaQKKseWOJ6t+ye4M14MFpdpHfiEo0jVgginOYB31THhUxv0uzJjz5vWcv2Dy0AP2CqOVpO+2pPkkNpSJ6IBlhDY4= 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: Define yet another DAMOS filter type, YOUNG. Like anon and memcg, the type of filter will be applied to each page in the memory region, and check if the page is accessed since the last check. Note that this commit is only defining the type. Implementation of it should be made on DAMON operations sets. A couple of commits for the implementation on 'paddr' DAMON operations set will follow. Signed-off-by: SeongJae Park --- include/linux/damon.h | 2 ++ mm/damon/sysfs-schemes.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/linux/damon.h b/include/linux/damon.h index 886d07294f4e..f7da65e1ac04 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -297,6 +297,7 @@ struct damos_stat { * enum damos_filter_type - Type of memory for &struct damos_filter * @DAMOS_FILTER_TYPE_ANON: Anonymous pages. * @DAMOS_FILTER_TYPE_MEMCG: Specific memcg's pages. + * @DAMOS_FILTER_TYPE_YOUNG: Recently accessed pages. * @DAMOS_FILTER_TYPE_ADDR: Address range. * @DAMOS_FILTER_TYPE_TARGET: Data Access Monitoring target. * @NR_DAMOS_FILTER_TYPES: Number of filter types. @@ -315,6 +316,7 @@ struct damos_stat { enum damos_filter_type { DAMOS_FILTER_TYPE_ANON, DAMOS_FILTER_TYPE_MEMCG, + DAMOS_FILTER_TYPE_YOUNG, DAMOS_FILTER_TYPE_ADDR, DAMOS_FILTER_TYPE_TARGET, NR_DAMOS_FILTER_TYPES, diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 53a90ac678fb..bea5bc52846a 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -343,6 +343,7 @@ static struct damon_sysfs_scheme_filter *damon_sysfs_scheme_filter_alloc(void) static const char * const damon_sysfs_scheme_filter_type_strs[] = { "anon", "memcg", + "young", "addr", "target", }; From patchwork Thu Mar 7 03:00:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13584998 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 E2385C5475B for ; Thu, 7 Mar 2024 03:00:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C68436B00E9; Wed, 6 Mar 2024 22:00:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C6B56B00E7; 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 7EE096B00EA; Wed, 6 Mar 2024 22:00:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 609AB6B00E9 for ; Wed, 6 Mar 2024 22:00:26 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D509B1A1067 for ; Thu, 7 Mar 2024 03:00:25 +0000 (UTC) X-FDA: 81868739610.29.A3712F5 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf02.hostedemail.com (Postfix) with ESMTP id EE59E80013 for ; Thu, 7 Mar 2024 03:00:23 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SEsAH8mQ; spf=pass (imf02.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709780424; a=rsa-sha256; cv=none; b=laXg3D3uY/Qv5jd64JBEYYxLBah/aGJZrbgq+9sw4ZQcUFUbVWpAbQYIArg+xoK8LE1yD7 qk5ed3F2wdOAvugoi7A9jufUaBXsu19Vhne/BABfeM2f6NEoyRhZtNqPQ6+mIM9tvsQjoD L55Xa2AbztCO/e90sdkII6qCvgFyuRU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SEsAH8mQ; spf=pass (imf02.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=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:in-reply-to:references:references:dkim-signature; bh=whkGAvYGCtdVg8/S6GPler0vrPFgCGQGPrgNgIhTYuo=; b=fnfeALJEISmlt2f9j/8z4qYrKOG7iXf+CRJipm2FKLBg19WdLx/t9qDop4KXMTJmd0MLWq cJr4d8vC9cyWBIQEfOfVYyczfJpn/4mJnOXJcddaU0oAZ76SKoM3JHc+uGGhn8YFCweU6G j+6sZ0DpIJXAK+Iu2gMEKmCajzaIUP8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 12251CE236C; Thu, 7 Mar 2024 03:00:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97DD0C43399; Thu, 7 Mar 2024 03:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709780420; bh=0eBYRMuRF3ohUK1LpjNQClNe+yHwQ6lEwKTScu0clBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SEsAH8mQ0+MJ9898A1IG2SQIvaIy0pUH8KdiOgj6Z61nklkkDbv+he/qFjFiJ0lI/ OrhEf2N80oOQpHKx/HJLFeyiiy38u5gHHpIhVWyGlKVUjrPVamcW3hYTrv/kXdES1a zs1s9szWp0LKHT1qi9u4/Ew0lSvG5ixmO1AAw2yHctf0QyEv8poK6Sp3rHyvGhN4mz lLKFkrBvCu3F0hhxuSvHt5/OGxd8MfRmOmV7oo1af7NugjdAZi3l9liSAfR/Vvs2kY ekTXh7f9xZMv5Z30FdHKya4JPNfZ6fcptOoyKT8ua7rmkesYAcdM5r7I4pS8EIKsdc 9KFnL4DWWQ4xQ== 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 2/3] mm/damon/paddr: implement damon_folio_young() Date: Wed, 6 Mar 2024 19:00:12 -0800 Message-Id: <20240307030013.47041-3-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307030013.47041-1-sj@kernel.org> References: <20240307030013.47041-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: EE59E80013 X-Stat-Signature: qzh6gsgjoi8dtzqyphij7h3ua4qbhd3x X-Rspam-User: X-HE-Tag: 1709780423-585353 X-HE-Meta: U2FsdGVkX19nMXanVeZzgpus8Ny1fIVyVhv4hrjciuVVbN4Ztit+ABlLWbtR7O4pag3QnAZeXZ3mrINNBZApUs74F7cbnKlp34arg/VfdDfdOmxjKcDGapBkTiys6nRmsImaW3olcSIlVUipu42TXWsivy42TE/9wLl6yzrqajYHgzvKNwZKof5uqWJjXIY9sCf0MHHwLVXrE9JZOkqTQbziJQgI3B6XH6t5wQceTgG8u3GLr8aG3iylQztaUQhRAsqqxEbPi0u95ZkXNTsh2qZQgy9rS6kkAQmh2ZEvvmprM7s7CSqwfq8rDsAy04O6nYKTpzXJTEbiHrEqVzLvdFGMEgiCYEeuMXuXT7hqGw9aU2StsBxFZFhgJ0YyH//ovT/ko/eUJA/Z+rGkq7zqLliuuaPZHUuC0oexx3IxIziioliQ+XOKdy8zeU3VfDW1ZlYy9ytgHBcM+tnq0Pd1pMed++E2ievzwZZ3JiozDBG2e1FBtHYIQ//7PDLCtIPTcWqFt+1IsjuzsC3WbEm3l+Y+yamRBKmCdL+z41FUB81eblHwx8FiuuUpqUWVQXDSHnYs6Q8vX9SIzxE09+BcWUoRFDaERMcJgAZdDE+LtCs+T9PwVS4Rrza80u0d3AO0EAdu48mGNv7tLzvbllUbsYKIxhEA7u7KTEyOVDs4mYH9Y/2CYNxAFdtRIamP+Zyh7VPwMwLugzl4mv7p10icpqce0SIP6wgdTQrutpRZsqa5hT3zvgWlqsMwH74uuKn0WbbTaMGjpwAMzVjNriDVzZ9F1gBqyOxWvw2tKX1AohS1ojaka9ZWWGwIszLqzMeAM00qi3Hfz469JKV5wO1jB1RTzHvQM7Hsje07DNCnlOhLWLGK3V3g0L9rbvkQtCpJ0CA1cc3FNlIcW0a44yMAioje/EcUj5C9WeSypwKq0h1LIcpcq2XeoDrGA5EEK6OQEdm+6vLMkP8UHdEJJ+S 4nkgJ9+w qE9MV X-Bogosity: Ham, tests=bogofilter, spamicity=0.000033, 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_pa_young() receives physical address, get the folio covering the address, and return if the folio is accessed since the last check. Split the internal logic for checking access to given folio, for future reuse of the logic from code that already got the folio of the address of the question. Signed-off-by: SeongJae Park --- mm/damon/paddr.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 5e6dc312072c..deee0fdf2e5b 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -111,9 +111,8 @@ static bool __damon_pa_young(struct folio *folio, struct vm_area_struct *vma, return *accessed == false; } -static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz) +static bool damon_folio_young(struct folio *folio) { - struct folio *folio = damon_get_folio(PHYS_PFN(paddr)); bool accessed = false; struct rmap_walk_control rwc = { .arg = &accessed, @@ -122,27 +121,34 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz) }; bool need_lock; - if (!folio) - return false; - if (!folio_mapped(folio) || !folio_raw_mapping(folio)) { if (folio_test_idle(folio)) - accessed = false; + return false; else - accessed = true; - goto out; + return true; } need_lock = !folio_test_anon(folio) || folio_test_ksm(folio); if (need_lock && !folio_trylock(folio)) - goto out; + return false; rmap_walk(folio, &rwc); if (need_lock) folio_unlock(folio); -out: + return accessed; +} + +static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz) +{ + struct folio *folio = damon_get_folio(PHYS_PFN(paddr)); + bool accessed; + + if (!folio) + return false; + + accessed = damon_folio_young(folio); *folio_sz = folio_size(folio); folio_put(folio); return accessed; From patchwork Thu Mar 7 03:00:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13584995 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 9459CC5475B for ; Thu, 7 Mar 2024 03:00:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 000666B00E4; Wed, 6 Mar 2024 22:00:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EF2AD6B00E5; Wed, 6 Mar 2024 22:00:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE1936B00E6; Wed, 6 Mar 2024 22:00:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id CBF686B00E4 for ; Wed, 6 Mar 2024 22:00:23 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A3032160B84 for ; Thu, 7 Mar 2024 03:00:23 +0000 (UTC) X-FDA: 81868739526.19.9DC75EF Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf10.hostedemail.com (Postfix) with ESMTP id 18D0FC0007 for ; Thu, 7 Mar 2024 03:00:21 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Gr9yFIso; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf10.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 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=1709780422; 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=PKLObw492qyGSLr6A5sSBR5ytCVigRuPnbDjcYv6NmI=; b=hC3Cu48enExYMPVtHEkdChqGd2oJhEQwSe4/MVlF9Icrzp3pAdGymxGTRhDW3bamf+HZaQ RjMPxDj8ZFUpMiptNrEF1uMlJWeG9MtJmZDPXveVsYlfzzOcEPrgH1AHzlzU3U5LpzAnH+ RhMfdQ4hWQSCwirQnoe5cgql7vnsZMo= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Gr9yFIso; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf10.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709780422; a=rsa-sha256; cv=none; b=AHAVZfiLC7GWbbecgdwDaJDJFiWDimMumWFfQXE/Zj1mhsnupYsTeYb1VGz/oQ99rxOeCh WSSZkogecq7m+fr1wJFZbJRQurxf9UqZoMNoYTytZcCwUZ43Y1IaZ4eaH3dyVaoohHQAsG IklVd0jvmQbCZQHOz0NRlbKqiW2Xakg= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1EC7161AB8; Thu, 7 Mar 2024 03:00:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CFA2C433A6; Thu, 7 Mar 2024 03:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709780420; bh=T4Zlt0HI2JO9pfzPw6anb118M3jARiv+TpO7SVPb1+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gr9yFIsoRpLje3SvSmfKYtWNR0uF3miMXc3LPHKsQdFSm9I+Tm4opJXvrkVMMmD3a jLeGpR1MNiipgS8Fs1hljL1UEMO0+qd9APCsbYJjrn0vZbc3dGYayyBIyW4qw++Q+f FJIxtv3yoBl4sUqUdis8IjJkjkkUm2xKA9Xr/eGFcN/S8cIiuRVBeWm636Z3k6qigh aMetigmopMzSlpeWgw3m1T481zUJtpufmVO0T2zISAyN/1SRgZUWDXOyKpgzLiNE30 hqoEhcnBLYXzqzwYIeHdQOGTb9wQAQI64t7ETWJVBakfeE4XdXny8xIed3YHH5t28n lfVc8S8ugzlNQ== 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 3/3] mm/damon/paddr: support DAMOS filter type YOUNG Date: Wed, 6 Mar 2024 19:00:13 -0800 Message-Id: <20240307030013.47041-4-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307030013.47041-1-sj@kernel.org> References: <20240307030013.47041-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 18D0FC0007 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: hx7mpp3ojypbw7cmbwar8t7irmy6toko X-HE-Tag: 1709780421-928741 X-HE-Meta: U2FsdGVkX19cKkiDIPNcV2f+bq1jXmtZQdz38a37sIkXihw0UkpjxZqK0/WqxjZo+VlKE6n4DC6z8Xf5f4/Qb4WPhkPK+MCYwv24fpruW/GNeoV1mmKMqn9bIl79xNEpKHaFHHlxvytwK0ubK/WQXiXVRu5HGdDs7YPwPamcPWgdtlbTAuozdWiRDb2/ODE7o5rEVJxa2SGzCJlyu5nfpJARrgJpVA188EHzCMN5+s8EaWkdvM/+06ToeRuqMQIxwjofvqiiWqgdYC8FquEIpE+tk09ofxia9fiJLq1X2iNnM+d6b611rs0DYaLXfnJSLYV+hE7+5sS+f2rspgpauUuFnTSMytRY0WxJH/dWfobAhjEHFbTcroQa5zqcNoDfAColaHVswNO0DPAhQIeaF6V30VSqut3hWzQdxqBN3O8cq5B2SVrpO1Az+C9ZPLdEuhVOx71l4xw1ehEWxYlj23Iyl+tywF8kw5rITkxlWg9m8DGi8WmgbURg4yPBmZ2p1Pa6uxWEFY8Y6YhqexieJTAof8OC3ExEkZcwA4t/XcSFSBshxUHpmzQ3quLnrC4SFOamrSOqALkfmCgSBbHSq97QrF0BzOQlmF7ij4NmMRA0Nz7zr2os9JmZrM9xGX+guRo58NAzckHOJIplFFb83eofr7kuh9YZsUM+/uaDELID4lmYOzHBfmZFYRbnW+6RmTt2N/H+1r5Xtk0LpxB8RmBRz6VAyPthllBxTtsyAiCzzJ374T00TzIZMZNHTLktLTzbUdLLnkj8L7ALaWryvndZ3wEGZ1lcLSu6owP7au2XsWRE3/fG++/kNmmvFiuMsXfiWDnQPua3zQ3x1gq9FzVek2WKU0riyzi/lbW73iW0fp1fIwbPmmw6VZmSnB86Dof+8eAuGUus6DkzgE7wT9/S7o9yXsxqDw8hJmuGwtc= 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: DAMOS filter of type YOUNG is defined, but not yet implemented by any DAMON operations set. Add the implementation to the DAMON operations set for the physical address space, paddr. Signed-off-by: SeongJae Park --- mm/damon/paddr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index deee0fdf2e5b..52e4be7351cc 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -209,6 +209,9 @@ static bool __damos_pa_filter_out(struct damos_filter *filter, matched = filter->memcg_id == mem_cgroup_id(memcg); rcu_read_unlock(); break; + case DAMOS_FILTER_TYPE_YOUNG: + matched = damon_folio_young(folio); + break; default: break; }