From patchwork Tue Jan 7 20:17:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13929586 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 BE248E77197 for ; Tue, 7 Jan 2025 20:18:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D9AA76B00A2; Tue, 7 Jan 2025 15:18:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D22CA6B00A4; Tue, 7 Jan 2025 15:18:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4ED66B00A5; Tue, 7 Jan 2025 15:18:22 -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 928FF6B00A2 for ; Tue, 7 Jan 2025 15:18:22 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2A25C120D0B for ; Tue, 7 Jan 2025 20:18:22 +0000 (UTC) X-FDA: 82981768044.17.4645C28 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf13.hostedemail.com (Postfix) with ESMTP id 8A74C2000B for ; Tue, 7 Jan 2025 20:18:20 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ell3Q7Yy; spf=pass (imf13.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=1736281100; 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=L+809XkuIWNslWGRy2McSJ5Pstgzf7buS/wLZUGypys=; b=h0+uP9KbjwzAS4YmdThvb7a+BgEYYgD68OAw4bzp/xlufnvhOaYQkAIEggGTVBcBVDPfQL oQhIIMB8BSbrGWRM9ILmfZV4npJEvZd3j38zEpEt3Pv7V13YMxdqth77PA/ex4nVczwwtg o6q+02OuuiSCzS69hvIKzBdvmlanUcc= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ell3Q7Yy; spf=pass (imf13.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=1736281100; a=rsa-sha256; cv=none; b=afsWKg6t8VPGrr4P9MEqwIVkTuofLC4KlVpJWITucPp9uQYdwR60xfS1ypTKCRQYVL5XWZ zRCLegAswzpOsMXF0CWK0emb9qXz2p3JRMltv9YXUziKqkdrj25RLJolYY3kJdx8bVe3UK AMiXoEeXrEUSg4NMaO1uA25xOfTZwzA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 2C9C0A41CE7; Tue, 7 Jan 2025 20:16:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 653BCC4CEE0; Tue, 7 Jan 2025 20:18:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736281099; bh=jFfn5t+dponFAGP3JrCrxaFExzSUl0AtcYmSwZg8NL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ell3Q7YyhnMjQuSHIgsYWdtxHKNCvQFvRlshmwRsgkIDZEu8EuiOyfjNdUmTLSTCn IBqPoOoSLWO0vZZUfc0dj7R8xfulqbLkAam9UNg1AC/MWNZdeXPvUv6BWO0VQFCsX9 ZmjgVBfqS5AUEo3zaH43JvbCq2sVU0RndAmQykdMOFZZNuvTSyMHdLXxhCEov9t9pl Yv247oIGa4qDtKX1II71Bj83kdG9XBcw8w6MVxruhWxF7FvYCBqP5BPuIf0yab2aYV Tk1UOyrtxbtg1LghJlv5zea4jl51FbkyGnIMnKRTMlTRB8KSDG+5PGBlyiRcg0nswr e7qUcvirZ6mSw== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 10/10] Docs/admin-guide/mm/damon/usage: document DAMOS filter 'pass' sysfs file Date: Tue, 7 Jan 2025 12:17:39 -0800 Message-Id: <20250107201739.79484-11-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107201739.79484-1-sj@kernel.org> References: <20250107201739.79484-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 8A74C2000B X-Rspamd-Server: rspam12 X-Stat-Signature: um4trhux87dj7eif9z7i5cwdbe1jcpxi X-Rspam-User: X-HE-Tag: 1736281100-334146 X-HE-Meta: U2FsdGVkX19Yu/UfBbenHLzkn8QJ56Da7YERTMPPPp8f31LWUBVGOu1Y71oHd4WkJJX61D94BNhL/u4M889Vjt9OISyGq/mUGa6rbWZS8ZNa9e926m07LrSEcy6kbiXnuWZ9kEbaCDDRZdwshnYd7H5GmCqE44uq8y8vL4z0QCASnHguY2Zw4Z/or2rWC1Vhx8/oZCh4+PSrzTCF8+XaUOumpaSEMObAtoNyux5+Y8E5BQItQT8Yq9YYlUQLldVTylfQ9dWO/BqOW4Y89cSC5QO6oeWLDdO2yaSqsluLVNRPPVy9XnjLBs6EuWqr/DN2ilwMlUZ9m172onLDMTFXbxb1USFg4QPrTcmT3zmau/dd8s1RNRKkEPZZWLNLk89am8OgssyR3E5lDS46VRZY4bVu7hXm33pVbvg6ieYiCOYe4C4f1GjZ4DcZOQ6+fo0SDMQQALrD/kVQq4yc4330FJzriBfqJxQ1CPboDj/hZEefMnUYtrND2EJPF0vLhTyR2yMzG+A4dIuGAgMHKnP5UJOqdmjy8rb/ZRlca4bt04P/yMqElkg2o52MPtvLAkEX2NlVklTzHzeDH1/itpbJXf8VomX8VmYIGuoyYEeBA+fBibGJKT1uLS35PoydBllP4La17Ekec04VXoyofGPhlkM1VWBPTxvDjy0WljRHI8TzlSBeFXwNlfLiQ4bf/RBtJBsp67lGTmKjcvTcuhbv/PzP4ys+57/80mbUeomb3xYvPJIz9IHrxZLLQPAID0I6CBcfYi98NBBVro5Qz7eotVHF9DgfkbSkMLlrsVMhYce38boBunhn++Exx9M3y3A6mnH83J1xgx5Ah4+rIoWVuyRop6Yodb1fR7XseEj17XAfMXipJvgKpoVFNjmV6f53gGPsjX9ZF4X/7LxXkCWH/hC4BONGoGAUafIy+xU9MNK9Bs/EWiHEvy7EVf/r3nF8CD9X4rBr1kuzTKc4eIO Iq8a+Hlf NIikE+0WnQRQj8JbNEFjcoCGPUvRE5T1FaurL4JqiKI2EqXk1vJwE4R0Qe+tZfoCV3UC4W3YRHqWvBzqZOdcMqmq4KyWC5jqOxu57kjnvYhcXuEAWvEh2+8e1fj2bHSASFv4BbMyLzpynb6KgvU80kQ613SYLsbQPhNlGwYECROhzPgfkng8YBkjPjdM77BaGs95ibSiOnjmqzjsKFX5uqkskAHxNuaMRZqR4gdFoRb9yNdN5aTWYb9KqIGun85yNNNOzquGT3aa60jaH/TGxLci/QoTxH+MRAPfUw4PrMNTMPwM= 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 8df3357dcfa3..77064c704bf2 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -83,7 +83,7 @@ comma (","). │ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value │ │ │ │ │ │ │ :ref:`watermarks `/metric,interval_us,high,mid,low │ │ │ │ │ │ │ :ref:`filters `/nr_filters - │ │ │ │ │ │ │ │ 0/type,matching,memcg_id + │ │ │ │ │ │ │ │ 0/type,matching,memcg_id,pass │ │ │ │ │ │ │ :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds │ │ │ │ │ │ │ :ref:`tried_regions `/total_bytes │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age,sz_filter_passed @@ -406,13 +406,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 @@ -422,25 +423,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: