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 5BEB7C7115C for ; Fri, 20 Jun 2025 23:13:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F0BD76B008C; Fri, 20 Jun 2025 19:13:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE2836B0093; Fri, 20 Jun 2025 19:13:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF7BC6B0095; Fri, 20 Jun 2025 19:13:30 -0400 (EDT) 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 CC82B6B008C for ; Fri, 20 Jun 2025 19:13:30 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 54168104890 for ; Fri, 20 Jun 2025 23:13:30 +0000 (UTC) X-FDA: 83577332580.19.655E07E Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf16.hostedemail.com (Postfix) with ESMTP id 997A5180002 for ; Fri, 20 Jun 2025 23:13:28 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="A7orA/bU"; spf=pass (imf16.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750461208; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=I4QqSdpEYfyxriZhhqsrqWopTfUZFfWcEPSjn+aF5mc=; b=bJLTplOW60bNGa10I9LrYkeY7gj2mDXB3m2vHf7OvTz8gxy92oOTS+cx9bBxWTb63Abdto liMQ73sMl8ZSB4sCEV8cBH/klf8xfchIpfVMgTo7ExoVE7TQKitoi4rHjGdJ3fvUtzwjCY 0Tn/ljB1xnCtPQ/8XdGpI7n6yQKUkPY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750461208; a=rsa-sha256; cv=none; b=eZyhNjWW6C9I+5/I1t1Sr7Qai+1hhPnIgqkMwBGJ0l4sfOeOnBbO32aucPmaA7vfupfTlR 9v7nSLaVssorSuQTsPprFtCJIg1JMBNI3kiuphhrKhdLK50xz0Gn7CKJiD7SyJFzeV+9hq 4ttOXmW6RN3XU3JOKE++bMvlcZlweDM= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="A7orA/bU"; spf=pass (imf16.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 12BAD5C4989; Fri, 20 Jun 2025 23:11:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16DBDC4CEEE; Fri, 20 Jun 2025 23:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750461207; bh=1xpPvJzOsq9DyhQrcWjfxPukK6gyCTgayP5/Qcf3zaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A7orA/bUeaj039gU6uXCNkJVJ+7HNLZK3/vXJVFbY/cEDDnp9fLkjucRqdaahjbYX UHEgsdUTstMPOC6DPQoorO2CKuD+Wa1m2OXdgXbvhyh+OvMiymUa8fnifZEo7VAa47 TVhuStpQOJ/6DcdrHFcktuBJ9zYU4P2YKdJV7U/LQxOIBeo8IG81yOckZ07OfGh+Lc pRSmDZTtW32XSxInOnbpsILSxfF7s1e7RDdKQwKMLW/WorFZflrstw4s+IH42W2QT7 8uIxZ66WqKeKPAT1MkdQeeWVtmE6GIn+b9xTQW3Ity2StRdJnv0glJSo+idiArFQra moIrcsXrc33+g== From: SeongJae Park To: Bijan Tabatabai Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, david@redhat.com, ziy@nvidia.com, matthew.brost@intel.com, joshua.hahnjy@gmail.com, rakie.kim@sk.com, byungchul@sk.com, gourry@gourry.net, ying.huang@linux.alibaba.com, apopple@nvidia.com, bijantabatab@micron.com, venkataravis@micron.com, emirakhur@micron.com, ajayjoshi@micron.com, vtavarespetr@micron.com Subject: Re: [RFC PATCH v2 0/2] mm/damon/paddr: Allow interleaving in migrate_{hot,cold} actions Date: Fri, 20 Jun 2025 16:13:24 -0700 Message-Id: <20250620231324.99607-1-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 997A5180002 X-Stat-Signature: uoy17sfs65ijr9b1hqqnw5tgzyfm18qx X-Rspam-User: X-HE-Tag: 1750461208-752329 X-HE-Meta: U2FsdGVkX19GGjoQKHrqIpZdTDr/ClJB//EgRNkx/U/Zz7h5xEvkuBfyxWn6Vq9BH3f4pZ8+AHmtnhI41g5GGhkBAv6mGfFJeFyw20PRyt3G0+nsUnA/zb4TMdUcalC4b5mA3M8ohZdl0Z/ZFuksNZpwn8r+IqPX/lFAazB30pemCdA6s3OuKorkQl6W8VwTu+nll5sb95wC+gdIxxO5lpqXwvJCJUFJ+fSXvwx0JoI05vRjjlar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e3Z0Fp4NV3jQuQucGeXTtsQVdCjM/A4zSBWSM5M0ErJwcqq6e5xR6rbV1gkKqcme0aPvc3BcrhwukaXnYLejOcPsCS7AJH691lI1lrry86+w6+s6eL1V/T6OQ== 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 Fri, 20 Jun 2025 16:47:26 -0500 Bijan Tabatabai wrote: > Hi SeongJae, > > On Fri, Jun 20, 2025 at 3:21 PM SeongJae Park wrote: > > [...] > > Also, even for general use case, I think such user-space intervention is not > > too much request. Please let me know if I'm wrong. > > You are correct. The userspace tool would be coming up with the > weights, so it would not be hard for it to write those weights to two > places. I coupled the weights used in DAMON and weighted interleaving > for this revision and the previous because I could not think of a use > case where you would want to use different weights for allocation time > and migration, so it felt silly to have two different places with the > same data. However, I don't feel too strongly about this, so I'm > willing to defer to your judgement. Thank you for being kind and flexible about the decision. One such use case I can think off the top of my head is when users want to do memory tiering, and there are multiple nodes of same tier. For example, if users want to migrate hot pages in a node to the upper tier, and there are multiple nodes for the tier, users may want to do the migration with same weight, or in proportion to their free space. So let's push this way for now. Nothing is set on the stone, so please feel free to let me know if you feel differently later. > > Also, our userspace tool updates these weights somewhat frequently, > several times per minute, when it detects a change in the bandwidth > utilization of the system to calibrate the interleave ratio. I am > concerned about how frequent changes to the scheme via the sysfs > interface will affect the effectiveness of DAMON's page sampling. From > what I understand, updates to the sysfs aren't saved until the user > writes to some sysfs file to commit them, This is correct. > then the damon context is > recreated from scratch. Would this throw away all the previous sampling work > done and work splitting and merging regions? This is how an early version of DAMON sysfs interface was working. Your concern was true for the version. Hence, we implemented online tuning feature[1]. If you use DAMON user-space tool, 'damo tune'[2] is the command for using this feature. So, as long as you use the feature, updating weights several times per minute shouldn't make such issues. [1] https://lore.kernel.org/20220429160606.127307-1-sj@kernel.org [2] https://github.com/damonitor/damo/blob/next/USAGE.md#damo-tune > I am not > super familiar with how the sysfs interface interacts with the rest of > the system, so this concern might be entirely unfounded, but I would > appreciate some clarification here. Thank you for asking. Please feel free to ask any more questions as you need! [...] > > This may require writing not small amount of code, especially for DAMON sysfs > > interface. I think it is doable, though. If you don't mind, I'd like to > > quickly make a prototype and share with you. > > > > What do you think? > > That sounds good to me! Having a prototype from you for the sysfs > interface would certainly be helpful, but if you're busy, I can take a > pass at it as well. Great. I will try to do this by this weekend. [...] > Thank you for your help and feedback! The pleasure if mine! Thanks, SJ [...]