From patchwork Wed Mar 5 22:27:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 14003536 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 ADC23C282EC for ; Wed, 5 Mar 2025 22:28:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6228E28000E; Wed, 5 Mar 2025 17:27:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 585BE280001; Wed, 5 Mar 2025 17:27:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38AF428000E; Wed, 5 Mar 2025 17:27:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 17DED280001 for ; Wed, 5 Mar 2025 17:27:52 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id AA62F120BAC for ; Wed, 5 Mar 2025 22:27:52 +0000 (UTC) X-FDA: 83188935984.16.F947E00 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf19.hostedemail.com (Postfix) with ESMTP id E65761A0009 for ; Wed, 5 Mar 2025 22:27:50 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="A/8GAGHV"; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1741213670; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fxXx6+XRjzwH46Hzb7o8dYkpqRwyMxyP+CfrGt+0z8s=; b=dnWDsmzxF41P2vopw9plsY14fFIvosC679+6s03S0Q1FRsjFEAeg8qY45OhEXaaGVDCM4t /gCq+M3DOwpX4Ix75sdsDie0C8KtFnTodJDIzzc+iD23HDsKAS7qSHgWGIfx6cRcQ69OXs Hx28M7PGj7VvdPPTyIPXjQMUqdA4NQ0= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="A/8GAGHV"; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1741213671; a=rsa-sha256; cv=none; b=OkckLtmm3Q2JtxcJqT6+KbgPYogiYKH+wC9hxlqSXDkFdFRF6XNHuuLcWJjVVc/Q8hqAIe PzlWBdqlyiJ8hnxM9akSxKRAr1y9WW584C4r3DRN7O8irzGzGAfwcNdIKrodzrud7ctYIr zAoHUg90We0dSp6a5TE2W67My4n/QZU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 9FCEFA46563; Wed, 5 Mar 2025 22:22:19 +0000 (UTC) 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> MIME-Version: 1.0 X-Stat-Signature: 5wdpimd954diw9npneenya7m3ts4ec49 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: E65761A0009 X-Rspam-User: X-HE-Tag: 1741213670-736062 X-HE-Meta: U2FsdGVkX1/lpoTVPpvD0tiTOP/x7B1oEoyVFUNpLGebX9hoa/LF+Vod/wLvjh7TGkNTsRljbskAaJxqjNyuHnRtatw880/6hwFv49y6Cv2oDXMq0yQfrIr2aTKQe95i/bKTySN+VSLmfAVtet7zrIslXaXxbwB5SfmEfIXLQ9rNKoGi+8WyMLZ32KeqtSLgXj1DEC2fmoP7afpCHFvtZsxpVLMSGq+Zp3h604tSkZbUErEHUXj8joNdBzQIrDknyjSbDTHMnm8Ydv6daQy3b84gzPV08eprV1u2BLvgf4erfwAwEDKemPszSTxMLcrWxgXs10YWU3wg2IqPbdI7y0kO2f2Fdf6EvbzZElLPYTALlQElMji+WLZAriE9ErliRf+6Nk8itD7R31rqnLZ0WzpcABFSDfcEf97BSBjnmigLk9PScDeoax1Y9SnCi2wVnJylP8umvhvtlrsg+6TG6EQetBCl2fUfAOkOw3rY9+EAedTsbYVak/CzJbRjdU67CkG9XbXy6jGbGIVulPkScSroJn87AHz7sfvKLM1K1ROcVoEuj5EwsB83ug79FnU/dnyCH9TxcXhJUjFBA2wfCdL2qgXtSibiChX83zPRQtIYdCgZm9sO3BMh4NrX7MwRDTxufDf7e36yKlVUrvoE1NudLykkafAIWkxHnX0j6VGNwaqEyDKxGrDNPFLU/4VEJtxIhRdUn5N/yZJw1wD7zdUO1fg8GcJflg/KSM0+fMmm/Xjz3Zfuw2InNFvc5yxfzFkS1Lvvb60cweeiHCGFiBOKiiba5+75YPOoKrIPUKaa9iBHtAUO7DAGJEBd0G/MGe2jxcxqclp/EBrnviuaPUcvB7HNXxNlwib/wbXrJdFCp108FHOwbsMa/YOcjZ03BpBaZv5elfaTJiAI+LnpwbATFFwt4w9LtegAa9RoRGD3qx/npuDoJgCUwZdK3ma7U3Y9pTkFA+rFBny5gVB 3tBdMdlU aqFNk2FoBaecZ9dMgiuAutc94pbbtLyTC3Bf51lZP7KwsmXgtPhWjaP2iKhjyPCaSf3+kIf23dB6nznwxLxMzJkHASeE1m6dSdz8aE4KmjctoD40wOC6BfbJkRxG7cVF3w5M5A1/sFq/jITt6eOXqKASQjFuTWigTaS8KTVnZQY7XNrgG2U7hLnIpzdTPZBdlZVIOnV6GEaQxzdrxYyZQN1S+xUJwWNkR+fJStG9HRORG2RJqLm8EcFtLSKtEKmpkLq30zdgLhYhF/bs7bJ4FXg/9qfkBkRlgtVPJYag8BobDjlbsr0l6CJ1gyA== 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: 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/admin-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 (","). │ │ │ │ │ │ │ │ :ref:`goals `/nr_goals │ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value │ │ │ │ │ │ │ :ref:`watermarks `/metric,interval_us,high,mid,low - │ │ │ │ │ │ │ :ref:`filters `/nr_filters + │ │ │ │ │ │ │ :ref:`{core_,ops_,}filters `/nr_filters │ │ │ │ │ │ │ │ 0/type,matching,allow,memcg_path,addr_start,addr_end,target_idx,min,max │ │ │ │ │ │ │ :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds │ │ │ │ │ │ │ :ref:`tried_regions `/total_bytes @@ -307,9 +307,10 @@ to ``N-1``. Each directory represents each DAMON-based operation scheme. schemes// ------------ -In each scheme directory, five directories (``access_pattern``, ``quotas``, -``watermarks``, ``filters``, ``stats``, and ``tried_regions``) and three files -(``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. 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. .. _sysfs_filters: -schemes//filters/ --------------------- +schemes//{core\_,ops\_,}filters/ +----------------------------------- -The directory for the :ref:`filters ` of the given +Directories for :ref:`filters ` of the given DAMON-based operation scheme. -In the beginning, this directory has only one file, ``nr_filters``. Writing a +``core_filters`` and ``ops_filters`` directories are for the filters handled 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`` will be +installed before those of ``filters``. All three directories have same files. + +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``. Writing 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 evaluated in the numeric order. @@ -435,7 +447,7 @@ 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 the type of the filter. Refer to :ref:`the design doc ` for available type -names and their meanings. +names, their meaning and on what layer those are handled. 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-anonymous pages of all memory cgroups except ``/having_care_already``.:: + # cd ops_filters/0/ # echo 2 > nr_filters # # disallow anonymous pages echo anon > 0/type