Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp818789ybm; Wed, 27 May 2020 08:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBKT8VzpYM8ruf4xDWeseGb9mG74lsJkMvQRI1WBJWsRR6uZ4h9gvme+jDwp5ztvOteBF2 X-Received: by 2002:a05:6402:3185:: with SMTP id di5mr24462307edb.330.1590594307498; Wed, 27 May 2020 08:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590594307; cv=none; d=google.com; s=arc-20160816; b=LGo+Rjn05eWYmgsQkSvYzQDyWgQJUWwb4GVGVGQCDoiMMkwqyoVt5UK6+ehg4YyjF+ fiB0VZO/8D8ZSwDMrkde+mljev6NMcPJwEuqTktymhYQMc/uqgajR9FWR71nugJhK8EF S/U3GBQ5xDPJmgODRO1waa7fu376fwjnLbvpNZDjuutUC4hbLl6FbLiaAI+EGbuB39R8 dwZJ5ZVCDT0h2IQzuiQHCKlc+4Ss4FQi6eQ6aL9Gb4Nstcurrjxuf/7AazY0mjjyBkI9 KwiYHaXGQwkQomrHGnoL3aY0MsQ2WlGvl7gPr00lcndt848penfbAxgfB/y4zCjzY3M6 jyGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:dkim-signature; bh=fADxTWlH4LAMEkm7SQ4zYt5RXIjtw/oHDeubD8oayko=; b=qRAmF4NY9iLPFucP26Wl3eSxaULr+vf89kRI/3yh4bJwxs0BJhmCbLQVTQQN9RSXxY Xew7SiTGM4J9cRg+WvkWMYzi1xkY7IA7Ss1U4fnG0SZypapVyxSt7RIpGeYPn1w1dfu8 4UJIxc7feqt+vMc90uc8L7GCeHvnXfr31ZG7FH9wWT/YJR4VBNrJdHEgD/i0mkxTt/Pl 4NOwieATodJ9pW/K93iK4n4x1dCkSALTPv+YLqYqkgReK2Y+s+sIobntpkHiKJiPPLr1 SUPGtjuD/l7oeb37AnlUxLFz1dEOfZbKUf1Kr6jOq3q0uvP9kYmAIhKyzjVRoK3N4Ol6 HI5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=G9RV5jm4; 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 s3si1906416eds.446.2020.05.27.08.44.44; Wed, 27 May 2020 08:45:07 -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=G9RV5jm4; 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 S2388276AbgE0LYt (ORCPT + 99 others); Wed, 27 May 2020 07:24:49 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:37405 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725905AbgE0LYs (ORCPT ); Wed, 27 May 2020 07:24:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1590578688; x=1622114688; h=from:to:cc:subject:date:message-id:in-reply-to; bh=fADxTWlH4LAMEkm7SQ4zYt5RXIjtw/oHDeubD8oayko=; b=G9RV5jm4NdNK0qCcVhMHreN/5jwLAPrWOzjO5jzEGo4D9JYLjOO0Kl30 fDKmEk4asDJ5jq9KQzBInOihO0F0Jl2pPMVKuHFXwb2ldsCh0TSdZEdzi SQzP5hPTnucFcewauCNEFn5dIFQg3OV/c1SpsIhmS2ihdvbPx0KDP7P/p 4=; IronPort-SDR: XaM+HO73RYSwTbWe6FcJbQ3RvsKcI7mFm5fHC3DTQ9UqCWzGH8oRn6YrXwKO4skKyKiUU+t6o8 8vq8gjFR4IwA== X-IronPort-AV: E=Sophos;i="5.73,441,1583193600"; d="scan'208";a="46374335" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1d-5dd976cd.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 27 May 2020 11:24:45 +0000 Received: from uc85b765ebdd8595b4b67.ant.amazon.com (iad7-ws-svc-lb50-vlan2.amazon.com [10.0.93.210]) by email-inbound-relay-1d-5dd976cd.us-east-1.amazon.com (Postfix) with ESMTPS id 55B40A250B; Wed, 27 May 2020 11:24:33 +0000 (UTC) Received: from uc85b765ebdd8595b4b67.ant.amazon.com (localhost [127.0.0.1]) by uc85b765ebdd8595b4b67.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTP id 04RBOUDW027457; Wed, 27 May 2020 13:24:30 +0200 Received: (from foersleo@localhost) by uc85b765ebdd8595b4b67.ant.amazon.com (8.15.2/8.15.2/Submit) id 04RBOUEO027456; Wed, 27 May 2020 13:24:30 +0200 From: Leonard Foerster To: SeongJae Park Cc: akpm@linux-foundation.org, SeongJae Park , Jonathan.Cameron@Huawei.com, aarcange@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, amit@kernel.org, benh@kernel.crashing.org, brendan.d.gregg@gmail.com, brendanhiggins@google.com, cai@lca.pw, colin.king@canonical.com, corbet@lwn.net, dwmw@amazon.com, irogers@google.com, jolsa@redhat.com, kirill@shutemov.name, mark.rutland@arm.com, mgorman@suse.de, minchan@kernel.org, mingo@redhat.com, namhyung@kernel.org, peterz@infradead.org, rdunlap@infradead.org, riel@surriel.com, rientjes@google.com, rostedt@goodmis.org, sblbir@amazon.com, shakeelb@google.com, shuah@kernel.org, sj38.park@gmail.com, snu@amazon.de, vbabka@suse.cz, vdavydov.dev@gmail.com, yang.shi@linux.alibaba.com, ying.huang@intel.com, linux-damon@amazon.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v13 09/15] mm/damon: Add debugfs interface Date: Wed, 27 May 2020 13:24:29 +0200 Message-Id: <1590578669-27408-1-git-send-email-foersleo@amazon.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20200525091512.30391-10-sjpark@amazon.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-25T11:15:06+02:00 SeongJae Park wrote: > From: SeongJae Park > > This commit adds a debugfs interface for DAMON. > > DAMON exports four files, ``attrs``, ``pids``, ``record``, and > ``monitor_on`` under its debugfs directory, ``/damon/``. > > Attributes > ---------- > > Users can read and write the ``sampling interval``, ``aggregation > interval``, ``regions update interval``, and min/max number of > monitoring target regions by reading from and writing to the ``attrs`` > file. For example, below commands set those values to 5 ms, 100 ms, > 1,000 ms, 10, 1000 and check it again:: > > # cd /damon > # echo 5000 100000 1000000 10 1000 > attrs > # cat attrs > 5000 100000 1000000 10 1000 > > Target PIDs > ----------- > > Users can read and write the pids of current monitoring target processes > by reading from and writing to the ``pids`` file. For example, below > commands set processes having pids 42 and 4242 as the processes to be > monitored and check it again:: > > # cd /damon > # echo 42 4242 > pids > # cat pids > 42 4242 > > Note that setting the pids doesn't start the monitoring. > > Record > ------ > > DAMON supports direct monitoring result record feature. The recorded > results are first written to a buffer and flushed to a file in batch. > Users can set the size of the buffer and the path to the result file by > reading from and writing to the ``record`` file. For example, below > commands set the buffer to be 4 KiB and the result to be saved in > '/damon.data'. > > # cd /damon > # echo 4096 /damon.data > pids > # cat record > 4096 /damon.data > > Turning On/Off > -------------- > > You can check current status, start and stop the monitoring by reading > from and writing to the ``monitor_on`` file. Writing ``on`` to the file > starts DAMON to monitor the target processes with the attributes. > Writing ``off`` to the file stops DAMON. DAMON also stops if every > target processes is terminated. Below example commands turn on, off, > and check status of DAMON:: > > # cd /damon > # echo on > monitor_on > # echo off > monitor_on > # cat monitor_on > off > > Please note that you cannot write to the ``attrs`` and ``pids`` files > while the monitoring is turned on. If you write to the files while > DAMON is running, ``-EINVAL`` will be returned. > > Signed-off-by: SeongJae Park > --- Reviewed-by: Leonard Foerster