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 27354C61CE8 for ; Mon, 9 Jun 2025 19:13:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B132C6B007B; Mon, 9 Jun 2025 15:13:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC5526B0089; Mon, 9 Jun 2025 15:13:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B4226B008A; Mon, 9 Jun 2025 15:13:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 790EF6B007B for ; Mon, 9 Jun 2025 15:13:13 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3C584160D9B for ; Mon, 9 Jun 2025 19:13:13 +0000 (UTC) X-FDA: 83536810266.03.EBCE762 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf27.hostedemail.com (Postfix) with ESMTP id 5DC4E40002 for ; Mon, 9 Jun 2025 19:13:11 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Dp4DNqAN; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749496391; a=rsa-sha256; cv=none; b=OldhFze2QkwwsmJ5T3Wb98JeV1VoZqcgH2DQo+DMdWOIy7ezUNkJbecusR5aFX/KqFoEZe Id+5qSXfnk1kZKPzqaNRC4Uh/f+aE2Jj4Zk1YkMQLCyuiW9jdDyFISdAF9a9VBgbMwysft bu+bQLud1xN3YX8pxScGjr9ypuFfAXg= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Dp4DNqAN; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 172.234.252.31 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=1749496391; 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=BvOpokdjKiG/2X7cVtyZibMg5QcNF2zUPIQJgaz+kIM=; b=vOIY/uM/Pq6Mb4OJnDGyAe/7MPNHb6cSObB8IZar2JULKzhMQdjg4M586Slo43wSSpsbv+ iV8uZfu7QJsBy6+ylVbgk5uEYGyLDWKESIBcJZCzp8BdEk6MjqkuXF9KEbr2r67esUkDbD Je2mI9qvIaD54go2zwurfADmQPQmtBs= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 17532438EA; Mon, 9 Jun 2025 19:13:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3DA4C4CEEB; Mon, 9 Jun 2025 19:13:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749496389; bh=Tzl3zKxtmHRGQJHxphkU2ytN91LDRb+bSm3NymI6xuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dp4DNqANAbWYuxWfs2byCyss9H/fTP9JtgR2OmFJA980SRLdWcoFhazp98jKAhEta RROkvsUoH/p9PhdiKU+jDV2jit/LQmgrPhCOwWNXjw2bv/5MQQg+U/MbKJdUYynwaB amk/PuH1jDarp6B7sd1sqJt+JlHgzzy3dmWUAEOPzbLiTYwEJ+s7ibKY/AeZ14KsFq SXX9RjUj2LvSsR7li1DQ9AuWjUS/rbSjl2ACJj4V6X0CB0eCT6drRzgTe0O/fe42Ch 93uDKU0conzmxm11ltnsXm3dmderrwYNmRK0cRoynZZZBdz6yZ6QXEnl/26erYf+j0 5MPD+vAQZdnow== From: SeongJae Park To: Honggyu Kim Cc: SeongJae Park , Simon Wang , kernel_team@skhynix.com, "akpm@linux-foundation.org" , "hannes@cmpxchg.org" , "david@redhat.com" , "mhocko@kernel.org" , "zhengqi.arch@bytedance.com" , "shakeel.butt@linux.dev" , "lorenzo.stoakes@oracle.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "damon@lists.linux.dev" Subject: Re: [PATCH 2/2] mm/damon/sysfs-schemes: add use_nodes_of_tier on sysfs-schemes Date: Mon, 9 Jun 2025 12:13:07 -0700 Message-Id: <20250609191307.47928-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: rspam08 X-Rspamd-Queue-Id: 5DC4E40002 X-Stat-Signature: zwo3x4s7httpprqjtbpxjtwozzh8sjg4 X-Rspam-User: X-HE-Tag: 1749496391-380078 X-HE-Meta: U2FsdGVkX191ZzLAVxMGf0/+XZNzYGPmSbIUzrydyo3eRhNb76EKXUx2vgQhXa8kqyx4JG6nX0XvL08w/XRTEulqfd4T835y5DeadDlIl4Pqk0Aci3oaGY9EHe2Jq9yJj9KvAV3k9xROna4wWCSul+RqIe45vH9on3DPxr6etcJMhofUesV5WL1nkg7a++GidG/6SrfCQuI76q/uDyFjoLBFZ06oQtTK5cUUYfqvtQLmxzqSDiMu6TnzOJhELXPdC7c81rvqlpC3Ufo+NFjLuPGuga5Tt4HKw63xciq+3W1nE6O/9FiFpj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j3o9iX0iHcX1Unyr/J0hhtfouRHZaP 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 Mon, 9 Jun 2025 21:39:50 +0900 Honggyu Kim wrote: > Hi SeongJae and Simon, > > On 5/31/2025 4:40 AM, SeongJae Park wrote: [...] > > On Fri, 30 May 2025 08:04:42 +0000 Simon Wang (王传国) wrote: [...] > > So, let's think about if your proposed change is an improvement. As the commit > > 320080272892 is nicely explaining, I think that it is an improved behavior for > > demotion. Actually it seems good behavior for promotion, too. But, the > > behavior we are discussing here is not for the demotion but general migration > > (specifically, DAMOS_MIGRATE_{HOT,COLD}). > > > > In my opinion, DAMOS_MIGRATE_{HOT,COLD} behavior should be somewhat similar to > > that of move_pages() syscall, to make its behavior easy to expect. So I think > > having commit 320080272892's behavior improvement to DAMOS_MIGRATE_{HOT,COLD} > > is not a right thing to do. > > > > And this asks me a question. Is current DAMOS_MIGRATE_{HOT,COLD} behavior > > similar to move_pages() syscall? Not really, since do_move_pages_to_node(), > > which is called from move_pages() syscall and calls migrate_pages() is setting > > mtc->nmask as NULL, while DAMOS_MIGRATE_{HOT,COLD} set it as NODE_MASK_NONE. > > > > Also, do_move_pages_to_node() uses alloc_migration_target() while > > DAMOS_MIGRATE_{HOT,COLD} uses alloc_migrate_folio(). > > I can see alloc_migrate_folio() also calls alloc_migration_target(), but do you > mean alloc_migrate_folio() setting mtc->nmask to NULL is the difference? Yes, and also alloc_migration_target()'s internal optimizations for demotion use case. Nonetheless, I'm saying about the differences between DAMOS_MIGRATE_{HOT,COLD} and move_pages() behaviors in the bigger context. > > > > > I overlooked this different behavior while reviewing this code, sorry. And I > > don't think this difference is what we need to keep, unless there are good > > rasons that well documented. Thank you for let us find this, Simon. > > > > So I suggest to set mtc->nmask as NULL, and use alloc_migration_target() from > > __damon_pa_migrate_folio_list(), same to move_pages() system call. To use > > alloc_migrate_folio() from __damon_pa_migrate_folio_list(), we renamed it from > > alloc_demote_folio(), and made it none-static. If we use > > alloc_migration_target() from __damon_pa_migrate_folio_list(), there is no > > reason to keep the changes. Let's revert those too. > > > > Cc-ing Honggyu, who originally implemented the current behavior of > > __damon_pa_migrate(). Honggyu, could you please let us know if the above > > suggested changes are not ok for you? > > > > If Honggyu has no problem at the suggested change, Simon, would you mind doing > > that? I can also make the patches. I don't really care who do that. I just > > think someone should do that. This shouldn't be urgent real issue, in my > > opinion, though. I will send an RFC for this soon, to make discussions easier and unblocked. Thanks, SJ [...]