Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp232725lqt; Mon, 18 Mar 2024 06:33:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXu56Vz+6Kg7hXpFj9Avs5+F+smvzV27fs7ERaBWiY0G64CIUs9TOAmM8on6E3rXu96esHAF9ZjKZoSjuLVwrvg6u4Rfqva1KWTQU150w== X-Google-Smtp-Source: AGHT+IGyWUIi5e8hMoYX1U+DL27rFCnObNvuXeCwl8rK5j980m0aATU0zwaACmpqet4M1A+8FstU X-Received: by 2002:a05:6402:26c8:b0:568:bdd8:6536 with SMTP id x8-20020a05640226c800b00568bdd86536mr4948171edd.37.1710768836980; Mon, 18 Mar 2024 06:33:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710768836; cv=pass; d=google.com; s=arc-20160816; b=OquTCMLryasbWZL7CIL5Z6hhz/mQmSjoQ/n/tq4/6aEDvpghpJHSmWpqW+NuG59XiD JNRggnbTXI0rAUCNIYuH6LUqJfLwVE7XWLo3WBtoLboiFP66Q8IGWwZch3T3baJvspRa IzUN3Y4xMoGIDEbESMrtZKU6zhcMtCrdIcE5kPe2VlBhaD1vG+XnAf5a1Mt6hTYvo9n0 9jSMPwHk27sTU5kI/hXAsU8tRskWntJJmol+7V3CSt0k3boQspgioybRu+jE8rQBqR7d uLIRg3WcskqvW3mSgNj0088gsykAJ0YJqjoUcroMOPlYS7uSS+5k7jAcILVxIkRDQ5nd H04Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ESbYdQ/MGuMB0zVBUU0CqgphShNmbFR50Mxhe/T8jf4=; fh=okfgzCfy4z3AxFv78EQ03jDLkwFfd+PnCuq7ZEbNmcg=; b=Y/58ZIpsyRuTjOLVkhfZpQEHVvY0iAovbGVsFz4MU3WBB6XvrSIEKimwJj9yt/Ct+u mo9LOz8/777lk4Tjtj6HkQgvhLhUZEDd5/+eY5SlZi02J98U62i+SOIkLw9RUdkrLVmR bCR0thBGqQGLPGu7lx+gydI0wCrNuEE6HQUzBEr3Zkv9JaAu1XCBkhoVIj/zaNXx1jhq OhqupPsr5qfKK/vvnEj25/eSybK+hcPFu3jLgrCwdd/u6ulSj7iK3imNOvFYGJR0rGBU qNwkfpGIxFizMrs6b2osxKOD6jPH5durZVPpifCMOOl1EJZ9bBpMzOJVn5ErYakwZoE2 2LAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-106168-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106168-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n12-20020a056402434c00b005684f9dbc62si4416158edc.493.2024.03.18.06.33.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 06:33:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106168-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-106168-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106168-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B24851F22D53 for ; Mon, 18 Mar 2024 13:33:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0669F481AF; Mon, 18 Mar 2024 13:33:49 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5F0020315; Mon, 18 Mar 2024 13:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710768828; cv=none; b=EebzyFUlcb5NRx6t9SIxCuyUWQvhyJHJ/r4Xrzo5WMIDtiIctpj/qmCMx8HQVr1g6zEAE+MCPw8p2m+07+R0g6QXw5eFlRzAD1ASP6LHWS3MzVCfVW8kcLSnO4O7/DLqXpWRAfO6jrg5O6whckAWXdmRhhOweLR2XASdzL55BI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710768828; c=relaxed/simple; bh=q0xLpqYTqkB9ibXN1mY5JqcfX9PKUlK+8T5l2q2RBq4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=On5KFJ0aRgxwuARNdyISbVdN1TCJMzLrcznfkdNX9dQlCwelS1AIZWP7HoiTVTk90gLYKETrCrWqg2hO0MVdshnNV5EBHaWOzNq3cB9a+qIKXiIisVc5EdTvwuUAjZlj7lGWWDRs6rLh0/Y3qBTCkjHabF8CSB1yo+K+iGKuZzU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-d85ff70000001748-7a-65f842b48e22 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: Mon, 18 Mar 2024 22:33:34 +0900 Message-ID: <20240318133338.2135-1-honggyu.kim@sk.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240317191358.97578-1-sj@kernel.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsXC9ZZnke4Wpx+pBs+6lS0m9hhYzFm/hs1i 140Qi/97jzFaPPn/m9XixM1GNovO70tZLC7vmsNmcW/Nf1aLI+vPslhsPnuG2WLxcjWLfR0P mCwOf33DZDH50gI2ixdTzjBanJw1mcVi9tF77A5CHktPv2Hz2NAEJHbOusvu0bLvFrvHgk2l Hi1H3rJ6LN7zkslj06pONo9Nnyaxe5yY8ZvFY+dDS48Xm2cyevQ2v2Pz+LxJLoAvissmJTUn syy1SN8ugStjxcu3zAVdEhX9J1ezNDBOF+pi5OSQEDCRWLf8NhuM/fBbNzuIzSagJnHl5SQm EFtEQFHi3OOLrF2MXBzMAgtZJHq/bwBLCAsES8w9+5+xi5GDg0VAVeLGLl6QMK+AmcT+M8cZ IWZqSjze/hNsJqeAscT6BU1gtpAAj8SrDfsZIeoFJU7OfMICYjML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avEhRmkOFiVxXq/w1AQhgfTEktTs1NSC1CKYLBMHp1QD4yR+9nk/bxYF/6qWNjOTrcy8 s+TuJYFpxy8edpookeYfaFbUp58d6rf1U+a3/gmrV7sEb+fLf9uTu1RrjYIOP8eWjsy66lUr tEt32SX2vatL/dfM84FlZdbSlq0nP7H+2/vd7fVdrxdbT1jLv/s5TViMa+aqlFyOUBeZ8+3r 1rw2k5VNjbm8RYmlOCPRUIu5qDgRAHvKqbKsAgAA X-CFilter-Loop: Reflected Hi SeongJae, On Sun, 17 Mar 2024 12:13:57 -0700 SeongJae Park wrote: > On Sun, 17 Mar 2024 08:31:44 -0700 SeongJae Park wrote: > > > Hi Honggyu, > > > > On Sun, 17 Mar 2024 17:36:29 +0900 Honggyu Kim wrote: > > > > > 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, > [...] > > > 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. > > > > Does memcg filter works in the opposite way? I don't think so because > > __damos_pa_filter_out() sets 'matches' as 'true' only if the the given folio is > > contained in the given memcg. 'young' filter also simply sets 'matches' as > > 'true' only if the given folio is young. > > > > If it works in the opposite way, it's a bug that need to be fixed. Please let > > me know if I'm missing something. > > I just read the DAMOS filters part of the documentation for DAMON sysfs > interface again. I believe it is explaining the meaning of 'matching' as I > intended to, as below: > > You can write ``Y`` or ``N`` to ``matching`` file to filter out pages that does > or does not match to the type, respectively. Then, the scheme's action will > not be applied to the pages that specified to be filtered out. > > But, I found the following example for memcg filter is wrong, as below: > > For example, below restricts a DAMOS action to be applied to only non-anonymous > pages of all memory cgroups except ``/having_care_already``.:: > > # echo 2 > nr_filters > # # filter out anonymous pages > echo anon > 0/type > echo Y > 0/matching > # # further filter out all cgroups except one at '/having_care_already' > echo memcg > 1/type > echo /having_care_already > 1/memcg_path > echo N > 1/matching > > Specifically, the last line of the commands should write 'Y' instead of 'N' to > do what explained. Without the fix, the action will be applied to only > non-anonymous pages of 'having_care_already' memcg. This is definitely wrong. > I will fix this soon. I'm unsure if this is what made you to believe memcg > DAMOS filter is working in the opposite way, though. I got confused not because of this. I just think it again that this user interface is better to be more intuitive as I mentioned in the previous thread. Thanks, Honggyu > > Thanks, > SJ > > [...]