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 A9F9BC83F09 for ; Wed, 9 Jul 2025 11:06:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50D5B6B00F1; Wed, 9 Jul 2025 07:06:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BE0A6B00F2; Wed, 9 Jul 2025 07:06:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FB236B00F3; Wed, 9 Jul 2025 07:06:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2B0046B00F1 for ; Wed, 9 Jul 2025 07:06:54 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D567616018F for ; Wed, 9 Jul 2025 11:06:53 +0000 (UTC) X-FDA: 83644448706.06.ED279FB Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf08.hostedemail.com (Postfix) with ESMTP id 40719160006 for ; Wed, 9 Jul 2025 11:06:52 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WG9c5w91; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 172.105.4.254 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=1752059212; 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=Tm4+6Lo0NeDEXjBoxuo569rlwtXlJfWyogmfvTKR6d8=; b=l9A5IDXFANCPf2hOY8pK9TmBmksTPvUYZx/NzNOmPJRTkBGvmwq1zhiLNgwfSyujE7X2vv 6DiLnqSMNZaQBggHeSLplQYAm+F6oU2m8Xh5WGq/Q7Pkox10NUuZsc5QACQ+ZjMyQrHTiS brsTJUBtpBcxcgEtTL8X+I/Wufv7Xbo= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WG9c5w91; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1752059212; a=rsa-sha256; cv=none; b=SLI8zhsHxlFMyvGsf99M+3x5p4R4nf5HMNFs7Rv+CcQevlMEMXRAH2Twu15Qislc5eDR8t w1JSYVtPYLdZzrnwrjmYgLt8D/7LzzLLZ2ArEb+qUo2yIHjXpCxzlgTRjCVbZOA9AK9iQ4 Ohd1IdP1YYikVaetiuKUY/AwMlQpY0w= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 591486144A; Wed, 9 Jul 2025 11:06:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4A09C4CEF4; Wed, 9 Jul 2025 11:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752059211; bh=XMXplijwP1E5Q0AZ8hTKIOCASc0BkQCBS9592DqXXSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WG9c5w91Xj9toKF14iz+X2qGi5u9CRRQOmR6lu2mxx5TuJIFaVwaCetwWmeDI6YVi 0xTpTt6ohizOVyQYLwtOh7ADphUTBEIj0YZ3lp/DtzW5ElG5XqogRtB112Z28gZJAb bHRUDlTXW/IH+s3+gS5gUFg7D+8q26Skr90xvhwsckCh193AhxZmvNzwZgWGpjJSGg Eh6dj2RVqiwMWHGLGNt5UPqatow2HhT2m8Neucpgv17o9D7GnJP1vfcLj6pVwEs58s 5GihYGGew0d66otqRtaejJQ0udjg8NvyqJ8a6abdAZWx7lH5BW2DeOKOBhRiGqYTJB T9in802m7wd4w== From: SeongJae Park To: Bijan Tabatabai Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, akpm@linux-foundation.org, corbet@lwn.net, bijantabatab@micron.com, venkataravis@micron.com, emirakhur@micron.com, vtavarespetr@micron.com, ajayjoshi@micron.com, bijan Subject: Re: [PATCH v4 00/13] mm/damon/vaddr: Allow interleaving in migrate_{hot,cold} actions Date: Wed, 9 Jul 2025 04:06:48 -0700 Message-Id: <20250709110648.52688-1-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250709005952.17776-1-bijan311@gmail.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 40719160006 X-Rspamd-Server: rspam09 X-Stat-Signature: y466fjjkukazeeydd86zrwh3r7bgjr8t X-HE-Tag: 1752059212-497261 X-HE-Meta: U2FsdGVkX1+TpwDSjeTBmoGScHpzCxkZVjYWrd2irO/1BnKSFt2P5cWG4F594YWO2W86HBu8jyakg/jAjJHMz9Js43Nya4vsaBMKaR+ZK5OfPRgfo+nIcied3T6oa/fSu2T87ZvDQz1Bu8KUXkjK+LeDEudayuAmvsnGhKPFWV9Nf4grB5maZUNSgZDO0QXI7LQfWtTu5zN1Cp+C5x8eWYF/6h1hBOOSUpoZUAGDKvKQLNELp0Qf9Anb3uv86joseA1NRZ7yXP16TlrvsPz1TxX+Bc8w+mKRxZt3nO1Z5ZSSVn4e99p6efavMfTGYczL12i9DAbrckLZc7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Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, 8 Jul 2025 19:59:30 -0500 Bijan Tabatabai wrote: > From: bijan Maybe this is not an intended part but something from misconfiguration? I show Andrew merged this series into mm-new after removing this, but headsup for a case that we might do rebase. > > A recent patch set automatically sets the interleave weight for each node > according to the node's maximum bandwidth [1]. In another thread, the patch > set's author, Joshua Hahn, wondered if/how thes weights should be changed > if the bandwidth utilization of the system changes [2]. > > This patch set adds the mechanism for dynamically changing how application > data is interleaved across nodes while leaving the policy of what the > interleave weights should be to userspace. It does this by having the > migrate_{hot,cold} operating schemes interleave application data according > to the list of migration nodes and weights passed in via the DAMON sysfs > interface. This functionality can be used to dynamically adjust how folios > are interleaved by having a userspace process adjust those weights. If no > specific destination nodes or weights are provided, the migrate_{hot,cold} > actions will only migrate folios to damos->target_nid as before. > > The algorithm used to interleave the folios is similar to the one used for > the weighted interleave mempolicy [3]. It uses the offset from which a > folio is mapped into a VMA to determine the node the folio should be placed > in. This method is convenient because for a given set of interleave > weights, a folio has only one valid node it can be placed in, limitng the > amount of unnecessary data movement. However, finding out how a folio is > mapped inside of a VMA requires a costly rmap walk when using a paddr > scheme. As such, we have decided that this functionality makes more sense > as a vaddr scheme [4]. To this end, this patch set also adds vaddr versions > of the migrate_{hot,cold}. [...] > Revision History > ================ > Changes from v3 [10]: > - Fix bug where huge pages would be split Maybe "walk->action = ACTION_CONTINUE;" of ninth patch? Nice finding! Nontheless, since this was found by you and didn't discussed in public before, it would be nice to add a short additional clarifications like above, if we (unlikely) do rebase. > - Fix code nits/issues SJ pointed out > - Added SJ's Reviewed-by tag where appropriate Thank you for revisioning :) > > Changes from v2 [11]: > - Implement interleaving using vaddr instead of paddr > - Add vaddr implementation of migrate_{hot,cold} > - Use DAMON specific interleave weights instead of mempolicy weights > > Changes from v1 [12]: > - Reuse migrate_{hot,cold} actions instead of creating a new action > - Remove vaddr implementation > - Remove most of the use of mempolicy, instead duplicate the interleave > logic and access interleave weights directly > - Write more about the use case in the cover letter > - Write about why DAMON was used for this in the cover letter > - Add correctness test to the cover letter > - Add performance test > > [1] https://lore.kernel.org/linux-mm/20250520141236.2987309-1-joshua.hahnjy@gmail.com/ > [2] https://lore.kernel.org/linux-mm/20250313155705.1943522-1-joshua.hahnjy@gmail.com/ > [3] https://elixir.bootlin.com/linux/v6.15.4/source/mm/mempolicy.c#L2015 > [4] https://lore.kernel.org/damon/20250624223310.55786-1-sj@kernel.org/ > [5] https://lore.kernel.org/linux-mm/20250314151137.892379-1-joshua.hahnjy@gmail.com/ > [6] https://lore.kernel.org/linux-mm/87frjfx6u4.fsf@DESKTOP-5N7EMDA/ > [7] https://github.com/SNU-ARC/MERCI > [8] https://lore.kernel.org/damon/20250702051558.54138-1-sj@kernel.org/ > [9] https://lore.kernel.org/damon/20250709004729.17252-1-bijan311@gmail.com/ > [10] https://lore.kernel.org/damon/20250702201337.5780-1-bijan311@gmail.com/ > [11] https://lore.kernel.org/damon/20250620180458.5041-1-bijan311@gmail.com/ > [12] https://lore.kernel.org/linux-mm/20250612181330.31236-1-bijan311@gmail.com/ > > Bijan Tabatabai (7): > mm/damon/core: Commit damos->migrate_dests > mm/damon: Move migration helpers from paddr to ops-common > mm/damon/vaddr: Add vaddr versions of migrate_{hot,cold} > Docs/mm/damon/design: Document vaddr support for migrate_{hot,cold} > mm/damon/vaddr: Use damos->migrate_dests in migrate_{hot,cold} > mm/damon: Move folio filtering from paddr to ops-common > mm/damon/vaddr: Apply filters in migrate_{hot/cold} > > SeongJae Park (6): > mm/damon: add struct damos_migrate_dests > mm/damon/core: add damos->migrate_dests field > mm/damon/sysfs-schemes: implement DAMOS action destinations directory > mm/damon/sysfs-schemes: set damos->migrate_dests > Docs/ABI/damon: document schemes dests directory > Docs/admin-guide/mm/damon/usage: document dests directory For the entire series, Reviewed-by: SeongJae Park Thanks, SJ [...]