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 C899DC54E67 for ; Sun, 17 Mar 2024 08:37:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B45896B0082; Sun, 17 Mar 2024 04:37:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF5BA6B0083; Sun, 17 Mar 2024 04:37:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BCD56B0085; Sun, 17 Mar 2024 04:37:04 -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 89B376B0082 for ; Sun, 17 Mar 2024 04:37:04 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 20D5680721 for ; Sun, 17 Mar 2024 08:37:04 +0000 (UTC) X-FDA: 81905875968.23.8CCCD93 Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf30.hostedemail.com (Postfix) with ESMTP id 77E6E8000E for ; Sun, 17 Mar 2024 08:36:59 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710664622; 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=vCv0zON6RiYSW21eV7qKV9sH11cCR+JVTUF7x7KQHM8=; b=brfa1H7Sk4OS9zXumyvUzJhximm1AJVAqHR6R8B0X8ZaOS/BI8vkpKw2nKLNGXjrrS4s9Y KHMBBmffrZArV6SjoleKiprII7L2JAk5jwJEbkKi73xMS4zM69ifQOrwJM/1ClHJHhLjiM dyyQC/O0ziN1vj58IArlGXRR8iwCLg8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of honggyu.kim@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=honggyu.kim@sk.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710664622; a=rsa-sha256; cv=none; b=xbh32Y1OmwMBflHn2q+q8OHFVwa4yeSDiZvap7sGWyeXJ2ckghFz6/LjTmCV8rWRvSGAl+ rq3OYWoEg0D5KkImyr8VOa2gujcwSTTtTQusMcBYiJNy5i3VIusjIMtvSNN9xnJPJKYluu mOlPbmn51V68JQBw6mh/MwHNZQT8BuQ= X-AuditID: a67dfc5b-d6dff70000001748-5b-65f6aba550e8 From: Honggyu Kim To: SeongJae Park Cc: Honggyu Kim , damon@lists.linux.dev, linux-mm@kvack.org, akpm@linux-foundation.org, apopple@nvidia.com, baolin.wang@linux.alibaba.com, dave.jiang@intel.com, hyeongtak.ji@sk.com, kernel_team@skhynix.com, linmiaohe@huawei.com, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, mhiramat@kernel.org, rakie.kim@sk.com, rostedt@goodmis.org, surenb@google.com, yangx.jy@fujitsu.com, ying.huang@intel.com, ziy@nvidia.com, 42.hyeyoo@gmail.com Subject: Re: [RFC PATCH v2 0/7] DAMON based 2-tier memory management for CXL memory Date: Sun, 17 Mar 2024 17:36:29 +0900 Message-ID: <20240317083635.2085-1-honggyu.kim@sk.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240307030550.47095-1-sj@kernel.org> References: M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Lzu9LWSwu75rDZnFvzX9WiyPr z7JYbD57htli8XI1i0PXnrNa7Ot4wGRx+OsbJovJlxawWbyYcobR4uSsySwWs4/eY3cQ81h6 +g2bx4YmILFz1l12j5Z9t9g9Fmwq9Wg58pbVY/Gel0wem1Z1snls+jSJ3ePEjN8sHjsfWnq8 2DyT0aO3+R2bx7fbHh6LX3xg8vi8SS5AIIrLJiU1J7MstUjfLoEr4+/+NSwFN+Ur9i7ZztrA eEGii5GDQ0LAROJgc1IXIycHm4CaxJWXk5hAbBEBRYlzjy+ydjFycTALLGSR6P2+ASwhLBAs Mffsf0YQm0VAVWL2i3usIDavgJnE+9kr2UBsCQFNicfbf7KD2JwCxhIvX75nBrGFBHgkXm3Y zwhRLyhxcuYTFhCbWUBeonnrbOYJjDyzkKRmIUktYGRaxSiSmVeWm5iZY6pXnJ1RmZdZoZec n7uJERhhy2r/TNzB+OWy+yFGAQ5GJR7eC9O/pgqxJpYVV+YeYpTgYFYS4XUVAwrxpiRWVqUW 5ccXleakFh9ilOZgURLn9QpPTRASSE8sSc1OTS1ILYLJMnFwSjUwzuIuTjPZU2bSZzrDqHdO vdch/spaU1khdU3rlesOrnnUfexKgvYJ2V1mDzVkzj0OLf5wJfBOdliIAxOz7gOfkqDYEv8l s8yeKibrRi1gP3VSecqL00yfqyMeRhQzJHz8e+gox5XONZJPPhc3dpnyzFZIm9kYY50XIBX0 N269x3WBn6VMZhVKLMUZiYZazEXFiQBjYalArAIAAA== X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 77E6E8000E X-Rspam-User: X-Stat-Signature: 3gq8oqbonh4u1fm6xrw6bnwt8cgbu1mh X-Rspamd-Server: rspam01 X-HE-Tag: 1710664619-476407 X-HE-Meta: U2FsdGVkX19qDF84X+FX8HTh4EA6FePKxK3ru+2MvYj3w3QcCPnfeqnQoVC+YArGa+jKzIrhB3j/alrO8a0cxmlDBO9IwnyQBjavN0GuEzy0JppK6bqqaH73P1JyYSTghr5Q6hP8r4mghE6ncN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YcIs 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 SeongJae, Thanks for the confirmation. I have a few comments on young filter so please read the inline comments again. On Wed, 12 Mar 2024 08:53:00 -0800 SeongJae Park wrote: > Hi Honggyu, > > > > -----Original Message----- > > > From: SeongJae Park > > > Sent: Tuesday, March 12, 2024 3:33 AM > > > To: Honggyu Kim > > > Cc: SeongJae Park ; kernel_team > > > Subject: RE: Re: [RFC PATCH v2 0/7] DAMON based 2-tier memory management for CXL memory > > > > > > Hi Honggyu, > > > > > > On Mon, 11 Mar 2024 12:51:12 +0000 "honggyu.kim@sk.com" wrote: > > > > > > > Hi SeongJae, > > > > > > > > I've tested it again and found that "young" filter has to be set > > > > differently as follows. > > > > - demote action: set "young" filter with "matching" true > > > > - promote action: set "young" filter with "matching" false > > > > > > DAMOS filter is basically for filtering "out" memory regions that matches to > > > the condition. Hence in your setup, young pages are not filtered out from > > > demote action target. > > > > I thought young filter true means "young pages ARE filtered out" for demotion. > > You're correct. Ack. > > > > > That is, you're demoting pages that "not" young. > > > > Your explanation here looks opposite to the previous statement. > > Again, you're correct. My intention was "non-young pages are not ..." but > maybe I was out of my mind and mistakenly removed "non-" part. Sorry for the > confusion. No problem. I also think it's quite confusing. > > > > > And vice versa, so you're applying promote to non-non-young (young) pages. > > > > Yes, I understand "promote non-non-young pages" means "promote young pages". > > This might be understood as "young pages are NOT filtered out" for promotion > > but it doesn't mean that "old pages are filtered out" instead. > > And we just rely hot detection only on DAMOS logics such as access frequency > > and age. Am I correct? > > You're correct. Ack. But if it doesn't mean that "old pages are filtered out" instead, then do we really need this filter for promotion? If not, maybe should we create another "old" filter for promotion? As of now, the promotion is mostly done inaccurately, but the accurate migration is done at demotion level. To avoid this issue, I feel we should promotion only "young" pages after filtering "old" pages out. > > > > > I understand this is somewhat complex, but what we have for now. > > > > Thanks for the explanation. I guess you mean my filter setup is correct. > > Is it correct? > > Again, you're correct. Your filter setup is what I expected to :) Thanks. I see that it works fine, but I would like to have more discussion about "young" filter. What I think about filter is that if I apply "young" filter "true" for demotion, then the action applies only for "young" pages, but the current implementation works opposite. I understand the function name of internal implementation is "damos_pa_filter_out" so the basic action is filtering out, but the cgroup filter works in the opposite way for now. I would like to hear how you think about this. > > > > > > Then, I see that "hot_cold" migrates hot/cold memory correctly. > > > > > > Thank you so much for sharing this great news! My tests also show no bad > > > signal so far. > > > > > > > > > > > Could you please upload the "damon_folio_mkold" patch to LKML? > > > > Then I will rebase our changes based on it and run the redis test again. > > > > > > I will do that soon. > > > > Thanks a lot for sharing the RFC v2 for DAMOS young filter. > > https://lore.kernel.org/damon/20240311204545.47097-1-sj@kernel.org/ > > > > I will rebase our work based on it and share the result. > > Cool, looking forward to it! Hopefully we will make it be merged into the > mainline by v6.10! I hope so. Thanks for your help! Honggyu