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 4D176C83F27 for ; Tue, 15 Jul 2025 23:43:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A16316B0098; Tue, 15 Jul 2025 19:43:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C6306B009A; Tue, 15 Jul 2025 19:43:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B5486B009D; Tue, 15 Jul 2025 19:43:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 75ABD6B0098 for ; Tue, 15 Jul 2025 19:43:22 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2A50BC0127 for ; Tue, 15 Jul 2025 23:43:22 +0000 (UTC) X-FDA: 83668127844.12.409ED6B Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf24.hostedemail.com (Postfix) with ESMTP id 8293C180008 for ; Tue, 15 Jul 2025 23:43:20 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pbmlVz+d; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of sj@kernel.org designates 172.105.4.254 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=1752623000; 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=OgbaDv4Qt7oHwQpV94dDqWqxtZVad5ZjB2K/in6OXSw=; b=kvhVZmnWhIfx6jg8HZsDI5lVj8PlEpyh+BT4LNsLB9ZPRJWy+3hj3gI46QElBFY/Xzifp7 q2+xApmoCVP0CTt2OJc+fBRvkukEDC4xZypTczGJLidEBUhkHUFkQeX/ENZeWLvBYSgGUm I+GU0y7dUygc3n7uDf6Teu/5+9ONcuo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1752623000; a=rsa-sha256; cv=none; b=H/O9Ae9BjWRH4idjuArLHz1o+cHoWWzleu6WNSifgcLeAieWXUVPrGQErihN8fxmgoPPPK Xd8vWYE3nq8BL0s58kqPXqBZYXe4574+Ibc/7KKKlSUCLAcpJIirK95zn3+3uPYNbZyDMp QX+r+WBooWquHqFaE/DVUrfzGvUD3h0= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pbmlVz+d; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of sj@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sj@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 939B261489; Tue, 15 Jul 2025 23:43:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 224D5C4CEE3; Tue, 15 Jul 2025 23:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752622999; bh=NqbD9ygF1hlwI4boz9O4hjEYJgzHWcdtC7erVdnxiWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pbmlVz+d03qRwos3/KLI4MCbZ0dxgvy+sMbqSQfQPhj8tWYezwOTroxWIdkyoR+0V BqvbHvvcvb7clyEQ60TJME4cNRBPKyFm53LfStCea9jKypX1KbDrmqwTanurdK7DoI XMua84zSY1PEghjPqpaFHSYUEXqrqvv0nWOC4aYmueBQ7wWG+6N1mXdY/Fny5sQrPt u6ma5+nCqewsS/bCdZ9BbtQj3cCNYYHRrM2H1tKrBI48zU+qeb9mWmpJWkB8HKkbXY lK8F7H1mJE2DTUbaa0n6xq0km3zR4ejeTsnxzPaQ5JrMngk7UGqiJoA1n0EneFEEuL yN7NDg1A9bcGw== From: SeongJae Park To: Honggyu Kim Cc: SeongJae Park , kernel_team@skhynix.com, Andrew Morton , Jonathan Corbet , damon@lists.linux.dev, kernel-team@meta.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH 0/4] mm/damon/sysfs: support periodic and automated stats update Date: Tue, 15 Jul 2025 16:43:16 -0700 Message-Id: <20250715234316.91272-1-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <923d9fe1-b959-4fba-9da7-10d2b3126858@sk.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8293C180008 X-Stat-Signature: mowozpcmtm9egn4f745wp4s5y3pjjuwc X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1752623000-715447 X-HE-Meta: U2FsdGVkX1/kxzZRyU4DnisKzHAZ3sH3gTVxsg3g/78TIyDZHtu0BMSsV+LIC+oeD22ipU7nhshq52SzecMAIoXwL+kI4RzMufcrGnKpX3aqSoLyvkXg6xgtLH35cPlv+O9QOSn0tdFeogq13AEFix4/sh1mBzgU+jnwklw+9x79Noo0pc8QAWICAsH2+RDvcuUwK1o+AwhtRsrQZSIowXGIiqAVDXWEOeTPvHUeJBcEF1HI8Dt5ps7t10mpYsrsBvZUm37+nqBKezcBxquoH/6otlEL605Mg4EzofbRT18FqRHVEEdrFwmWKfAS+6FXe1AMlUaBKiSI2Y59/sUcgqJ/DdkRb7rNpA/0iEufi4Hb9kguIdzLrd0HmiEtvnUO7yF5s/h86+acWDCEkfpGdbhPXnboHhtUiC7afPEytQtWjKd8pc9ff1MAJSg5YH1LNbwro09GzTz3sR/jUFk9xMW4bnEe4/HeWJv7vDYrJQk3xBb6sZALJCKgkFhH/q1gukllXuANWVO4rKwCnsH4uzIqhPiyX++VAtVPTW3amDTJTJr6LNPOrxBlHj5aLQXe9S2EdWojzVjYbazznE/KtYyPQeccoI/61LmkN5UuXacza/nNgnQ/JFB68ZOGa75YNnnwKaCRaxaP2X3T8Q1yZKrzQ3uAnbeIf+i2PXZkMBK7sRPg/PAcUHmhr2KXMyPwPG53crKtSoWTle0dwNXBJtGyd5GImCFoAF5bW6d+2q4fjWBDZXs524x/w0ygjsb4DSB+htHtzaACtit2a9LWzMPKeqZdLpcP7heinZ7C2ZnwoNOC4rl8H1mWJePclDhDNBHwBKvPQbNtHV5uzu+rYBKEfXLT5y5D+hJB+S0EBm1N9Val827wXPyeTcTUEp4q4zP5N5xA6vcXEha/1g7JpGPHYqyQRhdmuWjWiTVbT1oQdCKKuvXQ37Mk+ufwR7iwY6vZLN2hkkAeG0lsDHY LfAVX1DF 62Ua7i02Bg6OQu0Tqv9vewTlBlCPBOH/KSLNNnLeILZt81OUPgyALjAd+nHVQcJOrUVpKbEI9TYzQVbGC34+Iu7LKu4KXzSVr1TBOnHu+Lv9IFkdFMLJ9wKDQTny1JzUnroOrTYBRLFvrycM9dWmDyKLi70eME8szInXoFwHTAwY27M+dy011VJsou0TJT7vDBgh05I+kG3rIq20pttF6Z+/Ajm+YbwuyIubXXHSEBJE17rsnGnT4Z0meI6iFvBGgf0lKMGzllLEVoZiBoJJWQBN/8MaFcbenoGEvL671v7QUvO3FeC20/jCy3w== 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: On Wed, 16 Jul 2025 07:20:57 +0900 Honggyu Kim wrote: > Hi SeongJae, > > On 7/13/2025 5:46 AM, SeongJae Park wrote: > > DAMON sysfs interface provides files for reading DAMON internal status > > including DAMOS stats. The content of the files are not automatically > > updated, though. Users should manually request updates of the contents > > by writing a special command to 'state' file of each kdamond directory. > > This interface is good for minimizing overhead, but causes the below > > problems. > > > > First, the usage is cumbersome. This is arguably not a big problem, > > since the user-space tool (damo) can do this instead of the user. > > > > Second, it can be too slow. The update request is not directly handled > > by the sysfs interface but kdamond thread. And kdamond threads wake up > > only once per the sampling interval. Hence if sampling interval is not > > short, each update request could take too long time. The recommended > > sampling interval setup is asking DAMON to automatically tune it, within > > a range between 5 milliseconds and 10 seconds. On production systems it > > is not very rare to have a few seconds sampling interval as a result of > > the auto-tuning, so this can disturb observing DAMON internal status. > > > > Finally, parallel update requests can conflict with each other. When > > parallel update requests are received, DAMON sysfs interface simply > > returns -EBUSY to one of the requests. DAMON user-space tool is hence > > implementing its own backoff mechanism, but this can make the operation > > even slower. > > > > Introduce a new sysfs file, namely refresh_ms, for asking DAMON sysfs > > interface to repeat the essential contents update with a user-specified > > time delay. > > Thanks for working on this, but I have a few questions. > 1. Could you please list up what are the "essential contents"? Thank you for asking this. The contents are auto-tuned monitoring intervals, DAMOS stats, and auto-tuned effective size quota. I will add these on the next version cover letter. > 2. Does it mean that it is different from writing "commit" to "state"? > 3. If not, then is there equivalent action to writing something to "state"? "refresh_ms" works same to other DAMON parameter files. You can set it before starting DAMON, or "commit" new values (including 0 for turning this refresh off) in runtime. I'm not that confident if I understood your point very well, especially what "it"s mean. Let me know if I'm misunderstanding something. > > If possible, then this kind of information is better to be documented because > users might get confused if something isn't udpated when "refresh_ms" is set. You're right! I'll add above things on the next version of the cover letter. Thanks, SJ [...]