Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2898938pxa; Tue, 18 Aug 2020 00:31:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwRytEFqxRUAr2YHUJs3ks56bc2My/PJWqJwwVNZQi0OJs4JUQ7lDlLJ+7Qtp4JwTTyK4H X-Received: by 2002:a17:906:12d8:: with SMTP id l24mr18506361ejb.260.1597735872307; Tue, 18 Aug 2020 00:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597735872; cv=none; d=google.com; s=arc-20160816; b=clagic1sL4yY/f4G4VlMrcZQRhBECK13EyZHXZi/PqfYYwE8QUXclKOJxKnfWtyR+D B2DY/W0yu3lv+OtPVSX5/HaoX4mynjy21LZnF+h/sNBVK7QCGGB8q3t30fUHfxbXw33N w5UR6GR4hyjP/fmnYpFt5tsMM6ZwhMk4PHkzbB3+CJkAMf3gZA/aVp3WoPM8PJZIBCI3 n0vPlZFsIOI68/y+ZNLwZCaLg9t6akwLVKeJ5gHTHD9/tn39RHXlYFop+pX3p4v2C7Ql BL7IrfRYqu7fn62RbauvTzaRf9KjEUKXZPzvahWUAn0Chg8AtsEVbjYbypIqqu1+cvtF q0mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=TaBhL5HojO46LzRrtNTJtjXeDGLmPmatGGRehayYLuY=; b=im4KBAVandwERWbGyZdYZkcvqhj7s9peJ0/nZHtervKwl8lX99ThiWLkgQIYbtvxnV 1uDPc7zFGjWHpx84X02jNRqnSR5IBkg5yQzWUjN2ZV7T0GyjiulyeKQhfvyCbYdxE5/v KKw3zh3WS9GyiBiLS4leDGx63sSqLa+axtf227/QGVFJDMiocy8QBrsjDGmMxomtzHlS OTlLpu9WiARU1kO5XYdOGCw8J6vTqWF7rFksIPKdhI2lUvcVrJpW/80VAgNBm3lmJMrJ VVHHueIP4kl+1SW3EkgJPSoP+mPm+VN8bfj6xokOgkG24egMZjIkmoXvorZTiiObT74R yzLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=MMePVPja; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nv4si12829129ejb.737.2020.08.18.00.30.48; Tue, 18 Aug 2020 00:31:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=MMePVPja; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726474AbgHRH1i (ORCPT + 99 others); Tue, 18 Aug 2020 03:27:38 -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