From patchwork Tue Nov 1 22:03:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13027523 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 268C2C43217 for ; Tue, 1 Nov 2022 22:03:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D4FA8E0007; Tue, 1 Nov 2022 18:03:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E9B08E0005; Tue, 1 Nov 2022 18:03:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53A7B8E0007; Tue, 1 Nov 2022 18:03:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 45DF58E0005 for ; Tue, 1 Nov 2022 18:03:39 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EE194C10AF for ; Tue, 1 Nov 2022 22:03:38 +0000 (UTC) X-FDA: 80086250916.05.5C7798A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf03.hostedemail.com (Postfix) with ESMTP id 94C7820004 for ; Tue, 1 Nov 2022 22:03:38 +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 D228061743; Tue, 1 Nov 2022 22:03:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C393C433C1; Tue, 1 Nov 2022 22:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667340217; bh=XY/ulrYaYGf2HDwTIn5UM+YygVjoR1FVPIUX5UmsGLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gAuVFi8XC9immb+OBoh45a69etCiIxST3cQ8zlUrBziijVny5gzKm1g6mJqPwryDE gu2m/my5MjOsEff8QdTwpPM2gvreMqHywFlVaGUGE6HrZCS5jBn8HAUSAu7K0t+t8b 3+ATJxW4lPChNcbiIe/KTaGpulS+IsO62n4Zh6qaDCvakn40ifgWtX2ZMwmtuuMFis W2Dd1zQSIB/iAhpN+GeC9JlZtMW1pwuE/lQU7II4S32fjxG6RY/WSqOEzOeQ1hb4c0 9C9pYgxdYobujW+mCapDZEkkGu5CLw0gQj/h94WcbzWiluppkFQGpJWraXyg90HgV/ mpibBeqhmoKNQ== From: SeongJae Park To: Andrew Morton Cc: Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 7/8] Docs/admin-guide/mm/damon/usage: document schemes//tried_regions sysfs directory Date: Tue, 1 Nov 2022 22:03:27 +0000 Message-Id: <20221101220328.95765-8-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221101220328.95765-1-sj@kernel.org> References: <20221101220328.95765-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=1667340218; 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=ZX1igYP/rs92xwNiIj8Ueo+nL/HoVT5aqpHabIfmrIY=; b=eZ6g9pVcS6YOYKTCsmdZXhW6+ZfvYXlOpTiN/U+KKCS+hfKPlARGgX6o4NYHcFG4erummj kRBpPV3OdbYgvEea15i+yxwtVq2KAUBIakNQdfHKUUXm+WRE24v7TRTgcudKIfF5lI4hcd HGYRGrauEtJQh6vfqvmW+8nR1ikEq9g= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=gAuVFi8X; spf=pass (imf03.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=1667340218; a=rsa-sha256; cv=none; b=PvSqjpv7K+GB1GBPBo+UXa0oWBH2BLtNuNH6vqO21dMctKq3Bo8Uhg1mwQl62g7fx6Wpd6 l0a8L8wctAiJF3w+MLrfRiC063PpKbRUa0twXHZ2TUSFMrzVDmX/fdSdH84OOnirgeEGU2 Eihov8ytaMux5Ue4jp77tzj41u4Gpcc= X-Stat-Signature: rt6ay77naj9wtn1o5bzjyo831ne5x5m5 X-Rspamd-Queue-Id: 94C7820004 X-Rspamd-Server: rspam06 X-Rspam-User: Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=gAuVFi8X; spf=pass (imf03.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-HE-Tag: 1667340218-613344 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 | 45 ++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index c17e02e1e426..1a5b6b71efa1 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_tried_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_tried_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/ ------------------------------ @@ -255,8 +267,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 @@ -351,6 +364,32 @@ 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_tried_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_tried_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 ~~~~~~~