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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 560E2C4167B for ; Tue, 28 Nov 2023 18:57:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 829F16B0341; Tue, 28 Nov 2023 13:57:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B2EC6B0347; Tue, 28 Nov 2023 13:57:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 654836B0348; Tue, 28 Nov 2023 13:57:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 578C36B0341 for ; Tue, 28 Nov 2023 13:57:49 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 27D5E8031F for ; Tue, 28 Nov 2023 18:57:49 +0000 (UTC) X-FDA: 81508272258.03.953DD2F Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf04.hostedemail.com (Postfix) with ESMTP id 241F840014 for ; Tue, 28 Nov 2023 18:57:45 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=j8HREUCG; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701197866; a=rsa-sha256; cv=none; b=DyPNzeOmUDq+MGV5a+zi+DQZL/nLZVX321hjB/fNZlzmEmPiRPOZR0QbOXqjW6FtxlmdLv 9ez6yJsFTGq6nTb/rNPoCuELmv1YFo2+7bE5Dc1FeF/pqMzPy99pZJiCsOHxCM3CUQL+9V aVxH2SR5Fm4lOC/qRKZH8P/6ijna9Wc= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=j8HREUCG; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701197866; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=S7gZkP2/YfkBxcWidDvOF95bqyDqy7/LgkwR5lFwgt8=; b=oxIczB+mDZCkIxIgCsOsP/aDNQq9kRY3P8LrQo29nbgBlNz9/PQOv0MHDrP2bB0yt0D1wB YFpRNFFAfwIuGiylWK+QZqsgKmeoiWlXU2Yyw+T9qbc6bDeVz8E3gRl3mUGaod/U143s2D m4+/Mp9WWAPkiBCvIdRH5+czDBV6ru0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C9520CE1C4E; Tue, 28 Nov 2023 18:57:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 821E4C433C7; Tue, 28 Nov 2023 18:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701197862; bh=KIRVGvgTEo6MU+1ULyVc42k3ON+LvmquMKcr6ZnGB3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j8HREUCGIlGLBK181OWcIiiwNM7az5F2/keOGgEmCp1N5CBiZzZbIyXGkTl6cDRpZ h8Mi1fpXus+5yAlhYTVVXAYfH7HJLlst3bzpeA3U7tcnwQIWVrBMSr/Usib3aA94xe 43YUMNYUrAwk4y4uxr79scpnrC7f104NNqHAMUDt/XVR2L/xJtvhva7P0D98UW/nDH XT4K889yFY1VzQ73VM0o4ScUzCecJhELMaZk/1t/YMFcn+jE+hNAbqtpGWR00D9pxS iRXFetT1MZuufpT4Lb20BBecXM40n0krFVJFr/EoSATB0SBnyhdV7Qg8SY/BcvhZIn D93uAYnLbXatQ== From: SeongJae Park To: cuiyangpei Cc: sj@kernel.org, akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cuiyangpei Subject: Re: [PATCH 1/2] mm/damon/sysfs: Implement recording feature Date: Tue, 28 Nov 2023 18:57:39 +0000 Message-Id: <20231128185739.47916-1-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231128073440.11894-1-cuiyangpei@xiaomi.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 241F840014 X-Stat-Signature: p1mm65pyzqaqj9fkjsghptqik4fbeqnn X-HE-Tag: 1701197865-937397 X-HE-Meta: U2FsdGVkX1/W5akBlQ/tdExKeVQTDfwHGKF9EhOo1bmaPvlupht+wjEf5PxgH06hLVML1eKy/vp+FBQnDYoU/nMlzqg/qtuHYuty0pcHosqx4y02d+0GvFKdvHRgriHsVJjf3yFLRwQ6qnA08rI3LK5YVo3NKfbykV7bJwqNfv1rHhC78iIkQuU6ZlHvADJNMgV9cpUAP2CeSqsR3ONTW5584WGTvscGPl2OreZcSKV931e3z8gWSCPBEI57nntmOcOEIa/BFXF0mq3aPQBylNY7fnm4NETLdIJqkq15MvXzNtEtCeVgfYZmIKkpAsGsQgmbQsOujB81kox3TGCBBH/z8YehZRxeOpWHHhB6qEFNg8VvCKJlZfQkA8QiZnGwBFiUmYDdJxKt4L4YaWjIzW8h6zvGqXBB8e5LIXI0LCGpVb20yuPDb6jVYr2zqwRD8hURyUC7+OXIObM8/qcxOFaEDvNo+DfFqvcbwJnt6Css493VmM28j1wBSCpSr+jlWTyFcK5Xj6zWCe9ar75p3/Hfsb5oejcJdmhvSKqdVa32blHWFBE0MxBKqTPFMp1F1r6cL1A2UH1EUitMIlJEJkS4yHbFY10BhqOgg1YfD5mAi4IU/1Upps7z0MqUjtu2jIQwZi/zNfSzz2zgC1mpU+IOa36Gbcl48XaYfQrDZ5I1vOfR9NAL4qceTYCk7jPr+AKtWl3Efajy6/IL6NAbbNwh1mxWXTlRCxx7tkTb4Q9RK8euX6DJKtSFGRg2gK0xL8nX6UMQUkbpMiLqLyTa0zuoHDJvxK+s3x0qhOKya3HD79ZoY7YhCGe1qIaGy3mhk3TrB9HHEAo9ETUhFW5kQSK61/BaBEv30hwwfLCuwuQvoHy9pul1FqQRjBIeunAdegQLnyhb7kzx5U0D+oqjfv3e6pr0p5iT//4142jA3v6sU/KSovcsT/gRplYAYPhVSwbRzuBSb4a69FXg4he GitY0OuK bWos+h5ui8KqkbB6Bx0+TNv1Ad1Eemne+ZCzdbXivZvyD4YT0y2emw6wjw67cxhliDTU8Ioxbt+Mork9urggERbMxSg2E3CJzdtLSitge8oj3NgoLvqyK7T2eQ++bLLKP15SdcAHlJy5EkP/Z4fkktT2DofDVsWHGbDrxnLGHh0V+3oBUqi3FtPy8+dzxdfKtRnB+TKgNh6FPIMyMnap0khamCotMLQ/J2bUEuCtGofBC2AhJ5LGFjkaodd+CtCoVhrTgZwJgi/JtVy8Aw4Li1kdhn/bHO0tRnYavTK/MwGWg7JNf40hw2DAh1w== 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: List-Subscribe: List-Unsubscribe: Hi Cuiyanpei, Thank you for this nice patchset. On Tue, 28 Nov 2023 15:34:39 +0800 cuiyangpei wrote: > The user space users can control DAMON and get the monitoring results > via implements 'recording' feature in 'damon-sysfs'. The feature > can be used via 'record' and 'state' file in the '/kernel/mm/ > damon/admin/kdamonds/N/' directory. > > The file allows users to record monitored access patterns in a text > file. Firstly, users set the size of the buffer and the path of the > result file by writing to the ``record`` file. Then the recorded > results are first written in an in-memory buffer and flushed the > recorded results to a file in batch by writing 'record' to the > ``state`` file. > > For example, below commands set the buffer to be 4 KiB and the result > to be saved in ``/damon.txt``. :: > > # cd /kernel/mm/damon/admin/kdamonds/N > # echo "4096 /damon.txt" > record > # echo "record" > state This reminds me the record feature of DAMON debugfs interface[1], which still not merged in the mainline. I deprioritized the patchset to have a better answer to Andrew's questions on the discussion (nice definition of the binary format and quatization of the benefit), and later I realized I don't have real use case that this makes real benefit, so I'm no more aiming to make this merged into the mainline. More specifically, I'm now thinking the feature is not really needed since trace event based recording works, and we found no problem so far. The DAMON user-space tool (damo)[2] also dropped support of the in-kernel record feature, but we received no problem report. Also, I believe DAMOS tried regions like feature could provide some level of information, since it provides snapshot of the monitoring result, which contains a time data, namely 'age'. Could you please further elaborate your aimed use case of this feature and the advantage compared to other alternatives (tracepoint-based recording or DAMOS tried regions based snapshot collecting) I mentioned above? [1] https://lore.kernel.org/linux-mm/20211011093057.30790-1-sj@kernel.org/ [2] https://github.com/awslabs/damo Thanks, SJ > > Signed-off-by: cuiyangpei