Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4070059rdh; Tue, 28 Nov 2023 10:58:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGevdSkO0ynmOnPQy8mLWGpIKTyl70Cg8LLTBUewHyvcSFzBP0ROV++P2SP4zT+u95B2pmR X-Received: by 2002:a9d:77d8:0:b0:6d8:4c77:3126 with SMTP id w24-20020a9d77d8000000b006d84c773126mr383059otl.8.1701197892005; Tue, 28 Nov 2023 10:58:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701197891; cv=none; d=google.com; s=arc-20160816; b=kB+1yKupYdfKfmvKjgqdiv/ZVOBKoA++zg+h7gDE67OVBOY4E3zcWzc42bspgG1kch YKsCpGv6VN+Ext0FqGKSn4X+qK88CjET2524hiQromDYl3BR3SQzbKVug6zAYt4es2h3 usSc1HVhgAq0saHXumpGZS8KofF/8Nk8BlCC9fLujAkWN13mTQJY5U3WQnP7e/jh4taQ bnfm15tOEfx4lllNiMEiqvxi6XYqMX30w/CVliuhpeFzWMyrHmzUygFPz0jn9N2JNlo9 GywYhgfmtOTJzUwG17SM42xau2jQhBeW/igAVjxPTXQjsD5UtVQiHhXerfsSUtBglv4R Zy/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S7gZkP2/YfkBxcWidDvOF95bqyDqy7/LgkwR5lFwgt8=; fh=la0AwX8Y98c7M1h91BFSF+DnT3KkaT3aenxAchPux/M=; b=v/mT2Mr4ojqFMtA10CP/rWgnw3ZAJj9AG/dgXdaHdKzwgXZs9oeOfwGrAbqKIkJoEf 8dHLLEESSyrgg0attf7ScLdk+ZsqWqCv6n3umrKfoEQKpTcirKeX6ebPAZ1VMlxo0pxE 4fNv7ETg1Ndd5IoLZf73WM14cfUH+hb026zsxR2G52Hjx5E3oAxOKtsIBtdqU9LNuGFU m2h89IoBD058ZFsHgZrCv7zAu+urmBaAU4tgWYTvMTTJ06TmDyCdEMZS5pMFkehsrad2 9fhXc1ZkUpzO5I6uxP4arS9BQUHhfved93BmKwO4iR1S9Zrmemmb01ZQNtf2OQUVhyx4 Zmpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j8HREUCG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id 17-20020a630a11000000b005be1ee5be76si12693264pgk.373.2023.11.28.10.58.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 10:58:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j8HREUCG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8D2EC80758E5; Tue, 28 Nov 2023 10:58:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345626AbjK1S54 (ORCPT + 99 others); Tue, 28 Nov 2023 13:57:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346422AbjK1S5o (ORCPT ); Tue, 28 Nov 2023 13:57:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 692E41701 for ; Tue, 28 Nov 2023 10:57:42 -0800 (PST) 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-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 10:58:09 -0800 (PST) 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