From patchwork Fri Jun 14 03:00:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggyu Kim X-Patchwork-Id: 13697814 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 C8F66C27C4F for ; Fri, 14 Jun 2024 03:05:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D21F06B00DA; Thu, 13 Jun 2024 23:00:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD1F56B00DE; Thu, 13 Jun 2024 23:00:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B72026B00E3; Thu, 13 Jun 2024 23:00:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 990A96B00DA for ; Thu, 13 Jun 2024 23:00:23 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 54A32140404 for ; Fri, 14 Jun 2024 03:00:23 +0000 (UTC) X-FDA: 82227990726.12.CCA21F7 Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf11.hostedemail.com (Postfix) with ESMTP id 7054940009 for ; Fri, 14 Jun 2024 03:00:21 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718334019; 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; bh=Rl5E73uGRRcKTVvOfVp8xwFRVoPsVjC9ryzV00Kphw8=; b=k885cYJtgc2P4V6Z7R4fCxLlMdtZePRzvHzC7wZkv8+2ic/A34b8sUjt6QXYUVLdxbU9K2 +k03RQ3N7vbY6zDtrfDQEGFLRM+PV1tPSA4BtWBfOVZ52sNCo0cVCBy7hlMjqqUMrR0Jo2 3cKIwEQ5EPX6XM4Dr3pZ5CFDxJfnwqw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718334019; a=rsa-sha256; cv=none; b=F43OF99IrOGTVSTda0+6/jVugXuFW3ZQPob9YCF/j5Cm1eMYDL0WyhvZXCCdjvQs+8TZlm 01U1m5noQCd+q/Ny5JMkbHDcO5MiNhuLe9vV8tmnCo9anSKC+cMuhP7Jj/sgej1tNQ9sz+ t1udveveQWmU7Nkexry6gxEeew+GF7k= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com X-AuditID: a67dfc5b-d85ff70000001748-2a-666bb2426825 From: Honggyu Kim To: SeongJae Park , damon@lists.linux.dev Cc: Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Steven Rostedt , Gregory Price , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, 42.hyeyoo@gmail.com, art.jeongseob@gmail.com, kernel_team@skhynix.com, Honggyu Kim Subject: [PATCH v6 1/7] mm: make alloc_demote_folio externally invokable for migration Date: Fri, 14 Jun 2024 12:00:03 +0900 Message-ID: <20240614030010.751-2-honggyu.kim@sk.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240614030010.751-1-honggyu.kim@sk.com> References: <20240614030010.751-1-honggyu.kim@sk.com> MIME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3OGKXvEfk/DsjiNPAEYR/lG7Pyu2hynfbovu5e0z2ErXgyBR+MX3u7rWKK1szxU8Bw9feDg1bY7Gea7edMFrcIgdOP67KDgtdqYKTp1xcN3jEwmhslUWHSf/qChLrwMaFA/ay8E/2KssHFvsOZ17Qg581HZfuOdLJYC3pqZcWIXGT14b3V7pNhE+4QUan43/ecxs3HExNq+3bs+o+fVCPaK5f6coKwAN4V1zDj1pA7zszObm7eAT/6q9qz04z+5MYYqIxmrtS50uiw9miynvQGLGHLtEHOBnGG2AvBc3g86vWWdVaXvK4xtONMu9fnUZgxJvYg4rGYdvrwxw9jOqz7b8QJ6c28mM/UKjUpc/8HD5o/vFCNOG8YsfymOtWSDBCJlDX1ACUU59x/NEN0//GiHGBAUghnWFPhj8CvVljOlLu1spkK+NsjcYZFYOA5NFPOA+8LNU9tcdilZ5WatFIO2Jcf/tqh+a/XZNfjaw6APnduUVeRADQr6pGJHX47odgxrMaYRoFUXc8dTWBdgPkVeT+vDKZd+HqZAGglBg5pmsQoq5XSUAiIhwng8P6qlF/oxy7DNcW9TAjbKcKBve/KHkyCPhnUEYoJ+nX1m3DQEbd47Ivs+VWuuVUrGAFOOV8BQQN2ZFkvlC4 1K39WMdR lO9N4IaKi2aar9+k0g00oADcmoVNxxIeXFDccSKPHWQ6YrMMWAK68aZIZBuUS4CtDej4uWIUALBy242GvEOB86YMQtfMMiyFXvhsDI97mXdjuGv8lEd9gwXcGtbaSy372KcxGxs5H3AD/M5caoaKg9bu9YTOmLoUoHJR9O4QVOyJvm9RUCo7h3fI7/KFABLPZI08R9gaWfaOU/lQ= 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: The alloc_demote_folio can be used out of vmscan.c so it'd be better to remove static keyword from it. Signed-off-by: Honggyu Kim Reviewed-by: SeongJae Park Signed-off-by: SeongJae Park --- mm/internal.h | 1 + mm/vmscan.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index b2c75b12014e..b3ca996a4efc 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1052,6 +1052,7 @@ extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long, unsigned long, unsigned long); extern void set_pageblock_order(void); +struct folio *alloc_demote_folio(struct folio *src, unsigned long private); unsigned long reclaim_pages(struct list_head *folio_list); unsigned int reclaim_clean_pages_from_list(struct zone *zone, struct list_head *folio_list); diff --git a/mm/vmscan.c b/mm/vmscan.c index 2e34de9cd0d4..2f4406872f43 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -916,8 +916,7 @@ static void folio_check_dirty_writeback(struct folio *folio, mapping->a_ops->is_dirty_writeback(folio, dirty, writeback); } -static struct folio *alloc_demote_folio(struct folio *src, - unsigned long private) +struct folio *alloc_demote_folio(struct folio *src, unsigned long private) { struct folio *dst; nodemask_t *allowed_mask; From patchwork Fri Jun 14 03:00:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggyu Kim X-Patchwork-Id: 13697815 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 4E4D8C27C7B for ; Fri, 14 Jun 2024 03:05:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35F4F6B00DD; Thu, 13 Jun 2024 23:00:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 342B66B00E1; Thu, 13 Jun 2024 23:00:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D64F6B00E0; Thu, 13 Jun 2024 23:00:26 -0400 (EDT) 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 F09C46B00DE for ; Thu, 13 Jun 2024 23:00:25 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7995C1A040D for ; Fri, 14 Jun 2024 03:00:25 +0000 (UTC) X-FDA: 82227990810.21.C3F761B Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf04.hostedemail.com (Postfix) with ESMTP id 82A164000C for ; Fri, 14 Jun 2024 03:00:23 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718334022; a=rsa-sha256; cv=none; b=OVKOJYoGBjKib/QB47MjPiiI/Z5JnMYeYWJIhuoGAGorYnrz1eEsS+/oSR1ckS37MFJ93M Hiwes2NwLW0K5PcHZWKnjMfwywLBvDS4JHpIGH9BDah1P6Y1Qd9TRAQ7rWzuI7QP+ay1oL O8ThI6s77D16Jw6XSXpSRSyM4N+IgKw= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718334022; 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; bh=5VtI+bJ13cRh+kyLD+iKCxK1fRdf6SlEPiGoCyvrAPo=; b=kYVQ4RB9MSkWSq5Qt0fjvo3mjSzAtrjubk2VLTQ07P0mUW0rxrj/Vj8qZPsBsB09jpMZoG JfeWscUk/87y+/l4G5FFe5stbTh0B15030N9Fk6acqagLCD/22ZEDhPHBPmtkJQefAFrEB Ku9kQnWi817n2cpgOsKGCvcWbpX9uvQ= X-AuditID: a67dfc5b-d85ff70000001748-30-666bb2431745 From: Honggyu Kim To: SeongJae Park , damon@lists.linux.dev Cc: Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Steven Rostedt , Gregory Price , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, 42.hyeyoo@gmail.com, art.jeongseob@gmail.com, kernel_team@skhynix.com, Honggyu Kim Subject: [PATCH v6 2/7] mm: rename alloc_demote_folio to alloc_migrate_folio Date: Fri, 14 Jun 2024 12:00:04 +0900 Message-ID: <20240614030010.751-3-honggyu.kim@sk.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240614030010.751-1-honggyu.kim@sk.com> References: <20240614030010.751-1-honggyu.kim@sk.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsXC9ZZnka7zpuw0g+mvOCwm9hhYzFm/hs3i /oPX7BZP/v9mtWhoesRicXnXHDaLe2v+s1ocWX+WxWLz2TPMFouXq1ns63jAZHH46xsmBx6P paffsHnsnHWX3aNl3y12j02rOtk8Nn2axO5xYsZvFo8Xm2cyemz8+J/d4/MmuQDOKC6blNSc zLLUIn27BK6Mqc+tCrr4K5p+7mZuYLzM08XIySEhYCLxu3sxG4y9Yt8jRhCbTUBN4srLSUxd jBwcIgJWEtN2xHYxcnEwC2xglph07gUTSI2wgI/Ex2OPwXpZBFQlDrVuYAGp5xUwldi93Q5i pKbE4+0/2UFsTgEzienH7oG1CgGVXLiyFczmFRCUODnzCQuIzSwgL9G8dTYzyC4JgddsEu9+ XYO6TVLi4IobLBMY+Wch6ZmFpGcBI9MqRqHMvLLcxMwcE72MyrzMCr3k/NxNjMAIWFb7J3oH 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VPAjvA2XVc1LvFS0NYmkRosdJZsre7AdnHWptkBDJ/HbdROICvYPXOo9jR3get/ySnsaYKGtfapjPffSm2KAtIzR9ZIUmKTPdtI3Y5s1MAldOpdEj FTFjmKgf 2n4tlnpROozq5jBThnIG7NLwLsBmZcXLK18Gtpaqjo61Ul1hQVEuJ+kLt7VSwJXj83AexSY/VyegDDOx6oiVnLjVYig10xQbRRsKotH8NH1vmCoCgCyrmqhGDA3qC2PJQ3wsV+YaOfZ9jujmE1mHGr3CfNsZ8p7ldmJxq2kmp0v0ftFextCVKfiKSk3MZD6OT+UPcbtcuLRXEHEU= 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: The alloc_demote_folio can also be used for general migration including both demotion and promotion so it'd be better to rename it from alloc_demote_folio to alloc_migrate_folio. Signed-off-by: Honggyu Kim Reviewed-by: SeongJae Park --- mm/internal.h | 2 +- mm/vmscan.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index b3ca996a4efc..9f967842f636 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1052,7 +1052,7 @@ extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long, unsigned long, unsigned long); extern void set_pageblock_order(void); -struct folio *alloc_demote_folio(struct folio *src, unsigned long private); +struct folio *alloc_migrate_folio(struct folio *src, unsigned long private); unsigned long reclaim_pages(struct list_head *folio_list); unsigned int reclaim_clean_pages_from_list(struct zone *zone, struct list_head *folio_list); diff --git a/mm/vmscan.c b/mm/vmscan.c index 2f4406872f43..f5414b101909 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -916,7 +916,7 @@ static void folio_check_dirty_writeback(struct folio *folio, mapping->a_ops->is_dirty_writeback(folio, dirty, writeback); } -struct folio *alloc_demote_folio(struct folio *src, unsigned long private) +struct folio *alloc_migrate_folio(struct folio *src, unsigned long private) { struct folio *dst; nodemask_t *allowed_mask; @@ -979,7 +979,7 @@ static unsigned int demote_folio_list(struct list_head *demote_folios, node_get_allowed_targets(pgdat, &allowed_mask); /* Demotion ignores all cpuset and mempolicy settings */ - migrate_pages(demote_folios, alloc_demote_folio, NULL, + migrate_pages(demote_folios, alloc_migrate_folio, NULL, (unsigned long)&mtc, MIGRATE_ASYNC, MR_DEMOTION, &nr_succeeded); From patchwork Fri Jun 14 03:00:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggyu Kim X-Patchwork-Id: 13697816 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 733ECC27C6E for ; Fri, 14 Jun 2024 03:05:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CAB36B00DE; Thu, 13 Jun 2024 23:00:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77AA36B00E0; Thu, 13 Jun 2024 23:00:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 535716B00E2; Thu, 13 Jun 2024 23:00:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3035D6B00DE for ; Thu, 13 Jun 2024 23:00:26 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E42B1A173A for ; Fri, 14 Jun 2024 03:00:25 +0000 (UTC) X-FDA: 82227990810.19.532A425 Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf11.hostedemail.com (Postfix) with ESMTP id E716C4000B for ; Fri, 14 Jun 2024 03:00:23 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718334022; 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; bh=SN9/9fXVS0VGJMpc94Tf26ovwLc7alHK1OzF0qhMZVE=; b=WcOtMAdXLZWgKP+liZCvxsZLdS4xWu5H0idvjR6v1UkydAf4ArK2NJy6cquItHoBOnfsWL +aeFsI74MsdAdbwsn8KoOK+MOlnUZosKWWyogp0izPuTzloqXwbZfpZfOJmZ800lUubPdy yEZV6Zk2pVy62Iu3kKlQ5b1x9aFyGOM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718334022; a=rsa-sha256; cv=none; b=cZqeqYMuQd4rB3IcTbfco+bBnOWbMvlUAvKGHhIqeOrzxb7GFmMXcaEVNcNwUPIcXw9ZkR Gri7jEK5Pfr4OxAcGK6YNqL1j62WQqLipJgNaLFpDQp79HW11n/2woqIKFZc58jpIEX4EQ MA9Ieb90sg8cSxZEfO4Tun/iuVXj7o4= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com X-AuditID: a67dfc5b-d85ff70000001748-35-666bb2448c76 From: Honggyu Kim To: SeongJae Park , damon@lists.linux.dev Cc: Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Steven Rostedt , Gregory Price , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, 42.hyeyoo@gmail.com, art.jeongseob@gmail.com, kernel_team@skhynix.com, Hyeongtak Ji , Honggyu Kim Subject: [PATCH v6 3/7] mm/damon/sysfs-schemes: add target_nid on sysfs-schemes Date: Fri, 14 Jun 2024 12:00:05 +0900 Message-ID: <20240614030010.751-4-honggyu.kim@sk.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240614030010.751-1-honggyu.kim@sk.com> References: <20240614030010.751-1-honggyu.kim@sk.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFLMWRmVeSWpSXmKPExsXC9ZZnka7Lpuw0g8l/eCwm9hhYzFm/hs3i /oPX7BZP/v9mtWhoesRicXnXHDaLe2v+s1ocWX+WxWLz2TPMFouXq1ns63jAZHH46xsmBx6P paffsHnsnHWX3aNl3y12j02rOtk8Nn2axO5xYsZvFo8Xm2cyemz8+J/d4/MmuQDOKC6blNSc zLLUIn27BK6M4+vbWAouW1U82vGIsYFxo0EXIyeHhICJxPHzneww9qVHJxlBbDYBNYkrLycx dTFycIgIWElM2xHbxcjFwSxwjVlid/dJZpAaYQF/ibOPVoLVsAioSqy65goS5hUwlfh3fQIb xEhNicfbf4KN5xQwk5h+7B4TiC0EVHPhylYmiHpBiZMzn7CA2MwC8hLNW2czg+ySEHjPJvF7 /m8WiEGSEgdX3GCZwMg/C0nPLCQ9CxiZVjEKZeaV5SZm5pjoZVTmZVboJefnbmIExsCy2j/R Oxg/XQg+xCjAwajEw+vxLCtNiDWxrLgy9xCjBAezkgjvrIVAId6UxMqq1KL8+KLSnNTiQ4zS HCxK4rxG38pThATSE0tSs1NTC1KLYLJMHJxSDYxam9TsTtimGdXsfeqbMl24QO/QWclZ5mmJ EnOyTyR37npz9Kj8uzcRrwW3OWx41fP0xiOOqe+lrs2udf+nlPGP9WLsgaRSy49qP4zMG+tc OdL31X2w7LXz2Xz6a/CRmUo2H5OO2N20VI2ek+FcaVKud/3uM5GvTyy0olXKHM7LLmbTsnAo m6LEUpyRaKjFXFScCADJ3Mu7fQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsXCNUNLT9d5U3aawe7p1hYTewws5qxfw2Zx /8Frdosn/3+zWjQ0PWKx+PzsNbNF55PvjBaH555ktbi8aw6bxb01/1ktjqw/y2Kx+ewZZovF y9Us9nU8YLI4/PUNkwO/x9LTb9g8ds66y+7Rsu8Wu8emVZ1sHps+TWL3ODHjN4vHi80zGT02 fvzP7vHttofH4hcfmDw+b5IL4I7isklJzcksSy3St0vgyji+vo2l4LJVxaMdjxgbGDcadDFy ckgImEhcenSSEcRmE1CTuPJyElMXIweHiICVxLQdsV2MXBzMAteYJXZ3n2QGqREW8Jc4+2gl WA2LgKrEqmuuIGFeAVOJf9cnsEGM1JR4vP0nO4jNKWAmMf3YPSYQWwio5sKVrUwQ9YISJ2c+ YQGxmQXkJZq3zmaewMgzC0lqFpLUAkamVYwimXlluYmZOaZ6xdkZlXmZFXrJ+bmbGIHBvqz2 z8QdjF8uux9iFOBgVOLh9XiWlSbEmlhWXJl7iFGCg1lJhHfWQqAQb0piZVVqUX58UWlOavEh RmkOFiVxXq/w1AQhgfTEktTs1NSC1CKYLBMHp1QDo77Msjnbui94CDIE7/oeziMs++led6bc Ro0DIawSF9bPMP7E8srh5Op9PRUWnssv7bJWW/B0ubc7Ewvred6OgAnNu094Ps7ZuDH5xVav b5u37vne+/+z6Uk3J89Nrp/ruFbKPz3EMe1DugKXwuuQW3+KpweYB2vKqj7aXxUuv507qSu8 lJF3vRJLcUaioRZzUXEiAOpKILpyAgAA X-CFilter-Loop: Reflected X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E716C4000B X-Stat-Signature: e9gihqobh3nq53antrwtyhaw8wo673rn X-Rspam-User: X-HE-Tag: 1718334023-799251 X-HE-Meta: U2FsdGVkX1+4aN/YupJ/EXpkLyBJBOLcuguLywXJM6r3KUO8dXA/ccx1e9/K9nHQ9WGmdcx2Y0WQaefgg35lpQgt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bITlGCUXzVAf/FbyiYU3PXNKGblYfrEa5PEg== 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: From: Hyeongtak Ji This patch adds target_nid under /sys/kernel/mm/damon/admin/kdamonds//contexts//schemes// The 'target_nid' can be used as the destination node for DAMOS actions such as DAMOS_MIGRATE_{HOT,COLD} in the follow up patches. Signed-off-by: Hyeongtak Ji Signed-off-by: Honggyu Kim Signed-off-by: SeongJae Park --- include/linux/damon.h | 11 ++++++++++- mm/damon/core.c | 5 ++++- mm/damon/dbgfs.c | 2 +- mm/damon/lru_sort.c | 3 ++- mm/damon/reclaim.c | 3 ++- mm/damon/sysfs-schemes.c | 33 ++++++++++++++++++++++++++++++++- 6 files changed, 51 insertions(+), 6 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index f7da65e1ac04..21d6b69a015c 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -374,6 +374,7 @@ struct damos_access_pattern { * @apply_interval_us: The time between applying the @action. * @quota: Control the aggressiveness of this scheme. * @wmarks: Watermarks for automated (in)activation of this scheme. + * @target_nid: Destination node if @action is "migrate_{hot,cold}". * @filters: Additional set of &struct damos_filter for &action. * @stat: Statistics of this scheme. * @list: List head for siblings. @@ -389,6 +390,10 @@ struct damos_access_pattern { * monitoring context are inactive, DAMON stops monitoring either, and just * repeatedly checks the watermarks. * + * @target_nid is used to set the migration target node for migrate_hot or + * migrate_cold actions, which means it's only meaningful when @action is either + * "migrate_hot" or "migrate_cold". + * * Before applying the &action to a memory region, &struct damon_operations * implementation could check pages of the region and skip &action to respect * &filters @@ -410,6 +415,9 @@ struct damos { /* public: */ struct damos_quota quota; struct damos_watermarks wmarks; + union { + int target_nid; + }; struct list_head filters; struct damos_stat stat; struct list_head list; @@ -726,7 +734,8 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern, enum damos_action action, unsigned long apply_interval_us, struct damos_quota *quota, - struct damos_watermarks *wmarks); + struct damos_watermarks *wmarks, + int target_nid); void damon_add_scheme(struct damon_ctx *ctx, struct damos *s); void damon_destroy_scheme(struct damos *s); diff --git a/mm/damon/core.c b/mm/damon/core.c index 6392f1cc97a3..c0ec5be4f56e 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -354,7 +354,8 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern, enum damos_action action, unsigned long apply_interval_us, struct damos_quota *quota, - struct damos_watermarks *wmarks) + struct damos_watermarks *wmarks, + int target_nid) { struct damos *scheme; @@ -381,6 +382,8 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern, scheme->wmarks = *wmarks; scheme->wmarks.activated = true; + scheme->target_nid = target_nid; + return scheme; } diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index 2461cfe2e968..51a6f1cac385 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -281,7 +281,7 @@ static struct damos **str_to_schemes(const char *str, ssize_t len, pos += parsed; scheme = damon_new_scheme(&pattern, action, 0, "a, - &wmarks); + &wmarks, NUMA_NO_NODE); if (!scheme) goto fail; diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c index 3de2916a65c3..3775f0f2743d 100644 --- a/mm/damon/lru_sort.c +++ b/mm/damon/lru_sort.c @@ -163,7 +163,8 @@ static struct damos *damon_lru_sort_new_scheme( /* under the quota. */ "a, /* (De)activate this according to the watermarks. */ - &damon_lru_sort_wmarks); + &damon_lru_sort_wmarks, + NUMA_NO_NODE); } /* Create a DAMON-based operation scheme for hot memory regions */ diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index 9bd341d62b4c..a05ccb41749b 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -177,7 +177,8 @@ static struct damos *damon_reclaim_new_scheme(void) /* under the quota. */ &damon_reclaim_quota, /* (De)activate this according to the watermarks. */ - &damon_reclaim_wmarks); + &damon_reclaim_wmarks, + NUMA_NO_NODE); } static void damon_reclaim_copy_quota_status(struct damos_quota *dst, diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index bea5bc52846a..0632d28b67f8 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -6,6 +6,7 @@ */ #include +#include #include "sysfs-common.h" @@ -1445,6 +1446,7 @@ struct damon_sysfs_scheme { struct damon_sysfs_scheme_filters *filters; struct damon_sysfs_stats *stats; struct damon_sysfs_scheme_regions *tried_regions; + int target_nid; }; /* This should match with enum damos_action */ @@ -1470,6 +1472,7 @@ static struct damon_sysfs_scheme *damon_sysfs_scheme_alloc( scheme->kobj = (struct kobject){}; scheme->action = action; scheme->apply_interval_us = apply_interval_us; + scheme->target_nid = NUMA_NO_NODE; return scheme; } @@ -1692,6 +1695,28 @@ static ssize_t apply_interval_us_store(struct kobject *kobj, return err ? err : count; } +static ssize_t target_nid_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct damon_sysfs_scheme *scheme = container_of(kobj, + struct damon_sysfs_scheme, kobj); + + return sysfs_emit(buf, "%d\n", scheme->target_nid); +} + +static ssize_t target_nid_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + struct damon_sysfs_scheme *scheme = container_of(kobj, + struct damon_sysfs_scheme, kobj); + int err = 0; + + /* TODO: error handling for target_nid range. */ + err = kstrtoint(buf, 0, &scheme->target_nid); + + return err ? err : count; +} + static void damon_sysfs_scheme_release(struct kobject *kobj) { kfree(container_of(kobj, struct damon_sysfs_scheme, kobj)); @@ -1703,9 +1728,13 @@ static struct kobj_attribute damon_sysfs_scheme_action_attr = static struct kobj_attribute damon_sysfs_scheme_apply_interval_us_attr = __ATTR_RW_MODE(apply_interval_us, 0600); +static struct kobj_attribute damon_sysfs_scheme_target_nid_attr = + __ATTR_RW_MODE(target_nid, 0600); + static struct attribute *damon_sysfs_scheme_attrs[] = { &damon_sysfs_scheme_action_attr.attr, &damon_sysfs_scheme_apply_interval_us_attr.attr, + &damon_sysfs_scheme_target_nid_attr.attr, NULL, }; ATTRIBUTE_GROUPS(damon_sysfs_scheme); @@ -2031,7 +2060,8 @@ static struct damos *damon_sysfs_mk_scheme( }; scheme = damon_new_scheme(&pattern, sysfs_scheme->action, - sysfs_scheme->apply_interval_us, "a, &wmarks); + sysfs_scheme->apply_interval_us, "a, &wmarks, + sysfs_scheme->target_nid); if (!scheme) return NULL; @@ -2068,6 +2098,7 @@ static void damon_sysfs_update_scheme(struct damos *scheme, scheme->action = sysfs_scheme->action; scheme->apply_interval_us = sysfs_scheme->apply_interval_us; + scheme->target_nid = sysfs_scheme->target_nid; scheme->quota.ms = sysfs_quotas->ms; scheme->quota.sz = sysfs_quotas->sz; From patchwork Fri Jun 14 03:00:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggyu Kim X-Patchwork-Id: 13697817 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 5A055C27C6E for ; Fri, 14 Jun 2024 03:05:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 497806B00E0; Thu, 13 Jun 2024 23:00:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 447036B00E2; Thu, 13 Jun 2024 23:00:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30EB26B00E5; Thu, 13 Jun 2024 23:00:28 -0400 (EDT) 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 128C56B00E0 for ; Thu, 13 Jun 2024 23:00:28 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B3C8C1C09D0 for ; Fri, 14 Jun 2024 03:00:27 +0000 (UTC) X-FDA: 82227990894.12.D4287AD Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf04.hostedemail.com (Postfix) with ESMTP id CA23240009 for ; Fri, 14 Jun 2024 03:00:25 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718334024; a=rsa-sha256; cv=none; b=uh2PLCOJh9MpxulAQcWNQhbW1jxY15DiuWJ+QZE4DIY7P8FX8V5oEld9+jxZ0JEfCeFMoC SMEz9MdpGVWfQgYUmEa/e6CwtdbJElGpX2QVv/5iceJLrOcmBueeEbPpI/mdGjlRt/JW6x mwl3T9aK7PE4hUYUetF+BV/pipngaRE= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718334024; 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; bh=Twkyo3ljIBjbS2/4ZLgfrWPOETcL3lQW8GhcvAO3s1o=; b=mIL+US/fx1RFKDpdjLO9+8pegAEyS8huczl2igRxW6Z2pzvnfQCh0MHM3MR0CdVojAAGoc CN0hKC3VX0igqfPNTw1zftFHSsw0Gbam3UUE+7eDKtVu08crAPP+Wmy9kcbtG/nysZXuqE LK4t05cQGV4CqGzEz1WbrNz7V/+qYMI= X-AuditID: a67dfc5b-d85ff70000001748-39-666bb2453c5c From: Honggyu Kim To: SeongJae Park , damon@lists.linux.dev Cc: Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Steven Rostedt , Gregory Price , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, 42.hyeyoo@gmail.com, art.jeongseob@gmail.com, kernel_team@skhynix.com, Honggyu Kim Subject: [PATCH v6 4/7] mm/migrate: add MR_DAMON to migrate_reason Date: Fri, 14 Jun 2024 12:00:06 +0900 Message-ID: <20240614030010.751-5-honggyu.kim@sk.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240614030010.751-1-honggyu.kim@sk.com> References: <20240614030010.751-1-honggyu.kim@sk.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFLMWRmVeSWpSXmKPExsXC9ZZnka7rpuw0g78veS0m9hhYzFm/hs3i /oPX7BZP/v9mtWhoesRicXnXHDaLe2v+s1ocWX+WxWLz2TPMFouXq1ns63jAZHH46xsmBx6P paffsHnsnHWX3aNl3y12j02rOtk8Nn2axO5xYsZvFo8Xm2cyemz8+J/d4/MmuQDOKC6blNSc zLLUIn27BK6M6U07mAsauCoaZixkbmBcx9HFyMkhIWAi8eXmJ1YYe8WK+UwgNpuAmsSVl5OA bA4OEQEriWk7YrsYuTiYBTYwS0w69wKsRljASeLTqynsIDUsAqoS/95IgIR5BUwlGr9NZYcY qSnxePtPMJtTwExi+rF7YK1CQDUXrmxlgqgXlDg58wkLiM0sIC/RvHU2M8guCYHHbBLflz5h hhgkKXFwxQ2WCYz8s5D0zELSs4CRaRWjUGZeWW5iZo6JXkZlXmaFXnJ+7iZGYAwsq/0TvYPx 04XgQ4wCHIxKPLwez7LShFgTy4orcw8xSnAwK4nwzloIFOJNSaysSi3Kjy8qzUktPsQozcGi JM5r9K08RUggPbEkNTs1tSC1CCbLxMEp1cDY9PFilmcz1xyN2+uvTj/t9kbMfVszi8yxyX+5 G5RmvK/5n71x03Gbaw9PzEg3f6cnYv7K23bF0b4t6QtcfevPfPFarbpLcWHtiV+6xVfDH3tO yusNOr5UQFjY//DvupvL76jFv/S2in6578LtH7qlqdtmO/L5JpntLSo0vZFbluLRfeRFPNs3 JZbijERDLeai4kQATVedRH0CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsXCNUNLT9d1U3aawbatjBYTewws5qxfw2Zx /8Frdosn/3+zWjQ0PWKx+PzsNbPF4bknWS0u75rDZnFvzX9WiyPrz7JYbD57htli8XI1i30d D5gsDn99w+TA57H09Bs2j52z7rJ7tOy7xe6xaVUnm8emT5PYPU7M+M3i8WLzTEaPjR//s3t8 u+3hsfjFByaPz5vkArijuGxSUnMyy1KL9O0SuDKmN+1gLmjgqmiYsZC5gXEdRxcjJ4eEgInE ihXzmUBsNgE1iSsvJwHZHBwiAlYS03bEdjFycTALbGCWmHTuBViNsICTxKdXU9hBalgEVCX+ vZEACfMKmEo0fpvKDjFSU+Lx9p9gNqeAmcT0Y/fAWoWAai5c2coEUS8ocXLmExYQm1lAXqJ5 62zmCYw8s5CkZiFJLWBkWsUokplXlpuYmWOqV5ydUZmXWaGXnJ+7iREY4stq/0zcwfjlsvsh RgEORiUeXo9nWWlCrIllxZW5hxglOJiVRHhnLQQK8aYkVlalFuXHF5XmpBYfYpTmYFES5/UK T00QEkhPLEnNTk0tSC2CyTJxcEo1MPrUNa+7oH7k9/8HOuKSx2ZXixj/OxBddF9Kwnnj9kM8 urVLV0mqV5sFWv9mebp94xH7mifK91eIMLTX15rF+K3ZHbEmpETj68qlNqnNfjsLPuxftU/l C+dcbQX+TWYawXvWJLpVnr3ZzKUe9aeGJ3O+TgBryeL/Z/Rz/vR+TJswY63avta52UosxRmJ hlrMRcWJAMj5IFltAgAA X-CFilter-Loop: Reflected X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: CA23240009 X-Stat-Signature: 5ake1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ML4m2G6gY9OanvBuDesgLIyheQUX9FfS+0Dzzx9dp/qiFYjzP3u4/O3fRtr+71vRVJMZWs5MMsbS//TP/idSEl9f5+eJbXh1+k7i0WLzVzGgFkBpsko23iwvNuMy+18oBiJrlQja7Y5PTiRtM0LKiKFHauVw91KfszGaLcYHJ+eNKv8Tp0y3Ioylsiu9gk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The current patch series introduces DAMON based migration across NUMA nodes so it'd be better to have a new migrate_reason in trace events. Signed-off-by: Honggyu Kim Reviewed-by: SeongJae Park Signed-off-by: SeongJae Park --- include/linux/migrate_mode.h | 1 + include/trace/events/migrate.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/migrate_mode.h b/include/linux/migrate_mode.h index f37cc03f9369..cec36b7e7ced 100644 --- a/include/linux/migrate_mode.h +++ b/include/linux/migrate_mode.h @@ -29,6 +29,7 @@ enum migrate_reason { MR_CONTIG_RANGE, MR_LONGTERM_PIN, MR_DEMOTION, + MR_DAMON, MR_TYPES }; diff --git a/include/trace/events/migrate.h b/include/trace/events/migrate.h index 0190ef725b43..cd01dd7b3640 100644 --- a/include/trace/events/migrate.h +++ b/include/trace/events/migrate.h @@ -22,7 +22,8 @@ EM( MR_NUMA_MISPLACED, "numa_misplaced") \ EM( MR_CONTIG_RANGE, "contig_range") \ EM( MR_LONGTERM_PIN, "longterm_pin") \ - EMe(MR_DEMOTION, "demotion") + EM( MR_DEMOTION, "demotion") \ + EMe(MR_DAMON, "damon") /* * First define the enums in the above macros to be exported to userspace From patchwork Fri Jun 14 03:00:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggyu Kim X-Patchwork-Id: 13697818 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 DF4ECC27C4F for ; Fri, 14 Jun 2024 03:05:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C85C16B00E2; Thu, 13 Jun 2024 23:00:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C35C36B00E6; Thu, 13 Jun 2024 23:00:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD5C06B00E7; Thu, 13 Jun 2024 23:00:28 -0400 (EDT) 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 8FB136B00E2 for ; Thu, 13 Jun 2024 23:00:28 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3FB6380417 for ; Fri, 14 Jun 2024 03:00:28 +0000 (UTC) X-FDA: 82227990936.30.C7E668E Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf11.hostedemail.com (Postfix) with ESMTP id 3E56E4000D for ; Fri, 14 Jun 2024 03:00:25 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718334024; 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; bh=nv1oWni34khPhdRw64DblZPBH5T/Fb3rcF3xoWmpT6k=; b=REI5sLycoYKShtxfJdmXosAOX8knoROFHNYV8u1R5mQ32lOjf7x4sAz1BunBGw1C0ZddJX KvqRVQswhyrF9wka/qAOAT+JOxkKUvzQdhixnm1hpjoL8qyNa4I0mHu24pBlSWwzhSU3Cq gD+H04BWE8PMqic9UeRPHqL3gQUyS5s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718334024; a=rsa-sha256; cv=none; b=VfxI9zxEgxnjmiQUvhhmRLc0Af81Hfyzy+EyHHcKZdySGe69J5oq6HEvnQX4os0Rzgtsqx swGiNQks19NyIDrepVn8Kujm0tB3MBZ/P7vhHajMm1jLSfF3LP/65f7o+cgNMdYvlksnfs RP371MzKpwF2T25ReXT4L1vz8mBRjPo= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com X-AuditID: a67dfc5b-d85ff70000001748-3e-666bb24685fe From: Honggyu Kim To: SeongJae Park , damon@lists.linux.dev Cc: Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Steven Rostedt , Gregory Price , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, 42.hyeyoo@gmail.com, art.jeongseob@gmail.com, kernel_team@skhynix.com, Honggyu Kim , Hyeongtak Ji Subject: [PATCH v6 5/7] mm/damon/paddr: introduce DAMOS_MIGRATE_COLD action for demotion Date: Fri, 14 Jun 2024 12:00:07 +0900 Message-ID: <20240614030010.751-6-honggyu.kim@sk.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240614030010.751-1-honggyu.kim@sk.com> References: <20240614030010.751-1-honggyu.kim@sk.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNLMWRmVeSWpSXmKPExsXC9ZZnka7bpuw0gyubhC0m9hhYzFm/hs3i /oPX7BZP/v9mtWhoesRicXnXHDaLe2v+s1ocWX+WxWLz2TPM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hCbV8BUYlXzdiaImZoSj7f/BItzCphJTD92DywuBFRz4cpWJoh6QYmTM5+A 7WUWkJdo3jqbeQIjzywkqVlIUgsYmVYximTmleUmZuaY6hVnZ1TmZVboJefnbmIEhvuy2j8T dzB+uex+iFGAg1GJh9fjWVaaEGtiWXFl7iFGCQ5mJRHeWQuBQrwpiZVVqUX58UWlOanFhxil OViUxHm9wlMThATSE0tSs1NTC1KLYLJMHJxSDYx7Nbt/yU587PvdWq1HQXnGepebH98t/za/ w+TzS8lfYdYuOp+Wim/9fP0rg4JYw/OYY93qfu0PFysLqDmX6ZtlnrVks9+vc+V3dY1O0+td N+4Lu29rex8lcXzOjbNz0xd84nVI+qByvnH67qu+r4/skzppPq0pt3nDi/Uz/SfprJjAbmew 9KKwEktxRqKhFnNRcSIAHi2Lb3MCAAA= X-CFilter-Loop: Reflected X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3E56E4000D X-Stat-Signature: sxc3wcrred771ncuqs8ipppwjmw4n7wo X-Rspam-User: X-HE-Tag: 1718334025-89969 X-HE-Meta: U2FsdGVkX1/URARTSBq6wFQ2KDQiX21/731pO1ha4671a+XYecKigm5C6TVLyXpIICp6T55jUDcSJ9lvjdhisF+s+mrTbB71ed6iHcmR9RdaEjYSqlO/4jSKTGTaqC/1S1hmya7IXUqQOrNRC55YCcGNFX41B1qDYh+vOTrN4Y5jiVYFTER4BNRfRnUIQY+FcvupOFiOSSNVrDhwWKVAkkI/1EUfgksxJHIdcrsA3H943kv8c+Pelj7/20Ku1hFB9xVTvmy6a+UUFnYdm3unSKhmzZVr/YZN9ovFAMb1IzveHvJrjcAxxn+ghLssVE4vQ4/Q79wZnT738qs4Esh4uRMLtSIIkfWCUNHfSpp2Swd8cXu9b71xHLO+ecORwdOpE6cwPEjkFLZD5JJ4Zi5daqezuEgmSY7zBmikwXgPGVa9rpv82A8R7XTlHVgXW/51aZef8yPrEJ7mvobmhtoJZPJqVLiizY0EvGdY810t+g40UNyhBPUqCLRn1tw0hDcDs9Wy/wCdh8W5MVEmxKrxBC0RJKr+OW56j0yBqA//42/iknENvV5eRgE9Mjop0ERy7f9/5N/rtNbUH4BRNxs82LDHpyHV95c3QesXNoSq4rjliX/0P3hp87GejSnnO4wDjR50vbtgniGp0i453/jzEOj/2ERN6Yas/f/fMuIQ8iAWrrQrla4tscE5irLN9HuiiHGOZg5EGpPGC6oWLj7r+lbnjEYrjJzsKPHCHQ4xZE0v5UtthG6PtbbEnUfRNo2tFn+sG0P6tpaI48saCKU1oXfXYMBhFsEiZOH7xWwNDR/XANxnpMbjboDvHF27TPTjvtyQK8E6uNJ9LVfqSahdpnk8XQ3+kV/KUcsk4ZP4vtbZjbRHDJWJ8mdjcUce/JgXPQbY+c6AkJDjBLs5XS1N8tPfk/J2GgZUa3giYzum4MwXJLDvC2+qJw+dR2J01MxOdBL/XLoDkrZ3EH967N5 ENxGKOHf PSXXfwaqpzxchiaIYFo7mHTfzZsTGIcKqCWWZ9IJL76PUNBZTHboBBsOfPi9cr+v2EyLKKEFWEZ6lsac+nnAO9nmgFRXpjzNWlt3Q8mkJ8GMJDCOA9+uKD7CqGcpXr5xQRlJlnLFFxz+CQQU+lbJLJGbxM81S6l8YtF0+SQkoTrsO09UUX/7hmYg5Z1FFBhJcGOAcMxERQtgTtWLqPdBLHT6UeA== 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: This patch introduces DAMOS_MIGRATE_COLD action, which is similar to DAMOS_PAGEOUT, but migrate folios to the given 'target_nid' in the sysfs instead of swapping them out. The 'target_nid' sysfs knob informs the migration target node ID. Here is one of the example usage of this 'migrate_cold' action. $ cd /sys/kernel/mm/damon/admin/kdamonds/ $ cat contexts//schemes//action migrate_cold $ echo 2 > contexts//schemes//target_nid $ echo commit > state $ numactl -p 0 ./hot_cold 500M 600M & $ numastat -c -p hot_cold Per-node process memory usage (in MBs) PID Node 0 Node 1 Node 2 Total -------------- ------ ------ ------ ----- 701 (hot_cold) 501 0 601 1101 Since there are some common routines with pageout, many functions have similar logics between pageout and migrate cold. damon_pa_migrate_folio_list() is a minimized version of shrink_folio_list(). Signed-off-by: Honggyu Kim Signed-off-by: Hyeongtak Ji Signed-off-by: SeongJae Park --- include/linux/damon.h | 2 + mm/damon/paddr.c | 154 +++++++++++++++++++++++++++++++++++++++ mm/damon/sysfs-schemes.c | 1 + 3 files changed, 157 insertions(+) diff --git a/include/linux/damon.h b/include/linux/damon.h index 21d6b69a015c..56714b6eb0d7 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -105,6 +105,7 @@ struct damon_target { * @DAMOS_NOHUGEPAGE: Call ``madvise()`` for the region with MADV_NOHUGEPAGE. * @DAMOS_LRU_PRIO: Prioritize the region on its LRU lists. * @DAMOS_LRU_DEPRIO: Deprioritize the region on its LRU lists. + * @DAMOS_MIGRATE_COLD: Migrate the regions prioritizing colder regions. * @DAMOS_STAT: Do nothing but count the stat. * @NR_DAMOS_ACTIONS: Total number of DAMOS actions * @@ -122,6 +123,7 @@ enum damos_action { DAMOS_NOHUGEPAGE, DAMOS_LRU_PRIO, DAMOS_LRU_DEPRIO, + DAMOS_MIGRATE_COLD, DAMOS_STAT, /* Do nothing but only record the stat */ NR_DAMOS_ACTIONS, }; diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 18797c1b419b..882ae54af829 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -12,6 +12,9 @@ #include #include #include +#include +#include +#include #include "../internal.h" #include "ops-common.h" @@ -325,6 +328,153 @@ static unsigned long damon_pa_deactivate_pages(struct damon_region *r, return damon_pa_mark_accessed_or_deactivate(r, s, false); } +static unsigned int __damon_pa_migrate_folio_list( + struct list_head *migrate_folios, struct pglist_data *pgdat, + int target_nid) +{ + unsigned int nr_succeeded; + nodemask_t allowed_mask = NODE_MASK_NONE; + struct migration_target_control mtc = { + /* + * Allocate from 'node', or fail quickly and quietly. + * When this happens, 'page' will likely just be discarded + * instead of migrated. + */ + .gfp_mask = (GFP_HIGHUSER_MOVABLE & ~__GFP_RECLAIM) | + __GFP_NOWARN | __GFP_NOMEMALLOC | GFP_NOWAIT, + .nid = target_nid, + .nmask = &allowed_mask + }; + + if (pgdat->node_id == target_nid || target_nid == NUMA_NO_NODE) + return 0; + + if (list_empty(migrate_folios)) + return 0; + + /* Migration ignores all cpuset and mempolicy settings */ + migrate_pages(migrate_folios, alloc_migrate_folio, NULL, + (unsigned long)&mtc, MIGRATE_ASYNC, MR_DAMON, + &nr_succeeded); + + return nr_succeeded; +} + +static unsigned int damon_pa_migrate_folio_list(struct list_head *folio_list, + struct pglist_data *pgdat, + int target_nid) +{ + unsigned int nr_migrated = 0; + struct folio *folio; + LIST_HEAD(ret_folios); + LIST_HEAD(migrate_folios); + + while (!list_empty(folio_list)) { + struct folio *folio; + + cond_resched(); + + folio = lru_to_folio(folio_list); + list_del(&folio->lru); + + if (!folio_trylock(folio)) + goto keep; + + /* Relocate its contents to another node. */ + list_add(&folio->lru, &migrate_folios); + folio_unlock(folio); + continue; +keep: + list_add(&folio->lru, &ret_folios); + } + /* 'folio_list' is always empty here */ + + /* Migrate folios selected for migration */ + nr_migrated += __damon_pa_migrate_folio_list( + &migrate_folios, pgdat, target_nid); + /* + * Folios that could not be migrated are still in @migrate_folios. Add + * those back on @folio_list + */ + if (!list_empty(&migrate_folios)) + list_splice_init(&migrate_folios, folio_list); + + try_to_unmap_flush(); + + list_splice(&ret_folios, folio_list); + + while (!list_empty(folio_list)) { + folio = lru_to_folio(folio_list); + list_del(&folio->lru); + folio_putback_lru(folio); + } + + return nr_migrated; +} + +static unsigned long damon_pa_migrate_pages(struct list_head *folio_list, + int target_nid) +{ + int nid; + unsigned long nr_migrated = 0; + LIST_HEAD(node_folio_list); + unsigned int noreclaim_flag; + + if (list_empty(folio_list)) + return nr_migrated; + + noreclaim_flag = memalloc_noreclaim_save(); + + nid = folio_nid(lru_to_folio(folio_list)); + do { + struct folio *folio = lru_to_folio(folio_list); + + if (nid == folio_nid(folio)) { + list_move(&folio->lru, &node_folio_list); + continue; + } + + nr_migrated += damon_pa_migrate_folio_list(&node_folio_list, + NODE_DATA(nid), + target_nid); + nid = folio_nid(lru_to_folio(folio_list)); + } while (!list_empty(folio_list)); + + nr_migrated += damon_pa_migrate_folio_list(&node_folio_list, + NODE_DATA(nid), + target_nid); + + memalloc_noreclaim_restore(noreclaim_flag); + + return nr_migrated; +} + +static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s) +{ + unsigned long addr, applied; + LIST_HEAD(folio_list); + + for (addr = r->ar.start; addr < r->ar.end; addr += PAGE_SIZE) { + struct folio *folio = damon_get_folio(PHYS_PFN(addr)); + + if (!folio) + continue; + + if (damos_pa_filter_out(s, folio)) + goto put_folio; + + if (!folio_isolate_lru(folio)) + goto put_folio; + list_add(&folio->lru, &folio_list); +put_folio: + folio_put(folio); + } + applied = damon_pa_migrate_pages(&folio_list, s->target_nid); + cond_resched(); + return applied * PAGE_SIZE; +} + + static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx, struct damon_target *t, struct damon_region *r, struct damos *scheme) @@ -336,6 +486,8 @@ static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx, return damon_pa_mark_accessed(r, scheme); case DAMOS_LRU_DEPRIO: return damon_pa_deactivate_pages(r, scheme); + case DAMOS_MIGRATE_COLD: + return damon_pa_migrate(r, scheme); case DAMOS_STAT: break; default: @@ -356,6 +508,8 @@ static int damon_pa_scheme_score(struct damon_ctx *context, return damon_hot_score(context, r, scheme); case DAMOS_LRU_DEPRIO: return damon_cold_score(context, r, scheme); + case DAMOS_MIGRATE_COLD: + return damon_cold_score(context, r, scheme); default: break; } diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 0632d28b67f8..880015d5b5ea 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -1458,6 +1458,7 @@ static const char * const damon_sysfs_damos_action_strs[] = { "nohugepage", "lru_prio", "lru_deprio", + "migrate_cold", "stat", }; From patchwork Fri Jun 14 03:00:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggyu Kim X-Patchwork-Id: 13697819 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 15312C27C4F for ; Fri, 14 Jun 2024 03:05:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 99F8D6B00E6; Thu, 13 Jun 2024 23:00:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94FAB6B00E8; Thu, 13 Jun 2024 23:00:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F06B6B00E9; Thu, 13 Jun 2024 23:00:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 5C3C96B00E6 for ; Thu, 13 Jun 2024 23:00:30 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 091ADA043E for ; Fri, 14 Jun 2024 03:00:30 +0000 (UTC) X-FDA: 82227991020.09.FCA0C11 Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf04.hostedemail.com (Postfix) with ESMTP id 1C3B84000A for ; Fri, 14 Jun 2024 03:00:27 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718334026; a=rsa-sha256; cv=none; b=d1Jb6noLEwTm3/BHr+XkMGRTM8Yyb9qZ4Pj1mROSIn1xX/DWWG92wGrqpNlEH1jcH1yhTX DxPFeMkCgXzvLtz/4Qcy4n0V+BeuZtLbCqsoYHe/mwNnv4GlvHHFp+c4cJKh8bt4hvNI9r TrD7B+dbJUtQTwjm8K+TTJHe5j+X6JA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf04.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718334026; 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; bh=W+wH/UsDXMYVoEv5VVlhskRzuD9gwWhPNWSfnhG7wLQ=; b=x7Jo8vrrP4+MXgCN4NZybrGtZc7fAU4BQArRVepOnm9tV6cTovCKUD9EsBEJqu9dCdx9rd tn5RhYd2yhPd5lUdmUVKLEOW9xTaPZKK5/re6ZheE9FMgTDX1G2Me3zn4XrXYmHRa8Mh2s Bt54CWGiX4TaSdsl0uydlFxvHEI3Mzc= X-AuditID: a67dfc5b-d85ff70000001748-4b-666bb2473bfa From: Honggyu Kim To: SeongJae Park , damon@lists.linux.dev Cc: Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Steven Rostedt , Gregory Price , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, 42.hyeyoo@gmail.com, art.jeongseob@gmail.com, kernel_team@skhynix.com, Hyeongtak Ji , Honggyu Kim Subject: [PATCH v6 6/7] mm/damon/paddr: introduce DAMOS_MIGRATE_HOT action for promotion Date: Fri, 14 Jun 2024 12:00:08 +0900 Message-ID: <20240614030010.751-7-honggyu.kim@sk.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240614030010.751-1-honggyu.kim@sk.com> References: <20240614030010.751-1-honggyu.kim@sk.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNLMWRmVeSWpSXmKPExsXC9ZZnka77puw0g6Y9IhYTewws5qxfw2Zx /8Frdosn/3+zWjQ0PWKxuLxrDpvFvTX/WS2OrD/LYrH57Blmi8XL1Sz2dTxgsjj89Q2TA4/H 0tNv2Dx2zrrL7tGy7xa7x6ZVnWwemz5NYvc4MeM3i8eLzTMZPTZ+/M/u8XmTXABnFJdNSmpO Zllqkb5dAlfGzqNPWQv2SVRcWHyWtYGxU6SLkZNDQsBE4tacfSww9u5ry9hBbDYBNYkrLycx dTFycIgIWElM2xHbxcjFwSxwjVlid/dJZpAaYYEIifkr+8F6WQRUJQ5fawPr5RUwlTj+fjET xExNicfbf4LFOQXMJKYfuwcWFwKquXBlKxNEvaDEyZlPwOYwC8hLNG+dzQyyTELgPZtEd9M3 RohBkhIHV9xgmcDIPwtJzywkPQsYmVYxCmXmleUmZuaY6GVU5mVW6CXn525iBEbBsto/0TsY P10IPsQowMGoxMPr8SwrTYg1say4MvcQowQHs5II76yFQCHelMTKqtSi/Pii0pzU4kOM0hws SuK8Rt/KU4QE0hNLUrNTUwtSi2CyTBycUg2MvWemTDFameYcdPxMOsfvclG7zvn7S/rULGvX nF6yWn9uEtP2WeaK/7xFuOV3z7DWP/Q6/Jqi0vUZwseZf5x8biJp83L6tLvBrg7aprMS4hjn iyoIiiyZui46pUZha8vVlEWX5L99+2GQ9JBjUsR36eu7LPpOrmSZ97xsg2tdzIfFCU2Ppk9X VmIpzkg01GIuKk4EAC1V+Nd+AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsXCNUNLT9d9U3aaQeM7TouJPQYWc9avYbO4 /+A1u8WT/79ZLRqaHrFYfH72mtmi88l3RovDc0+yWlzeNYfN4t6a/6wWR9afZbHYfPYMs8Xi 5WoW+zoeMFkc/vqGyYHfY+npN2weO2fdZfdo2XeL3WPTqk42j02fJrF7nJjxm8XjxeaZjB4b P/5n9/h228Nj8YsPTB6fN8kFcEdx2aSk5mSWpRbp2yVwZew8+pS1YJ9ExYXFZ1kbGDtFuhg5 OSQETCR2X1vGDmKzCahJXHk5iamLkYNDRMBKYtqO2C5GLg5mgWvMEru7TzKD1AgLREjMX9nP AmKzCKhKHL7WBtbLK2Aqcfz9YiaImZoSj7f/BItzCphJTD92DywuBFRz4cpWJoh6QYmTM5+A zWEWkJdo3jqbeQIjzywkqVlIUgsYmVYximTmleUmZuaY6hVnZ1TmZVboJefnbmIEhvuy2j8T dzB+uex+iFGAg1GJh9fjWVaaEGtiWXFl7iFGCQ5mJRHeWQuBQrwpiZVVqUX58UWlOanFhxil OViUxHm9wlMThATSE0tSs1NTC1KLYLJMHJxSDYyqDI+8Tt/P3Lv7nzRvW4dE2LW3iz4fLuG+ rrJQsz8my+Rd9+sW3ach1rt1wqQsO9tur9zJv2vmbrkvDu/WPDus91bzXuWUQzpR0s925X/g dzc7qHQwLUs1c+deNpnNT1LfzY7wKXm9szDKu9LvQgV/5Y3Sq3/TBYxdX80KV0g6ufuTt2y2 TJoSS3FGoqEWc1FxIgC08WiccwIAAA== X-CFilter-Loop: Reflected X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 1C3B84000A X-Stat-Signature: r9ndcfngpkfqpiy5cr5nxd7c8ez4178y X-Rspam-User: X-HE-Tag: 1718334027-124604 X-HE-Meta: U2FsdGVkX18KNKookiV1xagSWU54S9ni6S5yoZF1RAdy3Ev/1xVnSFCoVGN/7E5in05y0eVzEVYvVodk05LZUCg/phiGwjh4MBvdp1gS42R1BaH99Eb9e6HjkeiGUh1CseLea0OVC7aWn5fdXXoa5yAIwlmpZupoYtSiwuKk0MaMQlT6rZ1JnK+qs4F0vYA9EDSNS2zVohjZZb6YbpzTOSqljtUrtv6zCU4/oMxi9D9r/mrDOEB81oYlUe8n6HFgNZb5EwDyk2DAAygoNheseiJMPBEsKR2XtTKXGXEwpj5/tkETqex8eYHH5klQOhX4soYvssfHOQvS9tDqrtEEuhN9nqzgbSsuQITILWduGOHjxWrImY1YnhZx3qXwg5a9894D4nRwFkLyJKNEnqS+m3AWd6G0JeFg5esKDthGe9Q1sPvSPJSvoLjXmJag+bGoAYDv/srd2Wyo74hfzJGX6bqY+4xeg0JlB2CXsl6NgaxU0YAilPOM3lD0JzXVQfS+Q94yBrbi5JC49Gf8ljhC6mhUc/VUTyaLQn0YspH4rMTSxljpBxPsr2C0eHrGEOhP6tCEqCMcooLvUV9zZO5ktNimYB9PpNWcGNiDnaC/2HoPFaE66++0pEqdtL/HCkQJRY/UdZzCrOmf4PPAIiYG2KP2y39Ujq1anzL5R4F67XzMnun1miaqhO1f99wLoQxVQTmJ4Vbv33I5oavt1Ac/9Y7KImJzbpQcBsmK6ftISIkyfqZ1cxoJHdLZTJ6eCRIGmiufeZAr3tq2w4vfiew1ze3+XM9ieXnnT1VvNPfrqxdeiCDZXtz/fF541P2Axz5xZ1LoyGOoaABufidgAe3EmQRY1NBETKgGcWcqz+uPXXfoFlLMzHDvv1Bdwy9cQTsCX2Tfu4GI1I9y+wetggb4+jKUX8usiFvKARrXdxrqtf7lA5eLnvSdLfD1tuhle9gHVHyeeFzlovZ77aqKUTd eWTGPz/2 Sd9B7apcAJqgUm3iNtH7aARj3pkAVFGxcv0NMqEBBfjsHU57YmsrjFYnVR+4nQ0KuBf+wbmVYuEwT16M65BZYabOsbIO+lWIOMX8KHIlB2vttDe9NquD7JdCAMns/IH1HQFiitHjqeCsEZCrUTQJXPa01vPyQi0KbOzM/Oun4cqC85Sfnhj8ukkMqJ53KCfnhOJHWSUY28a9GvQc= 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: From: Hyeongtak Ji This patch introduces DAMOS_MIGRATE_HOT action, which is similar to DAMOS_MIGRATE_COLD, but proritizes hot pages. It migrates pages inside the given region to the 'target_nid' NUMA node in the sysfs. Here is one of the example usage of this 'migrate_hot' action. $ cd /sys/kernel/mm/damon/admin/kdamonds/ $ cat contexts//schemes//action migrate_hot $ echo 0 > contexts//schemes//target_nid $ echo commit > state $ numactl -p 2 ./hot_cold 500M 600M & $ numastat -c -p hot_cold Per-node process memory usage (in MBs) PID Node 0 Node 1 Node 2 Total -------------- ------ ------ ------ ----- 701 (hot_cold) 501 0 601 1101 Signed-off-by: Hyeongtak Ji Signed-off-by: Honggyu Kim Signed-off-by: SeongJae Park --- include/linux/damon.h | 2 ++ mm/damon/paddr.c | 3 +++ mm/damon/sysfs-schemes.c | 1 + 3 files changed, 6 insertions(+) diff --git a/include/linux/damon.h b/include/linux/damon.h index 56714b6eb0d7..3d62d98d6359 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -105,6 +105,7 @@ struct damon_target { * @DAMOS_NOHUGEPAGE: Call ``madvise()`` for the region with MADV_NOHUGEPAGE. * @DAMOS_LRU_PRIO: Prioritize the region on its LRU lists. * @DAMOS_LRU_DEPRIO: Deprioritize the region on its LRU lists. + * @DAMOS_MIGRATE_HOT: Migrate the regions prioritizing warmer regions. * @DAMOS_MIGRATE_COLD: Migrate the regions prioritizing colder regions. * @DAMOS_STAT: Do nothing but count the stat. * @NR_DAMOS_ACTIONS: Total number of DAMOS actions @@ -123,6 +124,7 @@ enum damos_action { DAMOS_NOHUGEPAGE, DAMOS_LRU_PRIO, DAMOS_LRU_DEPRIO, + DAMOS_MIGRATE_HOT, DAMOS_MIGRATE_COLD, DAMOS_STAT, /* Do nothing but only record the stat */ NR_DAMOS_ACTIONS, diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 882ae54af829..af6aac388a43 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -486,6 +486,7 @@ static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx, return damon_pa_mark_accessed(r, scheme); case DAMOS_LRU_DEPRIO: return damon_pa_deactivate_pages(r, scheme); + case DAMOS_MIGRATE_HOT: case DAMOS_MIGRATE_COLD: return damon_pa_migrate(r, scheme); case DAMOS_STAT: @@ -508,6 +509,8 @@ static int damon_pa_scheme_score(struct damon_ctx *context, return damon_hot_score(context, r, scheme); case DAMOS_LRU_DEPRIO: return damon_cold_score(context, r, scheme); + case DAMOS_MIGRATE_HOT: + return damon_hot_score(context, r, scheme); case DAMOS_MIGRATE_COLD: return damon_cold_score(context, r, scheme); default: diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 880015d5b5ea..66fccfa776d7 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -1458,6 +1458,7 @@ static const char * const damon_sysfs_damos_action_strs[] = { "nohugepage", "lru_prio", "lru_deprio", + "migrate_hot", "migrate_cold", "stat", }; From patchwork Fri Jun 14 03:00:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggyu Kim X-Patchwork-Id: 13697822 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 23A36C27C6E for ; Fri, 14 Jun 2024 03:06:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0063A6B00E8; Thu, 13 Jun 2024 23:00:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF4CB6B00EA; Thu, 13 Jun 2024 23:00:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D951A6B00EB; Thu, 13 Jun 2024 23:00:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BAA1F6B00EA for ; Thu, 13 Jun 2024 23:00:30 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 72DFC160438 for ; Fri, 14 Jun 2024 03:00:30 +0000 (UTC) X-FDA: 82227991020.08.FCCEA8B Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf11.hostedemail.com (Postfix) with ESMTP id 83A584000A for ; Fri, 14 Jun 2024 03:00:28 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718334026; 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; bh=oks2ZaI2HAdlkXBwcNAj0dQhPJ+De+AeV3rwlqM4rJA=; b=bOarSxEZZrIe1CTc0Dri/Vip/V0K+h1De2JGhmBgeyEJAdILapK1kKEarwwd+OAVJFcvKK VSXVkJ3R554rJSLt4s5ER2Aq7PXiUeVITxxyMZ3YeoBJYuxRRd5sZvQpc4CQHr9As1/lNE WXiD+cJcbhvfrjpFnCbEUKqPZkKY9IA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718334026; a=rsa-sha256; cv=none; b=GEBiJPgcem16jufF/jeFLrrOILXsuAR4sYqQGpggKsO/SEEwoA0E4tRt3LVJypKfnmSiLd hAP/QrQgi1PkSF4NPahIXcfKJYGgcTK8myoKetaXmIL36+6shTwxONzn9ZWyt0l4qe9W0r ZbXTr82w2AVuyRDLRdAKoT1CXAqqHHU= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf11.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com X-AuditID: a67dfc5b-d85ff70000001748-59-666bb2482600 From: Honggyu Kim To: SeongJae Park , damon@lists.linux.dev Cc: Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Steven Rostedt , Gregory Price , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, 42.hyeyoo@gmail.com, art.jeongseob@gmail.com, kernel_team@skhynix.com, Honggyu Kim Subject: [PATCH v6 7/7] Docs/damon: document damos_migrate_{hot,cold} Date: Fri, 14 Jun 2024 12:00:09 +0900 Message-ID: <20240614030010.751-8-honggyu.kim@sk.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240614030010.751-1-honggyu.kim@sk.com> References: <20240614030010.751-1-honggyu.kim@sk.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsXC9ZZnka7Hpuw0g/PbhC0m9hhYzFm/hs3i /oPX7BZP/v9mtWhoesRicXnXHDaLe2v+s1ocWX+WxWLz2TPMFouXq1ns63jAZHH46xsmBx6P paffsHnsnHWX3aNl3y12j02rOtk8Nn2axO5xYsZvFo8Xm2cyemz8+J/d4/MmuQDOKC6blNSc zLLUIn27BK6Mrh89zAUH+CpW9TezNTDO5uli5OCQEDCRODClqIuRE8y89PkYE4jNJqAmceXl JCaQEhEBK4lpO2K7GLk4mAU2MEtMOvcCrEZYwFViy6H7jCA2i4CqxI+1fWBxXgFTif9T+tkh ZmpKPN7+E8zmFDCTmH7sHliNEFDNhStboeoFJU7OfMICYjMLyEs0b53NDNH7mE1i83p3CFtS 4uCKGywTGPlnIWmZhaRlASPTKkahzLyy3MTMHBO9jMq8zAq95PzcTYzACFhW+yd6B+OnC8GH GAU4GJV4eD2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7qoY9aoqfOCOp7tXDCWZf4iF1HlFiKMxIN tZiLihMBFQfDUG4CAAA= X-CFilter-Loop: Reflected X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 83A584000A X-Stat-Signature: o3shithc71c6yrrjbte4udfrcgsey1bn X-Rspam-User: X-HE-Tag: 1718334028-470616 X-HE-Meta: U2FsdGVkX1/DEkijCBXJOHAm6UgkurY9Rsdz7/jSzEE2ZuRMswexWb0DnVikb6LAwBMJo+61g1aMtUv+c7oQYHbCtt3Ir+7eUI/gvTt0eAHjyntm8BfCFA32QO7PF8icUXekkjyMzqWTZar8N0q5/duHbJjSj3h3Fl41m2X6reuq5p0qVww1u+tbgoTLYW0tG0e8yh3zsnv60xfK4NRCubZQFVUax142xjTH8uusepD0Ic1mtJ2qUkI1SooFQazPjsl0n3AbtlmiRXNXV3iEpxS4qNRlVH+aFS7Or7W1P7H+D20QZ7L+P6SrlNxba4oGnf2xO1KOc4WaZiaXB52iL7sT91gOCJcrueF+sXDrSNomZRrChSbkUHBm7nmUALCflMoDRzqHpi8+SPN+JewWrR+pwU3EcbVBiXA9gq9vJFqWn5drCOPtXKTgTtFoNnRU7Yn2yMgRQNshdm6dncUEocWrGCrvuBUqyBwSX9nOLfFu0544Nf8oGvNONPwffUlgJv0jsqA1rLmajSHPccJOHNyCs2YWJW2kfJqK3yYq0z95BK6cm+WqaXIEeJekUojrH36SS7hfiC8gmgSvkeAG4nZfi0qmbJyJJcsrYuWXy6PolnTf+eIN6YsGJQPazWnDKRru0h6d7LQQ0Yku7uFJHSEQnh11TziwB07HUKvMdFfCuKdovlykryFy1IfdboMqfvnYLitmlKAxUDyb7qz84LrlABOqf1ARlduY7QH83VUtTR2B/57iM6lUa6qCKli9k6rG+xl7GLMVJKRjR61+jSiAGhqA5hX5ejxAXmqPqtu+TmhMB9KWi34gP1V5/sGVUDZTJq3f/PnW+nCQBkpVypqVUyBmggE/CiU4gUhX9w9pyiXjQmh9Hr67DTtWoeaeAjAPFjW7xdzPYPW27MEvHZrmX+Wr+9RxC45P1/nPXXjIH328NYLVRTX4vs4fBYopJxo0+l/Rbg5XPVzZrmM /YCgCwEj 3mjdoVeFrTBFUdYaP54PAR0CidEHoyY9cIss5f0Qak9Q6ZMOgockHpdKzqA8huNR/xraKJpDZzaFYycUfQJWbbVGD3UtOy9gR+zm9Zcn/zHI8QHnrxErlps1dxR0LmTq1fVmwjE5zVGNUDxKj35eWi8Y8sQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.119661, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This patch adds damon description for "migrate_hot" and "migrate_cold" actions for both usage and design documents as long as a new "target_nid" knob to set the migration target node. Signed-off-by: Honggyu Kim Reviewed-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 4 ++++ Documentation/mm/damon/design.rst | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index e58ceb89ea2a..98804e34448b 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -300,6 +300,10 @@ from the file and their meaning are same to those of the list on The ``apply_interval_us`` file is for setting and getting the scheme's :ref:`apply_interval ` in microseconds. +The ``target_nid`` file is for setting the migration target node, which is +only meaningful when the ``action`` is either ``migrate_hot`` or +``migrate_cold``. + .. _sysfs_access_pattern: schemes//access_pattern/ diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 3df387249937..3f12c884eb3a 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -325,6 +325,10 @@ that supports each action are as below. Supported by ``paddr`` operations set. - ``lru_deprio``: Deprioritize the region on its LRU lists. Supported by ``paddr`` operations set. + - ``migrate_hot``: Migrate the regions prioritizing warmer regions. + Supported by ``paddr`` operations set. + - ``migrate_cold``: Migrate the regions prioritizing colder regions. + Supported by ``paddr`` operations set. - ``stat``: Do nothing but count the statistics. Supported by all operations sets.