From mboxrd@z Thu Jan 1 00:00:00 1970 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 C4BFCE7718F for ; Thu, 26 Dec 2024 22:15:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F0A856B0096; Thu, 26 Dec 2024 17:15:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E98306B0098; Thu, 26 Dec 2024 17:15:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE5ED6B0099; Thu, 26 Dec 2024 17:15:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id ADA4B6B0096 for ; Thu, 26 Dec 2024 17:15:09 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 391A21C8008 for ; Thu, 26 Dec 2024 22:15:09 +0000 (UTC) X-FDA: 82938515772.05.6FA36A9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id E916B120002 for ; Thu, 26 Dec 2024 22:14:07 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="rp1/LE7w"; spf=pass (imf29.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=1735251275; 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=nATSwRFhkNVA0AlevA+9QNLFitkglVPJGhYKqDmcEC9X5R77W7soauxkCAKLwUoayESLtk vQGph909zx4lHrV+U2/SOZxJk4nzEoOt+mrCgagzdHp4Ws5ySoHIoD7hb/FAhuggmCXg4A l77BR2udmaK5xwOUY59cCQXinD7YlT8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="rp1/LE7w"; spf=pass (imf29.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735251275; a=rsa-sha256; cv=none; b=Bqnvcy3S5hoBnHOfXu2yJUesATzlytKl4dqkumzC9gmocnjHcWRwzsUYmNPzL2ofp/00V8 3D3FUYjd1uPPNpoTa8Na2hTlhlK+OhanUKGps0y0/UIRZEj7dxszR81+/3HxVlqFor5vIA xN90tHNlE4KhD3I3iIrBNyrc+vGAsNA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 28CEA5C6215; Thu, 26 Dec 2024 22:14:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5282AC4CEDC; Thu, 26 Dec 2024 22:15:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735251306; bh=//vhFtbVl0HM6He0HK/Z+ZVxsC9xYIvf1nEXj2Zge2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rp1/LE7wL75YYPfqE6SY8gZNoaSFeZEa7VCvo/p2eTd0835XsUSEdUd72yQOjrOqv VpSJXimUnRRGeWrvbBQxqWXKAprKqYpFlTiGYm8Ut41GFZiEymEFh1RSnJNLyeCOtm LPo3Nz8X5PR+wBLZQHV5syAt1hTIpXz4a9GqmrLARSD5ZPqV5Bcl5hrl5wtGQJxVDQ 8EDKNtOiHzdjP3TC62fpO9VGP9c3vh/rGSJpqj0yTsq9OqJkS53vSq4CFlafKNHv86 BQ4HUUWEQK2+GO87ss3pG5IAd/CR+8BBeHYYBHXLNW2+c2bsxXKqOiQlhERn7hJnZ5 sV/wL+qtF8bWA== 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 07/10] Docs/mm/damon/design: document pass/block filters behaviors Date: Thu, 26 Dec 2024 14:14:42 -0800 Message-Id: <20241226221445.78433-8-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 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E916B120002 X-Rspamd-Server: rspam12 X-Stat-Signature: xdpffz38jf43zzc99133bob5o3uhpjdb X-Rspam-User: X-HE-Tag: 1735251247-333782 X-HE-Meta: U2FsdGVkX18O5gpJ73jIetGUqDiHF8Gl7pT7Rmn5aAwXt60/wynDO3jEHt+c/0Ki9QjmM0ifrZl1j6HOmmZFZnlmrh/3ZmjZ7eUDyL3yLKHKMzJhV3LzQ85uivQbjLrOYdS5ri76cu4udOt0dTBCT1OPxufH/r2srd6wYkgMPMGu5z29ULcxhKiomROO8/FBUt1mAkF5y8ppFIJoRMo2w7tJEJpmaw/F847XAzh563I4N5hIYcijQI0o7HHEx1v+ah5evc6Gfwl+A33rYfBk/CdfNWM3dyD1BKIDiJsOZeeGp6kpgx6xwzd6Y1R0OLlZ17QXV/uSTiSQDMEj38KGRqoBwwrHPy4wcGsJ1zUmCkgRakaku7vWPIfMYGtD5CzJQa1QFHlZUbZB5vImh1Pwjtb+f9lcsmL2K/7bS8fdJatvJGpZwad7buykejuyIOKzBYZGL4qeFGUWzd7lVE1GWfFH/1I89afte5N6NfqTzGor0UJKjwoFmEug0oiv1w+RYqSgWayONkQt3zj1q/e7FVxeR43OvcQE9y6JIOUMgnzpziwOQHQmfa3joVIzgGBW983WGnOh3+MXV6DCaEVmYVKnLwtE9oUqQYrRrZ3mdeEcwnQ1vKoEm6UFodbqK6dnYL79DcwgaVZFtShhXN4SJr91cVaCyLcH1lXiyQbAxJKzq6rbDxt/Yg51oUG6tNjsvHFom86l2tWcWO5+0IXnQK7W+c9kf/LBxq40/SUu7zuMH3ClvqpiZCXABTwY1eqdm9wF3a8MZOFmv+SmNC9U8YWgeWDiU+dw7EK6mDE8jxk4baiuf/YxtUvW8IybpVQqkzXqqE9hkuPik+ckX5aguuOU9IxxOik7SmgCCTVAhnDItZ6GQZs7JlHOEQj8/egpKTYY9aG4ZOC4Hb11kbhGp0U2E8cDpGA6h3fzNpHBxjIWeIdd0BmuPJ0OW9UZRepaqrmPz8fe+hacd6ZvAsN ajbwfeHc pNEzVXemh8zoOo+2mC7XyfhfqiAORzTQCMgzV7FXdrqvDgzZwjKPg//vAtAQVPlwqWaFyxtejdHKhj8PBIA86JEP+48bq852Yfip22NxTNU2fYtOmWt17T19Bjl7EJgkwHAwveBoT7AvreHuB0yHjGYUXZRMc4emgcVNmUsukABOUVnREywQBZoqR7FPCl195WRFYWyeUY/q/DylBWKOjM049zvye4K3w4pjUZyKee8ibRYA= 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. -- 2.39.5