From patchwork Thu Dec 26 22:14:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13921486 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 C1E22E7718F for ; Thu, 26 Dec 2024 22:15:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 93FAF6B009B; Thu, 26 Dec 2024 17:15:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C77C6B009C; Thu, 26 Dec 2024 17:15:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71AE26B009D; Thu, 26 Dec 2024 17:15:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4CEFC6B009B for ; Thu, 26 Dec 2024 17:15:12 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0655680138 for ; Thu, 26 Dec 2024 22:15:12 +0000 (UTC) X-FDA: 82938514764.01.CB7A973 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id B11A740010 for ; Thu, 26 Dec 2024 22:14:24 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FiFtleYH; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 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=1735251261; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UugQhBZxG/wIEaVeQM+PeKNszL9bLzgRoesqxXjnZZM=; b=QhOEnWh62k1dY5phTGnCN8QFCPQfIWs1zhHCAqL3Z5er5xmD2aJ3QgJlXkiOwPTNDgCSq3 XDZS3tnZwHDi+KGsC+fvapnunpwsvHpDZDM1T2/+ulD0hkrQF8pcKLEe6o9TM2nhcuAE1H 2kcxJw/mWXJh60Gb+oXntYKRm1LBJu4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735251261; a=rsa-sha256; cv=none; b=4UKBwrcD3vdrBdYgkzFro70Z4jA5nchuqQKCpJQ26TI/y+TSJGWfPdfu/jlFPaJd8AC4EQ c9JmihfAQER0hnaRgPOUPDLWZOl0/o7UFtPrab/PvEwBy2P7WYKhjdKDw1wimiHQjjiyAY ukPQ3RcvKahqKU+3a4GjGDejISxHqFU= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FiFtleYH; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1B07C5C61EF; Thu, 26 Dec 2024 22:14:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D459C4CED7; Thu, 26 Dec 2024 22:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735251309; bh=HT0LgniPNFcsw7wjoUpvnZv1QsdPFkRx75obGWvCxP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FiFtleYHZx2N3jjzQK6mvKWSmXakMJYqF2WgASexsinNgIeXFu2I9zmBYgi+WTcXt wA2oNmJZcnpDU3HMGTFzs+uoOqb8jYVn8EhVDR6qbFrwx5fpRghRjdVB5eEgVj0I0J M5MMPngoMLlPMnqUPC7V45dAI0sILUxI494Nt3IXdoOhU/XxTCtjrAGACnscAtkao7 nc7cMXTqRdHPB+neSgZ31SVYlSeSshFPdgvtC27yKlkQxs1L5lZTodsP+kDE6sM/iU RnUXRL2D8tLLdauASaT+6FLS9RGFVj/y6cvWKx9spf8PJ7VP4rJ5tOYVVzPMFvH2Hd o4ltyfydy4XlA== 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: [RFC PATCH 10/10] Docs/admin-guide/mm/damon/usage: document DAMOS filter 'pass' sysfs file Date: Thu, 26 Dec 2024 14:14:45 -0800 Message-Id: <20241226221445.78433-11-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241226221445.78433-1-sj@kernel.org> References: <20241226221445.78433-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: B11A740010 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: zzgtf3gqntyxxwq67xm6k3hhszgqbfuw X-HE-Tag: 1735251264-505238 X-HE-Meta: U2FsdGVkX19VBQzn4LgyLFE6EcZahf3L6AN9wX8ZtS7NnUAJrbL0Kn82lBxuMtYOsXNnI5XAFHrDopOVAgt5FTnVkYl1DF8eRGUP97rOnt1GL/q3J9GLhO2v9BVr6d1m4sOSBqv1nxkVxaH2Qq6DrJ1u/9sCjp8Va0rN7J0zH5bzz10UIPL/gEvrT/AL2J/jechCq9RBkRKsEhAh0/fI4D1n+klKJC+bqDZFGAgxbuPOQGXkPjiGWGyKTxRW+wOVtAUTkVHUJQWa8wU6TLz0+iimCOUz4QKbNMN4WC+vtIdPXT0EUsiJzXrqw8uqNdoCgm9YkYH40GMlGcBsmK0VNwtc2FnwP3Ao2eKf1J3JwfJg1bciMMEfIUAR7JCzIxYNljPi42qiiqo/ywKMuOCOdP/OrnHbi2fmwodnUBp86JxQ6JymcwcwxRM9DAOxD0oOcRYWuclzBWXdSSa0508br2WL2hSfjesogvIF3q+SUSaGSbBSHtuEkMwYt0hkzjVpb2LCAuuZxOLdinPR84py+m6uK0Iav4Y01kyORWXuPtNl8F0ZNLjdcoE4WdDNrHhzF3Mo8M95o0e196bitOib7KN3a1fsZtcYmtTZbK7+ngyO2pNEbeucWoO1Ev4MmQpa+EA2vmXdHEcdtqvegjSn/UFDuFBTf9OkZz1udce8rjxBAaQQYQa143IxxbZizCTIPe3wrgyl9+C68n29zj5FbSs78eizUtPVWcg6ESLhn4U5WtFXfU4rZUiVagF3ExLQx3IAtMnzq8Y45IjwrKbVY92uRtM2tAdeewTw9/fMixbAN0kugvPenGNxAuHqSOvrf+5k563iGoCakGll+DD9Fmbtm/BFQBgNrolDJo4EAJx7LU5kzVwkbze/22IjHxGyyO6cWl1ruuapUF6mBQk0wsrbhjT2NnsUXwG/3Y647abEZ5B6/IbW0/did7SQEYNho3diT7DVe8PKNVorP78 ISOGPfcT bWCTnW2qk1uO+HWQM7ISgffHpIzi/4h1+yZxBu0jD6rXSXWxStb91Bp1cgE6n16GDxeUEvT7Vdhn3ehPH0CUeEXldQhHVZ0HSjZgS3rOPDng68m6DG1uBaov2654Vd4vy9eDL2IcDJD9HHDxa+4kBFFG7Zqno33LrlbhX/rtupRNl+JWLizQAtjGz/hPcrGoP1LWU2egc9Ym6PgmoTQKjcTvn7VAKZLP9ykyNhFxz5a3fc1tsgv4aDBsrDcRWEctf//7l8ooJUOwQa20= 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: Update DAMON usage document for the newly added 'pass' sysfs file for DAMOS filters. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 34 ++++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index fa8a5e4199b1..ab343d6ac771 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -89,7 +89,7 @@ comma (","). \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd 0/target_metric,target_value,current_value \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd :ref:`watermarks `/metric,interval_us,high,mid,low \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd :ref:`filters `/nr_filters - \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd 0/type,matching,memcg_id + \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd 0/type,matching,memcg_id,pass \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd :ref:`tried_regions `/total_bytes \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd \ufffd\ufffd\ufffd 0/start,end,nr_accesses,age,sz_filter_passed @@ -412,13 +412,14 @@ 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. -Each filter directory contains six files, namely ``type``, ``matcing``, -``memcg_path``, ``addr_start``, ``addr_end``, and ``target_idx``. To ``type`` -file, you can write one of five special keywords: ``anon`` for anonymous pages, -``memcg`` for specific memory cgroup, ``young`` for young pages, ``addr`` for -specific address range (an open-ended interval), or ``target`` for specific -DAMON monitoring target filtering. Meaning of the types are same to the -description on the :ref:`design doc `. +Each filter directory contains seven files, namely ``type``, ``matcing``, +``pass``, ``memcg_path``, ``addr_start``, ``addr_end``, and ``target_idx``. To +``type`` file, you can write one of five special keywords: ``anon`` for +anonymous pages, ``memcg`` for specific memory cgroup, ``young`` for young +pages, ``addr`` for specific address range (an open-ended interval), or +``target`` for specific DAMON monitoring target filtering. Meaning 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 mount @@ -428,25 +429,30 @@ specify the start and end address of the range to ``addr_start`` and you can specify the index of the target between the list of the DAMON context's monitoring targets list to ``target_idx`` file. -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. +You can write ``Y`` or ``N`` to ``matching`` file to specify whether the filter +is for memory that matches the ``type``. You can write ``Y`` or ``N`` to +``pass`` file to specify should this filter let the memory that satisfies the +``type`` and ``matching`` pass though (allow) or be blocked by (reject) the +filter. Allowing means the scheme's action will be applied to the memory. 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 + # # block anonymous pages echo anon > 0/type echo Y > 0/matching + echo N > 0/pass # # further filter out all cgroups except one at '/having_care_already' echo memcg > 1/type echo /having_care_already > 1/memcg_path echo Y > 1/matching + echo N > 1/pass Refer to the :ref:`DAMOS filters design documentation -` for more details including when each of the -filters are supported and differences on stats. +` for more details including how multiple filters +of different ``pass`` works, when each of the filters are supported, and +differences on stats. .. _sysfs_schemes_stats: