From patchwork Fri Dec 27 21:08:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13922141 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 BB65CE7718B for ; Fri, 27 Dec 2024 21:08:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AFFBE6B0095; Fri, 27 Dec 2024 16:08:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AAFBD6B0096; Fri, 27 Dec 2024 16:08:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 92AF56B0098; Fri, 27 Dec 2024 16:08:37 -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 6F4826B0095 for ; Fri, 27 Dec 2024 16:08:37 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2665D1214D9 for ; Fri, 27 Dec 2024 21:08:37 +0000 (UTC) X-FDA: 82941976194.07.AB28A98 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id 6B1CB1A0017 for ; Fri, 27 Dec 2024 21:07:50 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=EQUefMj+; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735333674; a=rsa-sha256; cv=none; b=jc6lBpdyj3ceDFz03rkybzR37F/BZpu/TiYLUaj3fxFjZBvP5VOkkg2DWi736B21MaT6JM HCkfSr5/1vRljBSNXLlmzZnBnVJBFtB82L0KkevjVgEOLjGfh0Y27z/S7xuQLlAmerOIq+ Bs12Mf1xoGi4JnyTtfeVvFxuGXJwBpY= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=EQUefMj+; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735333674; 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=wqJke7qJiKTI8m1mcvLafdQ1PXo7k9NpC2wdZtaWqgI=; b=yxxajk1/UefEPhOZS6z61/SvAGoIadpZCguRHz7Ge4W8fRJKiJ79QARfpGJ+QKdVn21MuL 69sHZ4GVUd/57t4/RpkyU/xJpW0vpokmJU2ADrc5tkTeMQmF0p6Vay3R9KAAIWsav5ehjj 4sGYnZ7tFQWM9hJeIdinHhvrjdNjgZM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1D5505C613E; Fri, 27 Dec 2024 21:07:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CD5EC4CED6; Fri, 27 Dec 2024 21:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735333714; bh=//vhFtbVl0HM6He0HK/Z+ZVxsC9xYIvf1nEXj2Zge2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EQUefMj+FWzM4VXbZDc5roHqMXa+dd9KuutCjSQ56NMbUULomhMHqHipp3Wt8VRJ8 SjtLPjHWtNuv0pMuFtHg6a2Jh7HSUXt96HVF+2RcySb2IC2QxdilgtLQYf7fqrKLy0 oPykW2Z0eAKxfvmtDy2AuQpNB7zW+mxWx8Qo+z8lRvc5+lDBQ5vbQwwNAD1tjUp4VP W46QWVpxZU5cVDdi2xiSOEIA4Aou+m7YChX4uD4y5seECyH9q9zP8iOYgPAJfbWLRw caCg2KF8cu0umenRO1N2fY/uPRQqIqGjrWAaznZFfEKsoWAFa6LhCJVwna5Sp+FrNJ nRcl1uIXj0ESw== 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 v2 07/10] Docs/mm/damon/design: document pass/block filters behaviors Date: Fri, 27 Dec 2024 13:08:16 -0800 Message-Id: <20241227210819.63776-8-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241227210819.63776-1-sj@kernel.org> References: <20241227210819.63776-1-sj@kernel.org> MIME-Version: 1.0 X-Stat-Signature: chaia1c4cm8557jwd1wapuniqdoemgoc X-Rspam-User: X-Rspamd-Queue-Id: 6B1CB1A0017 X-Rspamd-Server: rspam08 X-HE-Tag: 1735333670-689872 X-HE-Meta: U2FsdGVkX1+kd7OtdVeWHD27AnZ8IB/ny2Hf7fVKjS8OwzkqZj6Jbg8hOvuqya8pXetf2OzfQIc/iF6DG6/EJcTe1N5hbFqcpzV4mqrFBSNpOoX+eSa4Iuxcz/br3id2Di2X9oVS2X/ijHNqDa6KkPpmTViOQYelR4UMzvxzvif6fpEmVuAHuIo/uHuTlO8DDfSV9bH3Bn8kTJo+0OxjElsDIT3iRSTALIi8nbkswOxi0B2aDqYPJmWrMqni8WgXvCB+UZIcEwWjO/z1MwwbcOMxu2XVBkZ+YNHCk3kqCws2RyYYa386o8UIZTwzqeMwxQTOh0yXrOUor4uAK0TheBDHszV7CM9yrDJB6YmZ37qzLiwGi131JBa04CcUcl1QBErv3vAVkzOVK7FIqBreO2Wf/AadaJPy+iQ8BWAuiuRTZRzQRCnvmXpKCvO6cdoUXdLg9gQtOkD/Xg4G+JQKJVFznMkRg4aeOkNH2LRRr4/qkLhDsWxRIVqkGPXRu92d4PRf4c6ZdF24oezQuBTlU/7h4QZ9E8jHvBinEsvCQHFI3ee2z57UVNx5MMBg1rEOtlkaRa6BJyez+q5LgryscxJoIehVRKh6OThR88uKvVo8ZAlzjbcnLya+x4IUtShoI3UdoE4XnAilSF3B58rkyB06X8u7bKEOAd9VKHavjpB6nJsuBlap0hUl2EMwEcKVJtXuolppa8tp1qAqhGXjGFcngQmBuXndk5pPWZ+2rpBig+UJKNLL7+J5GCjDPffnYSoaJbBYHsJcXHyA09wLdLNwXNY9eF4JGsxEIZyKBBZqnuDdC2FnTrwrZIVHKFGoB82M+yLoGLM5lps8Sdcp7gfKTzs42r0fhYH7wifDWSguI9dQ/OMEDhiUvK11uWb6Hl1oSrdJB25l/Nhyt22Oy9TQU1lUbOQxVmhvo0IRsdyNgHbtXaS/1KAxR+BAloJ5AfvOegi54O+Kmd9bnfQ FTE1mKL6 lPPZrNocBvrQIfWopMJBiSGLlneUYXAbl2VE4B/ksxP9pMQ5e1b3nH+CIIVvBExrK1cwj5RDmyDu8er9UuMMJay7mh6WY6z3D1apwP6TgMe51I12qoy5umjU99XqiEIYKJ0shKtSqXBt9IJz5oBK9blJC5ISR8uH6xuzO6SzscqIbAWj8VSkFv5yC2ZSmZZSsDDjyfVwg+T6j2ogP1q8ZThAqZx1N+/sfu2XHST9N+Mpnp1k= 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 DAMOS filters design document to describe the pass/block behavior of filters. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 5ebb572d0999..0265aaef2544 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -504,9 +504,30 @@ have a list of latency-critical processes. To let users optimize DAMOS schemes with such special knowledge, DAMOS provides a feature called DAMOS filters. The feature allows users to set an arbitrary -number of filters for each scheme. Each filter specifies the type of target -memory, and whether it should exclude the memory of the type (filter-out), or -all except the memory of the type (filter-in). +number of filters for each scheme. Each filter specifies + +- a type of memory (``type``), +- whether it is for the memory of the type or all except the type + (``matching``), and +- whether it is to allow (pass through the filter) or reject (block) applying + the scheme's action to the memory (``pass``). + +When multiple filters are installed, each filter is applied in the installed +order. If a memory is matched to one of the filter, followup filters are +ignored. For example, let's assume a filter for passing anonymous pages and +another filter for blocking young pages are installed in the order. If a page +of a region that eligible to apply the scheme's action is an anonymous page, +the scheme's action will be applied to the page regardless of whether it is +young, since it matches with the first filter. On the other hand, if a page of +the region is a non-anonymous page, the scheme's action will be applied only if +the page is young, since the second filter is also applied. + +Note that DAMOS action is eligible to be applied to any memory that satisfies +other conditions if no filter is isntalled. Meanwhile, DAMOS filters work for +only memory that satisfies ``type`` and ``matching``. It means installing only +pass filters is same to installing no filter, because pass filters dont' block +memory of type that not specified to pass. For any use case, at least one +block filter should be installed as the last one. For efficient handling of filters, some types of filters are handled by the core layer, while others are handled by operations set. In the latter case, @@ -516,7 +537,7 @@ filter are not counted as the scheme has tried to the region. In contrast, if a memory regions is filtered by an operations set layer-handled filter, it is counted as the scheme has tried. This difference affects the statistics. -Below types of filters are currently supported. +Below ``type`` of filters are currently supported. - anonymous page - Applied to pages that containing data that not stored in files.