From nobody Tue Dec 16 11:13:12 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02EDD1DB546; Tue, 18 Feb 2025 22:37:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918237; cv=none; b=DpKAdkWHdzB+TAEkGfqmaeVBtWg1/Bp3j4CzwDRiELXxW024uFc5WaORrgw1qjqghr6EwGqkqRl/XAtsZANk+bOjETVAMZK5liNgisUJZ2rcuJaOLM5kOx0QpEEsNYvYE15MeYMGQ7Ty88ImrkZ1+n9ut/x9MQc7c1x+4hJvgz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918237; c=relaxed/simple; bh=oVrTdf5C/EBPIaqFakiqgRImT9fNI+SmRrYJWLyvJAg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B0/9TVWwGbW7bnrgbiVmXjTbxyhuK5/Eo0cVOJIUsUCZED9lT3EtAp3+RifPCGlaTWTbTExf5Mgzs5HjmB6Gaa0WBETHxXfSkTeBdcbty9Xx8A0/+qB+cY9RH7CXdo2IzKvRfudjqjosT+2YE1QUTUanUPQNCQpv+XvFtxYLDSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sWv28ne6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sWv28ne6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90B99C4CEE9; Tue, 18 Feb 2025 22:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739918235; bh=oVrTdf5C/EBPIaqFakiqgRImT9fNI+SmRrYJWLyvJAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sWv28ne6lJmgoEZuJmn/3XVtEE1nWDasnYx3PPO0nWlPF4XtkkXvBUfHx7r8Oyd9y usAKH6EF284Tx7bGBB43hO4EcKKrGcNGj+Atk7Am8nYQ5nweYjyFgufIFsrx3N3Lv0 jveAIA0qL16c/YBXdLEGDjmhxdWSLztB8ch5zg08Pb2Z4gfkI65BisKvY0hWA8EgUz 6ehh3lHk+sWLiZsvrgGmA0oLp+l/JwauIRWQzeGQrBKzjlatB+DEUzZCwT2UlU2+VE 3GBgNt6lAciFyVjl1IhvOVm0yTtowBAsvpQfZroxv/Nmf1UptD4c4PtP5WHIF4+Rtn fJOAlJT+C1UUA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, kernel-team@meta.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/5] Docs/mm/damon/design: fix typo on DAMOS filters usage doc link Date: Tue, 18 Feb 2025 14:37:04 -0800 Message-Id: <20250218223708.53437-2-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250218223708.53437-1-sj@kernel.org> References: <20250218223708.53437-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The link from DAMOS filters design doc to usage doc has a typo calling filters as watermarks. Fix it. Fixes: d31f5626a0e1 ("Docs/mm/damon/design: add links to sections of DAMON = sysfs interface usage doc") Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index e28c6a1b40ae..12ae7e1209c8 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -617,7 +617,7 @@ Below ``type`` of filters are currently supported. - Applied to pages that belonging to a given DAMON monitoring target. - Handled by the core logic. =20 -To know how user-space can set the watermarks via :ref:`DAMON sysfs interf= ace +To know how user-space can set the filters via :ref:`DAMON sysfs interface `, refer to :ref:`filters ` part of the documentation. =20 --=20 2.39.5 From nobody Tue Dec 16 11:13:12 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7554E1DD0DC; Tue, 18 Feb 2025 22:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918238; cv=none; b=oopNR9cuoG/lLi2WHS0AaVBxqrsy8MB5OCPJKdG5a7/gzEVShbNjEQFWcqB2M4FUiaZ5mUrQoRlawLzuyCvAKFc5qthlKceYhbZ+sd9exBiqzzdFufKgOFuftcuV/SJ+OSG2NgDKEnzXlT2BJ5fkFFsgSQmx68IR/0975CDOUfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918238; c=relaxed/simple; bh=yF1LvomTuLrF1Mrz41dAsbpRkpACzGsaDPNlm98lWpI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q0Q88E89vzobQVQ0szAs6HCwwZZm1Ae2ct2ilFJbNucgIstJgtEG/J0FaM/E/d0QdMvF6U4FUeexKLUoHizOwlNFVDAFc9wPPOHVuXpbNoTqRXN+YC3AldyVj5jR5cWcJu55fpx7ExeWwbQ6bQB00n5mns8UIWzwg+r90fTnnjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mytcYbpB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mytcYbpB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC197C4CEE6; Tue, 18 Feb 2025 22:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739918236; bh=yF1LvomTuLrF1Mrz41dAsbpRkpACzGsaDPNlm98lWpI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mytcYbpBPC7VI/ZarhrxpedSk5sHvFNBVYyrEcfA9Rsaal8g4HwuPOAWKWF22iO6Y zczpBzIhL5Lrq+hI1hi2PiCKeaIYuraCFa0xJv2lDoRy9Gu+V2uc4i+MC0vvHDq6Yt fx7rd0qVHoAGrvhf+BjGKzd/CNgr14hmevFeDNog/U1j3s6ZbXTfGlX66Su6vMua32 fvXTxnM+Qb4Kwl5vN3NJqZ/o1FrfUYjiUvQDqUewmqpoYFjg6M8Nr9qWcZ8B04as/K 0iYVVbIWY92VMFcU+1rOH/NMaSTtnpTv1yq0H8KJZnRRnkPv+2ib7NRRIzyQs7H6bi AeBqGfJgAeqOA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, kernel-team@meta.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/5] Docs/mm/damon/design: document hugepage_size filter Date: Tue, 18 Feb 2025 14:37:05 -0800 Message-Id: <20250218223708.53437-3-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250218223708.53437-1-sj@kernel.org> References: <20250218223708.53437-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'hugepage_size' DAMOS filter type is not documented on the design doc. Add a description of the type. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 12ae7e1209c8..a959c081bc59 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -610,6 +610,9 @@ Below ``type`` of filters are currently supported. - Applied to pages that are accessed after the last access check from = the scheme. - Handled by operations set layer. Supported by only ``paddr`` set. +- pages that managed in a given size range + - Applied to pages that managed in a given size range. + - Handled by operations set layer. Supported by only ``paddr`` set. - address range - Applied to pages that belonging to a given address range. - Handled by the core logic. --=20 2.39.5 From nobody Tue Dec 16 11:13:12 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D93F1DC9AB; Tue, 18 Feb 2025 22:37:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918238; cv=none; b=P/JpMn/j6mcWy7XFLXzBGTk6jWYWo+1cvj5Hap5eNGWldAzTLjZJcFk8+mqdSl5zj/HkdPjrURLPCdD6AjheAxfp+/eaG+Er/kUz8ZsOtmoPyHkZ0f9op5SDnWp5Y6otcvz1DUmg+JJktKkI6Jh+PvoZZQp/DupLMSKVXNvTfyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918238; c=relaxed/simple; bh=OOoII5/zyMHQ8WDLAouq/qJ5GMbnfrXAVmpEUBHSZpQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tYYrKxF4gYnzCrb6rA97max69Y91qJ3vfA8YU8eH7gdLjsxlT/LQOl/566NWpHtLo4rxuh35qZbOXI2bO74Q6aYS4Q85K2mOvIFO/B021MX7gMfYjEjJhKtfBo4XHbbLrcNqNI92aGu5h6v1iJY26Joi4huwWeN0pjSMRonHUyg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QuI8Tq0b; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QuI8Tq0b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB00BC4CEE2; Tue, 18 Feb 2025 22:37:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739918238; bh=OOoII5/zyMHQ8WDLAouq/qJ5GMbnfrXAVmpEUBHSZpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QuI8Tq0ba4foWWD4lvXl4DYdj4Krxz2z/eD4csGR4OWL6PUQWFY5sHuYZM1mu8OAZ uVtiaEI4a81O91DCCHk24hMhtS5SwGzxHgfkMAKa1PkPkCPjeajTIVUuQ1BfkJdx4f gCpm3Lv3Zd1Ma2xHWptxpTpftBGLzJbT+SW7AGXoKTgyxr9uAm0rmzv4KXAToX6LMN OX2CLPygyF01mp3R/MAIxD83zI3dCeVG6vGvKPgWUpn15+2IuBk9vkwtmmxBhA5TiW rEj6XaSC5JH1+xpegU2aIofXYTsQyRkCvNXLRTtsqg0VPzQVS0AHzdQE4zrFXzeHc7 0UgHS6oLynQCQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, kernel-team@meta.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/5] Docs/damon: move DAMOS filter type names and meaning to design doc Date: Tue, 18 Feb 2025 14:37:06 -0800 Message-Id: <20250218223708.53437-4-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250218223708.53437-1-sj@kernel.org> References: <20250218223708.53437-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON sysfs usage doc is describing DAMOS filter type names and their meanings in short. The design doc is providing the short meaning and detailed descriptions, too. This is unnecessary duplicates and confuses where to document new DAMOS filter types and features. Move the details from usage to design doc. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 28 +++++++++----------- Documentation/mm/damon/design.rst | 12 ++++----- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index 51af66c208c5..dc37bba96273 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -408,21 +408,19 @@ in the numeric order. =20 Each filter directory contains nine files, namely ``type``, ``matching``, ``allow``, ``memcg_path``, ``addr_start``, ``addr_end``, ``min``, ``max`` -and ``target_idx``. To ``type`` file, you can write one of six special -keywords: ``anon`` for anonymous pages, ``memcg`` for specific memory cgro= up, -``young`` for young pages, ``addr`` for specific address range (an open-en= ded -interval), ``hugepage_size`` for large folios of a specific size range [``= min``, -``max``] or ``target`` for specific DAMON monitoring target filtering. Me= aning -of the types are same to the description on the :ref:`design doc -`. - -In case of the memory cgroup filtering, you can specify the memory cgroup = of -the interest by writing the path of the memory cgroup from the cgroups mou= nt -point to ``memcg_path`` file. In case of the address range filtering, you= can -specify the start and end address of the range to ``addr_start`` and -``addr_end`` files, respectively. For the DAMON monitoring target filteri= ng, -you can specify the index of the target between the list of the DAMON cont= ext's -monitoring targets list to ``target_idx`` file. +and ``target_idx``. To ``type`` file, you can write the type of the filte= r. +Refer to :ref:`the design doc ` for available = type +names and their meanings. + +For ``memcg`` type, you can specify the memory cgroup of the interest by +writing the path of the memory cgroup from the cgroups mount point to +``memcg_path`` file. For ``addr`` type, you can specify the start and end +address of the range (open-ended interval) to ``addr_start`` and ``addr_en= d`` +files, respectively. For ``hugepage_size`` type, you can specify the mini= mum +and maximum size of the range (closed interval) to ``min`` and ``max`` fil= es, +respectively. For ``target`` type, you can specify the index of the target +between the list of the DAMON context's monitoring targets list to +``target_idx`` file. =20 You can write ``Y`` or ``N`` to ``matching`` file to specify whether the f= ilter is for memory that matches the ``type``. You can write ``Y`` or ``N`` to diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index a959c081bc59..7360e5ac0d06 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -600,23 +600,23 @@ counted as the scheme has tried. This difference aff= ects the statistics. =20 Below ``type`` of filters are currently supported. =20 -- anonymous page +- anon - Applied to pages that containing data that not stored in files. - Handled by operations set layer. Supported by only ``paddr`` set. -- memory cgroup +- memcg - Applied to pages that belonging to a given cgroup. - Handled by operations set layer. Supported by only ``paddr`` set. -- young page +- young - Applied to pages that are accessed after the last access check from = the scheme. - Handled by operations set layer. Supported by only ``paddr`` set. -- pages that managed in a given size range +- hugepage_size - Applied to pages that managed in a given size range. - Handled by operations set layer. Supported by only ``paddr`` set. -- address range +- addr - Applied to pages that belonging to a given address range. - Handled by the core logic. -- DAMON monitoring target +- target - Applied to pages that belonging to a given DAMON monitoring target. - Handled by the core logic. =20 --=20 2.39.5 From nobody Tue Dec 16 11:13:12 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC1BD1DE2A1; Tue, 18 Feb 2025 22:37:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918239; cv=none; b=eX2cCFFhhy+hktJUy0bErGvoWjVmZR8iKM3NWS2jtHbWu/lyOpwPyluBEjOVUn9+WpteD4XblQzPSzLaY/W1/tZbSHfuuI63cfsEx9fLL5rqBwBwNhuaQiwewxYy8wtzMBje73QbtUAVMmKqAr7fdjts3AO8an2+EJWtP0PXP30= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918239; c=relaxed/simple; bh=cs8GWYYnDK1JIzMR8vzHgXGMzwJ95MlnMu1w0ifV6mQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=laXiJ8N7Hhd8pqg4/rmXlwhuUBZ+1wlpaP3VM9tEnuDdZnm2Qi4CCv9CN+zgkDZ3WsJjU6v2OBMIKB6uDEDWKPgivG2qY7TMhIrXUaUtXxD/4hbOZDZ6sRBtWx0sLnhu+asK/pT6Kkp6q+F03wW8sOViNtVTCJNPsGVGqafQS4g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GFPQXAh9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GFPQXAh9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14831C4CEEB; Tue, 18 Feb 2025 22:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739918239; bh=cs8GWYYnDK1JIzMR8vzHgXGMzwJ95MlnMu1w0ifV6mQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GFPQXAh9VN+N/yc8FjF9P74m7RQSFVU5vj7N84H2Hx5TnOc5Q14GoVjY0jtuSRlVS EXbY1/CzBriQvD/ml+QMe7tsrwejA4KolgzANUptgJNMuunGt9kyB7WfAcz+uYJroW Qc+HeqmIZpJtzk/tpZpt9wJkK25AVCWMKOVl1Z+YBL1qTr9dNhB2lZ82cOh6l3uqMk rDqRZJX4JUYA7x2Rnuj0MiMJzGQW6+sK7fEPZjnBJYWKLuIINxYFCuiKWzP9iKc7d5 KZf6X4g1kpvOllzbjLMW0S/oIffkc9Yjg33uXj3NS093kPNgMnHq8OGKLf8Og7OLLY X1pUSNhMRtpzg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, kernel-team@meta.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/5] Docs/mm/damon/design: clarify handling layer based filters evaluation sequence Date: Tue, 18 Feb 2025 14:37:07 -0800 Message-Id: <20250218223708.53437-5-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250218223708.53437-1-sj@kernel.org> References: <20250218223708.53437-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If an element of memory matches a DAMOS filter, filters that installed after that get no chance to make any effect to the element. Hence in what order DAMOS filters are handled is important, if both allow filters and reject filters are used together. The ordering is affected by both the installation order and which layter the filters are handled. The design document is not clearly documenting the latter part. Clarify it on the design doc. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 7360e5ac0d06..8b9727d91434 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -569,11 +569,21 @@ number of filters for each scheme. Each filter speci= fies - whether it is to allow (include) or reject (exclude) applying the scheme's action to the memory (``allow``). =20 -When multiple filters are installed, each filter is evaluated in the insta= lled -order. If a part of memory is matched to one of the filter, next filters = are -ignored. If the memory passes through the filters evaluation stage becaus= e it -is not matched to any of the filters, applying the scheme's action to it is -allowed, same to the behavior when no filter exists. +For efficient handling of filters, some types of filters are handled by the +core layer, while others are handled by operations set. In the latter cas= e, +hence, support of the filter types depends on the DAMON operations set. In +case of the core layer-handled filters, the memory regions that excluded b= y the +filter are not counted as the scheme has tried to the region. In contrast= , if +a memory regions is filtered by an operations set layer-handled filter, it= is +counted as the scheme has tried. This difference affects the statistics. + +When multiple filters are installed, the group of filters that handled by = the +core layer are evaluated first. After that, the group of filters that han= dled +by the operations layer are evaluated. Filters in each of the groups are +evaluated in the installed order. If a part of memory is matched to one o= f the +filter, next filters are ignored. If the memory passes through the filters +evaluation stage because it is not matched to any of the filters, applying= the +scheme's action to it is allowed, same to the behavior when no filter exis= ts. =20 For example, let's assume 1) a filter for allowing anonymous pages and 2) another filter for rejecting young pages are installed in the order. If a= page @@ -590,14 +600,6 @@ filter-allowed or filters evaluation stage passed. It= means that installing allow-filters at the end of the list makes no practical change but only filters-checking overhead. =20 -For efficient handling of filters, some types of filters are handled by the -core layer, while others are handled by operations set. In the latter cas= e, -hence, support of the filter types depends on the DAMON operations set. In -case of the core layer-handled filters, the memory regions that excluded b= y the -filter are not counted as the scheme has tried to the region. In contrast= , if -a memory regions is filtered by an operations set layer-handled filter, it= is -counted as the scheme has tried. This difference affects the statistics. - Below ``type`` of filters are currently supported. =20 - anon --=20 2.39.5 From nobody Tue Dec 16 11:13:12 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 889DC1DE2D7; Tue, 18 Feb 2025 22:37:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918240; cv=none; b=psBl0Wc8lUvJFETv6jpKJQ4rqQ++WFy8pXQEzQwbZtubeVO0J6TOcUIuyfSeyiDId7it8wPU1kxMSY6nPB07+TfI8Pw3lHfecBy8cbQJ9y0SYQ4FMgig7AKLOfDGEprmKahFw4UL2v9FNm8R7LMha5UjAnZ8EPAdZgN9RdtBf7c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739918240; c=relaxed/simple; bh=vUxLfkCpY88Ji5OMZq0cqa7fD684OUmQSZGkIOTWbog=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hlkEK2yYdj7S4M9JpY1U2bZkzF8ElcMhPRK0RjFHLiVWABj2avSNHh/ucqBwonpJnpMPaIi/PHI2hNBeSdZGtueYq0XrYiZX1Y8y1Ng1XAt3qv5hmAGyDsScUQNxhylQlpEw2lQpS65C6UY0TogA+0p9vbjteP+JsGfVsm/7JBo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZBf8IcQ7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZBf8IcQ7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A982C4CEE9; Tue, 18 Feb 2025 22:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739918240; bh=vUxLfkCpY88Ji5OMZq0cqa7fD684OUmQSZGkIOTWbog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZBf8IcQ7SBqxOHl6shx9kpwOG8zyvVKn1o0yGS+ABt/RZa37ik+go4oxPnyWKBXXw xs63aJ2cPumV1wbfLpy7KOFfanMr5BUOgp6V+iHTBkXUjBduRoCWkgxO2bKS31w4LV 4prXRBiq6SBBTjbeBsqH+NOZL+2UCa5bvvkJDplBtndyufgvthbfBo5vnndYsf0OU7 A6sAcK1F1kBuiOv2jGAZ0sowBt24oJigB08yD4BPGBIFJpxShDFlONutU4CXbalMzd AhDIB54oRkG3FFpDfQtTuc1nMwMTz/lZcZg34sQQ2qeSsrnD5mPVrhZgy7NDXMh2sW FbdbNMwV+XHlg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, kernel-team@meta.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 5/5] Docs/mm/damon/design: categorize DAMOS filter types based on handling layer Date: Tue, 18 Feb 2025 14:37:08 -0800 Message-Id: <20250218223708.53437-6-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250218223708.53437-1-sj@kernel.org> References: <20250218223708.53437-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On what DAMON layer a DAMOS filter is handled is important to expect in what order filters will be evaluated. Re-organize the DAMOS filter types list on the design doc to categorize types based on the handling layer, to let users more easily understand the handling order. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 34 ++++++++++++++----------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 8b9727d91434..6a66aa0833fd 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -602,25 +602,21 @@ filters-checking overhead. =20 Below ``type`` of filters are currently supported. =20 -- anon - - Applied to pages that containing data that not stored in files. - - Handled by operations set layer. Supported by only ``paddr`` set. -- memcg - - Applied to pages that belonging to a given cgroup. - - Handled by operations set layer. Supported by only ``paddr`` set. -- young - - Applied to pages that are accessed after the last access check from = the - scheme. - - Handled by operations set layer. Supported by only ``paddr`` set. -- hugepage_size - - Applied to pages that managed in a given size range. - - Handled by operations set layer. Supported by only ``paddr`` set. -- addr - - Applied to pages that belonging to a given address range. - - Handled by the core logic. -- target - - Applied to pages that belonging to a given DAMON monitoring target. - - Handled by the core logic. +- Core layer handled + - addr + - Applied to pages that belonging to a given address range. + - target + - Applied to pages that belonging to a given DAMON monitoring targ= et. +- Operations layer handled, supported by only ``paddr`` operations set. + - anon + - Applied to pages that containing data that not stored in files. + - memcg + - Applied to pages that belonging to a given cgroup. + - young + - Applied to pages that are accessed after the last access check f= rom the + scheme. + - hugepage_size + - Applied to pages that managed in a given size range. =20 To know how user-space can set the filters via :ref:`DAMON sysfs interface `, refer to :ref:`filters ` part of the --=20 2.39.5