From patchwork Wed Oct 19 00:13:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13011228 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 BF4A7C43217 for ; Wed, 19 Oct 2022 00:13:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2BC8A6B008A; Tue, 18 Oct 2022 20:13:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 273456B0093; Tue, 18 Oct 2022 20:13:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 04B476B0092; Tue, 18 Oct 2022 20:13:34 -0400 (EDT) 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 CEF466B008C for ; Tue, 18 Oct 2022 20:13:34 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A7ACBC04ED for ; Wed, 19 Oct 2022 00:13:34 +0000 (UTC) X-FDA: 80035775148.30.49383BB Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf23.hostedemail.com (Postfix) with ESMTP id 2DC8F14000B for ; Wed, 19 Oct 2022 00:13:33 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7FA136173C; Wed, 19 Oct 2022 00:13:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD009C433C1; Wed, 19 Oct 2022 00:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666138413; bh=9/FGeiEOYNvb4jlX++kbplNjd+0yBtndnVWHo5KmUFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sU4OiWKw+Tz3totah7+yWNfvy9vEObQ80oVLiInwPsnV0A+F/GmlgEgzBz6PlCSsC DehwMm/st+gv7ryH1KecvBEb7ugCOKOQGnNUk8sHlPn1NGinGwfsQ+YKuurTS50X7G b1lK6P0igZ/5nVleHFG8bDX0bjUysYw+KoC/OdYKHxD1DEeivASNy1/cABrcMTxElw 2n6hoRZXvRG1xgsIC1MS3O5SwkEW/H3VUs7BGpDaQcFqS+ZoEDs6338EOW/w3bHnVK o2hGJ+tblIF3gFijSbMAHUWPeTxVI8mlJ9RZxqSVsAixgnWfkUvYLbptAbm4aKQRNi wDOKXXRFcJ0cQ== From: SeongJae Park To: SeongJae Park , Jonathan Corbet Cc: damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 17/18] Docs/admin-guide/mm/damon/usage: document schemes//tried_regions directory Date: Wed, 19 Oct 2022 00:13:16 +0000 Message-Id: <20221019001317.104270-18-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019001317.104270-1-sj@kernel.org> References: <20221019001317.104270-1-sj@kernel.org> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666138414; 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=+bxi9tTzvbviSJifmYbERtVEK4MimVksTRrgRopz6P8=; b=CFQP81/MmJCSQz+q38cJHcmQOJ/J6VsKlf5nCkOYMfbArpGzeqXscHq0pBYUsXYoZ5QaHZ Rp8vwsUrWfcrQf4Ani25/xJ/cAYeDcT1qMHmD3RwU3wBsVB2aMGUun4LclTVXcpWdV1tlV sD35eXWnhxzrpgfwzRVSoAMEPOW8Dlk= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sU4OiWKw; spf=pass (imf23.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666138414; a=rsa-sha256; cv=none; b=fM0a6xzKxEcJAdk/tdpQIM1M+eJPB0ypmlOA3pAfNOqFxwXOspmQc7L6W5VbkrJM32KF8B DWqDiqigU1c0ja+aWfiBgNTjgpO3+s0aWE6eESqcYqZe7SmBtqMLDgDwQ16JpR1dJfJH8u fgZCJyz79irXckY7iDNElkOJlF5/zEM= Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sU4OiWKw; spf=pass (imf23.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2DC8F14000B X-Stat-Signature: ojg95wrzbzs7x5ewn1sggythhhcz57ed X-Rspam-User: X-HE-Tag: 1666138413-506604 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: Document 'tried_regions' directory in DAMON sysfs interface usage in the administrator guide. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 44 ++++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index b47b0cbbd491..649d63ecf67f 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -88,6 +88,9 @@ comma (","). :: │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil │ │ │ │ │ │ │ watermarks/metric,interval_us,high,mid,low │ │ │ │ │ │ │ stats/nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds + │ │ │ │ │ │ │ tried_regions/ + │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age + │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... @@ -125,7 +128,14 @@ in the state. Writing ``commit`` to the ``state`` file makes kdamond reads the user inputs in the sysfs files except ``state`` file again. Writing ``update_schemes_stats`` to ``state`` file updates the contents of stats files for each DAMON-based operation scheme of the kdamond. For details of the -stats, please refer to :ref:`stats section `. +stats, please refer to :ref:`stats section `. Writing +``update_schemes_regions`` to ``state`` file updates the DAMON-based operation +scheme action tried regions directory for each DAMON-based operation scheme of +the kdamond. Writing ``clear_schemes_regions`` to ``state`` file clears the +DAMON-based operating scheme action tried regions directory for each +DAMON-based operation scheme of the kdamond. For details of the DAMON-based +operation scheme action tried regions directory, please refer to +:ref:tried_regions section `. If the state is ``on``, reading ``pid`` shows the pid of the kdamond thread. @@ -166,6 +176,8 @@ You can set and get what type of monitoring operations DAMON will use for the context by writing one of the keywords listed in ``avail_operations`` file and reading from the ``operations`` file. +.. _sysfs_monitoring_attrs: + contexts//monitoring_attrs/ ------------------------------ @@ -252,8 +264,9 @@ to ``N-1``. Each directory represents each DAMON-based operation scheme. schemes// ------------ -In each scheme directory, four directories (``access_pattern``, ``quotas``, -``watermarks``, and ``stats``) and one file (``action``) exist. +In each scheme directory, five directories (``access_pattern``, ``quotas``, +``watermarks``, ``stats``, and ``tried_regions``) and one file (``action``) +exist. The ``action`` file is for setting and getting what action you want to apply to memory regions having specific access pattern of the interest. The keywords @@ -348,6 +361,31 @@ should ask DAMON sysfs interface to updte the content of the files for the stats by writing a special keyword, ``update_schemes_stats`` to the relevant ``kdamonds//state`` file. +.. _sysfs_schemes_tried_regions: + +schemes//tried_regions/ +-------------------------- + +When a special keyword, ``update_schemes_regions``, is written to the relevant +``kdamonds//state`` file, DAMON creates directories named integer starting +from ``0`` under this directory. Each directory contains files exposing +detailed information about each of the memory region that the corresponding +scheme's ``action`` has tried to be applied under this directory, during next +:ref:`aggregation interval `. The information includes +address range, ``nr_accesses``, , and ``age`` of the region. + +The directories will be removed when another special keyword, +``clear_schemes_regions``, is written to the relevant ``kdamonds//state`` +file. + +tried_regions// +------------------ + +In each region directory, you will find four files (``start``, ``end``, +``nr_accesses``, and ``age``). Reading the files will show the start and end +addresses, ``nr_accesses``, and ``age`` of the region that corresponding +DAMON-based operation scheme ``action`` has tried to be applied. + Example ~~~~~~~