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 X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63CFEC433E4 for ; Tue, 18 Aug 2020 07:27:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DC0A207DF for ; Tue, 18 Aug 2020 07:27:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="MMePVPja" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726707AbgHRH1j (ORCPT ); Tue, 18 Aug 2020 03:27:39 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:20016 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726343AbgHRH1i (ORCPT ); Tue, 18 Aug 2020 03:27:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1597735658; x=1629271658; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=TaBhL5HojO46LzRrtNTJtjXeDGLmPmatGGRehayYLuY=; b=MMePVPjabcs8Bo1cg2HShvXOsZeoYHI11j57FlnB2tAyBP49NnKAOGp9 uDhIQIcYgRxAFsO3hR7xMT2jsEVX2nlPh2CpUR0k2E1n6uwJIN5cBH0GI Tf61u3arfai7HFCDn6O6ISKADQ8rmpli3MJMmRTq7Z7f5gcqxFc8rVS84 E=; X-IronPort-AV: E=Sophos;i="5.76,326,1592870400"; d="scan'208";a="68776302" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 18 Aug 2020 07:27:34 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com (Postfix) with ESMTPS id 117A6A2195; Tue, 18 Aug 2020 07:27:22 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 18 Aug 2020 07:27:22 +0000 Received: from u3f2cd687b01c55.ant.amazon.com (10.43.162.73) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 18 Aug 2020 07:27:05 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v7 05/10] Docs/admin-guide/mm/damon: Document 'init_regions' feature Date: Tue, 18 Aug 2020 09:24:56 +0200 Message-ID: <20200818072501.30396-6-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200818072501.30396-1-sjpark@amazon.com> References: <20200818072501.30396-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.73] X-ClientProxiedBy: EX13D38UWB002.ant.amazon.com (10.43.161.171) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park This commit adds description of the 'init_regions' feature in the DAMON usage document. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 41 +++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index 96278227f925..cf0d44ce0ac9 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -281,8 +281,9 @@ for at least 100 milliseconds using below commands:: debugfs Interface ================= -DAMON exports five files, ``attrs``, ``target_ids``, ``record``, ``schemes`` -and ``monitor_on`` under its debugfs directory, ``/damon/``. +DAMON exports six files, ``attrs``, ``target_ids``, ``init_regions``, +``record``, ``schemes`` and ``monitor_on`` under its debugfs directory, +``/damon/``. Attributes @@ -321,6 +322,42 @@ check it again:: Note that setting the target ids doesn't start the monitoring. +Initial Monitoring Target Regions +--------------------------------- + +In case of the debugfs based monitoring, DAMON automatically sets and updates +the monitoring target regions so that entire memory mappings of target +processes can be covered. However, users might want to limit the monitoring +region to specific address ranges, such as the heap, the stack, or specific +file-mapped area. Or, some users might know the initial access pattern of +their workloads and therefore want to set optimal initial regions for the +'adaptive regions adjustment'. + +In such cases, users can explicitly set the initial monitoring target regions +as they want, by writing proper values to the ``init_regions`` file. Each line +of the input should represent one region in below form.:: + + + +The ``target id`` should already in ``target_ids`` file, and the regions should +be passed in address order. For example, below commands will set a couple of +address ranges, ``1-100`` and ``100-200`` as the initial monitoring target +region of process 42, and another couple of address ranges, ``20-40`` and +``50-100`` as that of process 4242.:: + + # cd /damon + # echo "42 1 100 + 42 100 200 + 4242 20 40 + 4242 50 100" > init_regions + +Note that this sets the initial monitoring target regions only. In case of +virtual memory monitoring, DAMON will automatically updates the boundary of the +regions after one ``regions update interval``. Therefore, users should set the +``regions update interval`` large enough in this case, if they don't want the +update. + + Record ------ -- 2.17.1