From patchwork Thu Feb 20 19:46:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13984469 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 B3BADC021B2 for ; Thu, 20 Feb 2025 19:47:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D287A280336; Thu, 20 Feb 2025 14:47:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CC21A28032E; Thu, 20 Feb 2025 14:47:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2A02280336; Thu, 20 Feb 2025 14:47:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7F3A028032E for ; Thu, 20 Feb 2025 14:47:02 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2CE24B8BD4 for ; Thu, 20 Feb 2025 19:47:02 +0000 (UTC) X-FDA: 83141356284.20.0953FD2 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf18.hostedemail.com (Postfix) with ESMTP id 82BCF1C000D for ; Thu, 20 Feb 2025 19:47:00 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XQ1j2p9F; spf=pass (imf18.hostedemail.com: domain of sj@kernel.org designates 172.105.4.254 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=1740080820; 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=4IqhO9hVSIqxkT4XwjXfyTCAv33K1L6tlmH7jNKLC+4=; b=mdj6hwQFFbr9xMtM9fKC6EYaJf1+o/1IkUgP/Ofyn670kaGk40ccbPBQ2tEzTsDmidqVGR q+n0RkmOMXL4n+ssiARi48gZznin2TL4b5mhVsVyz3V5wnPeG5yuR537iMF6zip+hqug9Y ylkIoP/ef3vI/AQXfwPhs+RT5QDqMDc= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XQ1j2p9F; spf=pass (imf18.hostedemail.com: domain of sj@kernel.org designates 172.105.4.254 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=1740080820; a=rsa-sha256; cv=none; b=lF7+0w0xJ74fepn8bA9K3DfEvTodcYIKgUXmVjXf0OCzmNhAkhxircW3UpT0gHwcsFBAnF LPS4c3KMtsBd3cnWQLj+dO+qjmJVn8Su2jIbueT90tXDSr2oOkd5AbEM/psZduTf8aFPiI IVQ0KDmS5RUz0rERpH8N8iShETKBABg= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id B26396832C; Thu, 20 Feb 2025 19:46:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3DB2C4CED1; Thu, 20 Feb 2025 19:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740080820; bh=gpLkf9zlQXx9+WdyCFmZfQMDYQZmdg3U3lwl8lQVU8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XQ1j2p9FdJNVRlZZLTAB9nZE7l3lDOPSuLJ8cwJcZTqGShGQ0Ez9WwbtFRW19gDU6 ny570yEzYzz473rbwtVzOEBKKLamsqJBsFXuIY6NZiYGXjZXJtrPulkpvgfSK507JJ OKrQTeu50f3G38/jZqdWlNcYxAKgAfROJWMV9AWGiU6DzhP0xWwo1cuHXDt5Jy7roc E3VoKYCe9fpZyqLLeq3BktBihQyU3BHY1PTPZUK7gGK4dEMzvJmPFl0bfM87u/cuYu bH/O0Vr6mecY5vzZgpvaD16rjTWgZTSA/vK4Zi/LEMh4Mo5OqrgCympoBiYHWFXilr ib65nZ47RmwMA== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , 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: Thu, 20 Feb 2025 11:46:46 -0800 Message-Id: <20250220194646.37726-9-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250220194646.37726-1-sj@kernel.org> References: <20250220194646.37726-1-sj@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 82BCF1C000D X-Stat-Signature: iedy1knpeo8ykc5ktyjid18t6r8kox1i X-HE-Tag: 1740080820-119802 X-HE-Meta: U2FsdGVkX1/hYoql+P6LnRK+b6owTSuXQ4TExLF4fpspNXCSE9U5lzRkSjnOkHJ09suZra2VDF6NCq+usS96NlV3v7qGBsteMQyOVTdsGQaEt7BZA7Cu9VWZbMADu7i42wZefbmRDFtH3kj4QyfL2ABJVgNnI/hrSv2d1f1TftjsoPmWpYCWNlFfyka0yPPiKMXq2e3WZQC1T2gL5JqP0OkNrJ3Q23xEOgUl41qUIThaPQWz2eZuUgf3r2iuwxHCCgBOD5Z+Y/ONKGoRwmBQTe4noGv832IZ3/hnsDza7OqNzma/sGvEBU73LWxjRIKkKDRqYKV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=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 dc37bba96273..4b25c25d4f4f 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -82,7 +82,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 @@ -282,9 +282,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 @@ -395,13 +396,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. @@ -410,7 +422,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 @@ -430,6 +442,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