From nobody Thu Dec 18 13:13:00 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 32259268698; Wed, 5 Mar 2025 22:27:50 +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=1741213670; cv=none; b=V78IMzTkG1f4xu/Su8woP8YkQThlt+7h73WQCjtI5ywVE8e510vdkAc23tPudGHN7Uw9V+2+bQpBjsNvtPl8AL2MYG6wGOASgyTpmp2ngHrgQaclrWjkYdn92twk6uOfCl17iHRwVBhjiHCNsTIa/OLB4zYML0II2jidySczZ9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741213670; c=relaxed/simple; bh=47X+eEoNM4cXPe501kkxrph0V2B2kHrGH6GZrrO40z0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=q4uzysONpOq36TvqMrjiCISqrFRVA1OPtGbTbYOfYW82IY9zoVFoAN7i5VlRdN3V+HvvDi7DNlaHmw93ek3Usap/m/fCGiohsaLS08kgc3OyAHnzuX6rUEGPpBt8aT2vBIxpA2tzqaOMNMA/10tIT/S6lJSfyrnB0rbj+NVq47Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A/8GAGHV; 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="A/8GAGHV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAAA9C4AF09; Wed, 5 Mar 2025 22:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741213670; bh=47X+eEoNM4cXPe501kkxrph0V2B2kHrGH6GZrrO40z0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A/8GAGHVWwEyJKU9fX+3btSUYqcbCJkD5n70OIIlgDwm2SUWpPrPDbgxWw2cz96Es +WQAAgzNt4rpfKnvi2yeWDbQQc4vdZwg4Lr+Vuyi2vdRaSeakhTMsAIsJVw4iGjauD sRwiK15hqLuulWufZxCON720EA5i0DGS51il9e1f7VKcKWK5nYGkjos/8WRuZLonUg l2berudzd46p8iz7wleIwOxOdVYSNf2dVbJlSkUSs87VPX9Jj1bHydurGROmUaA5VU LF8KlS867WeivAEb9gS1mQbal5hzEOwS4i0X9B2bSr2ukZnVtnljz3Wh+iPGoTT9V0 unPes/owhWHpg== 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 8/8] Docs/admin-guide/mm/damon/usage: update for {core,ops}_filters directories Date: Wed, 5 Mar 2025 14:27:33 -0800 Message-Id: <20250305222733.59089-9-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250305222733.59089-1-sj@kernel.org> References: <20250305222733.59089-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Document {core,ops}_filters directories on usage document. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 31 ++++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index de549dd18107..ced2013db3df 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -83,7 +83,7 @@ comma (","). =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 :ref:`goals `/nr_goals =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 =E2=94=82 0/target_metric,target_value,current_value =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`watermarks `/metric,interval_us,high,mid,low - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`filters `/nr_filters + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`{core_,ops_,}filters `/nr_filters =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 0/type,matching,allow,memcg_path,addr_start,addr_end,target_idx,m= in,max =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,= sz_ops_filter_passed,qt_exceeds =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`tried_regions `/total_bytes @@ -307,9 +307,10 @@ to ``N-1``. Each directory represents each DAMON-base= d operation scheme. schemes// ------------ =20 -In each scheme directory, five directories (``access_pattern``, ``quotas``, -``watermarks``, ``filters``, ``stats``, and ``tried_regions``) and three f= iles -(``action``, ``target_nid`` and ``apply_interval``) exist. +In each scheme directory, seven directories (``access_pattern``, ``quotas`= `, +``watermarks``, ``core_filters``, ``ops_filters``, ``filters``, ``stats``,= and +``tried_regions``) and three files (``action``, ``target_nid`` and +``apply_interval``) exist. =20 The ``action`` file is for setting and getting the scheme's :ref:`action `. The keywords that can be written to and read @@ -420,13 +421,24 @@ The ``interval`` should written in microseconds unit. =20 .. _sysfs_filters: =20 -schemes//filters/ --------------------- +schemes//{core\_,ops\_,}filters/ +----------------------------------- =20 -The directory for the :ref:`filters ` of the g= iven +Directories for :ref:`filters ` of the given DAMON-based operation scheme. =20 -In the beginning, this directory has only one file, ``nr_filters``. Writi= ng a +``core_filters`` and ``ops_filters`` directories are for the filters handl= ed by +the DAMON core layer and operations set layer, respectively. ``filters`` +directory can be used for installing filters regardless of their handled +layers. Filters that requested by ``core_filters`` and ``ops_filters`` wi= ll be +installed before those of ``filters``. All three directories have same fi= les. + +Use of ``filters`` directory can make expecting evaluation orders of given +filters with the files under directory bit confusing. Users are hence +recommended to use ``core_filters`` and ``ops_filters`` directories. The +``filters`` directory could be deprecated in future. + +In the beginning, the directory has only one file, ``nr_filters``. Writin= g a number (``N``) to the file creates the number of child directories named `= `0`` to ``N-1``. Each directory represents each filter. The filters are evalu= ated in the numeric order. @@ -435,7 +447,7 @@ Each filter directory contains nine files, namely ``typ= e``, ``matching``, ``allow``, ``memcg_path``, ``addr_start``, ``addr_end``, ``min``, ``max`` 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. +names, their meaning and on what layer those are handled. =20 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 @@ -455,6 +467,7 @@ the ``type`` and ``matching`` should be allowed or not. For example, below restricts a DAMOS action to be applied to only non-anon= ymous pages of all memory cgroups except ``/having_care_already``.:: =20 + # cd ops_filters/0/ # echo 2 > nr_filters # # disallow anonymous pages echo anon > 0/type --=20 2.39.5