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 DC0DAC71157 for ; Tue, 17 Jun 2025 19:54:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8003F6B0099; Tue, 17 Jun 2025 15:54:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B1086B009B; Tue, 17 Jun 2025 15:54:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69F926B009C; Tue, 17 Jun 2025 15:54:55 -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 56C446B0099 for ; Tue, 17 Jun 2025 15:54:55 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D4E20160C75 for ; Tue, 17 Jun 2025 19:54:54 +0000 (UTC) X-FDA: 83565945708.26.BF3AF62 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf14.hostedemail.com (Postfix) with ESMTP id DB11D100007 for ; Tue, 17 Jun 2025 19:54:52 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IZP3MDmf; spf=pass (imf14.hostedemail.com: domain of bijan311@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=bijan311@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750190093; 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=Z8X5Ja/e/pqiuPJdST6phpTFMTSJg44mlfySHdQTIHE=; b=fZj7c8ilqyqMDONTk2lKMHUiKTnRFM4eD0eNmoYI4AXZiXpU4NBgvrF5kNHYt8WL5rlgpi u4CvF687HKqUegU/IkoUnbwWjpiyLac18ZKF8p0QiNBgG+DZDmrT6zxMjpqK06Rx53sQrL 9H9nUxIIT/yixCWqcIIKzpzuTi+wKj4= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IZP3MDmf; spf=pass (imf14.hostedemail.com: domain of bijan311@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=bijan311@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750190093; a=rsa-sha256; cv=none; b=l8OhMU+8rrJbu/z6f0eTGhYGjhLznIExUAhvpnq+kaIGfdj6mY0ALw5jfgdHQM6jKBrMlW 081xMaX632ctmoWQTcphC5plyazgxcHcqg4mPkbk5XeuSXBVJYn4vXB5JxFgRmMzIFijWi B5LGf8uXLzjJ+tYm7qk7X1Ui5i3zscg= Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-adf3b33f968so7458166b.0 for ; Tue, 17 Jun 2025 12:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750190091; x=1750794891; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Z8X5Ja/e/pqiuPJdST6phpTFMTSJg44mlfySHdQTIHE=; b=IZP3MDmfTZynpfOfHPu1gD5JmzMPBm+D3UbJV2g7RxXX5U5gvk5ZMRqVfU2BhUnpjy BR/qfW+0r5WNpIjJ95MsNPDwIK0A4h16Te2vNgJnnl6BiH5zfMjudfnqE3zjSCffP8PY Gv5E4ZmPNA5JzvFez7fu+XnQicj5Puv1c5HFwZLhlp1X5yIAUj4FqDUXO7Vy7KHoIk0z ffbBqFMBrDhmt9iq6ynphrW7mQYFBnXpv1tdC5qTo7tzcMQMrVGlCToyR2F+gB0yDwUC tzVvXuLoVH0/wPFW0P0c/Y25YGUWbETumkKy7Hvp2YhqfcgfLBK7tK7KKbECPdVhIK/5 SK8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750190091; x=1750794891; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z8X5Ja/e/pqiuPJdST6phpTFMTSJg44mlfySHdQTIHE=; b=DOVerKZSjBmdVXC5OLDvoXor8jtnSID8WiPKLUhM8Ku/j5bnLL7U1wscZJJSqu6EEm c6A1paBGh3G6535sw3p+6ZDgiVfMgkYmmLRIO7LMelicl8q0Pvah6lFjG9MTYp1+EEwQ 8guGgLuL6+t3Vwj9SO9D2tXyRYY0N4pPfddjLvPB+z7pOY8nu3PHLMeCOTNgLkRxnO0m rRtsIM0HwZzts23AAtxkOcD7g29beRE4lTnqoeP0rNBOuO6Jws+fW6x1ixgeGyS+3LtY 4UOCOUUDWPVHh5BPoiXs2HTJVSJiTuLFmSmnS/p/6k2tVZVDcWDerfbbvFFDCeqRvTwN vhog== X-Forwarded-Encrypted: i=1; AJvYcCVf8dtDc2VqEBwgY/KihCf9Ann/90ZA2tjzF+uwsxvdZQ/EBY305/hz4HNYxnMP05o2vTwU0b1uXQ==@kvack.org X-Gm-Message-State: AOJu0YxBomNSsN693wy5I7zx7uWqhmqaDFNnqMvUJ6bj6TsIG0r4VqqT uqYpJOQca7lTHvQYjYry4459DQvyvwEQwFAxggfoHdN8t/VhuFrbIFf5WT8QQ2FpTVRZ68VsaZU aH/qf2Mmhgc9CbJLARsnShoDUX+mZ91A= X-Gm-Gg: ASbGncsmYrLjKbMMuJxcUUWIjqNhZudiU8LAG/cZghFb9equmcPYynFq+yzlPwZnLq+ B0GlhOQexK+1TJhV/G3mXY9KXPxg+he/3QFE6jSgICD5wwgkYXsgyrBzGIQVDV1ysZmdA4c58B8 W2A9Uy7LT/xpS4JkiTdeYKGDzO+upffliOO98kjxG+FtseioqMSLdu5eRMtLTPPgbL8c+vzmMm1 pBqhg== X-Google-Smtp-Source: AGHT+IE8e79lXnYS2MEWhgyzWvzB+JeRzaYD17D8Gyd7qKRDrq3kqUlcKtRYC/AYY3nnyTbqfzHmUGafLodcxJ+tGmA= X-Received: by 2002:a17:907:97ca:b0:add:f68c:5200 with SMTP id a640c23a62f3a-adf9bfdc8fcmr1493396266b.6.1750190090999; Tue, 17 Jun 2025 12:54:50 -0700 (PDT) MIME-Version: 1.0 References: <20250617185834.58000-1-sj@kernel.org> In-Reply-To: <20250617185834.58000-1-sj@kernel.org> From: Bijan Tabatabai Date: Tue, 17 Jun 2025 14:54:39 -0500 X-Gm-Features: AX0GCFsNgriV0sYFpbxGGJwvblVxYmQtu1tLr-OLt3N9F1vqCPvhgnz7IQ30TGI Message-ID: Subject: Re: [RFC PATCH 1/4] mm/mempolicy: Expose policy_nodemask() in include/linux/mempolicy.h To: SeongJae Park Cc: Gregory Price , David Hildenbrand , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, corbet@lwn.net, ziy@nvidia.com, matthew.brost@intel.com, joshua.hahnjy@gmail.com, rakie.kim@sk.com, byungchul@sk.com, ying.huang@linux.alibaba.com, apopple@nvidia.com, bijantabatab@micron.com, venkataravis@micron.com, emirakhur@micron.com, ajayjoshi@micron.com, vtavarespetr@micron.com, damon@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: DB11D100007 X-Stat-Signature: xjop9fgbnc898fi1z4s7fscm1be6azsm X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-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etFri2F3eo2uumIdcFinOxmMJdBqZxb3csrMTv4NaM8SSBFyB9sByrlBEm0nYoBUtpx7+Wu9H8Jt2XLX6CsCBOF4v/3T0hK96an7VoaSZGtaq3ns/+ZD8kAPcMz3DtcLhEcKWcODf4y0XWOm4wGbTcOHCaDoOitnXYcZIyLjGbFqA9faHpZsew8dhOw+/mZipt8t+3rJzMAq7hMlVFhYufke5ZRRFo4poFTbZkTcV8kAJFCKPKjHVOWDgrGIcb8lcPBSVEiZ1Rt+GhlzvX2WRVcwF7v1YoRnL2soD5nsWrZNBIO1wkVa39lw2mHfY2voiQi7PJiiMEaXhvmpnitpOz7bnuQKgwiD8h+Wzmjv3bVYfArM2ab87U7QHTlBX5ovqK11xMrPmBBLi5n1aZHK1abz3K243PzjPOq6eCxilOsIfkYbSCVwMXIoZSOONvHK1D 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 Tue, Jun 17, 2025 at 1:58=E2=80=AFPM SeongJae Park wrote= : > > On Mon, 16 Jun 2025 17:16:16 -0500 Bijan Tabatabai w= rote: > > > Hi Gregory, > > > > On Mon, Jun 16, 2025 at 12:43=E2=80=AFPM Gregory Price wrote: > > > > > > On Mon, Jun 16, 2025 at 09:16:55AM -0500, Bijan Tabatabai wrote: > [...] > > > I will just say that mempolicy is *extremely* current-task centric - = and > > > very much allocation-time centric (i.e. the internal workings don't > > > really want to consider migration all that much). You'll probably fi= nd > > > that this project requires rethinking mempolicy's external interfaces= in > > > general (which is sorely needed anyway). > > > > > > I think this path to modifying mempolicy to support DAMON is a bit > > > ambitious for where mempolicy is at the moment. You may be better off > > > duplicating the interleave-weight logic and making some helper functi= ons > > > to get the weight data, and then coming back around to generalize it > > > later. > > Thank you for the nice clarification and opinion, Gregory. > > > > > This may be true, but I think I will be able to avoid a lot of this > > nastiness with what I need. I am going to try with the mempolicy > > approach for the next revision, but if I get too much resistance, I > > will probably switch to this approach. > > I have no strong opinion about use of mempolicy for now, as long as mempo= licy > folks are fine. > > Nonetheless, I just wanted to mention Gregory's suggestion also sounds fa= irly > good to me. It would avoid unnecessary coupling of the concepts of > allocation-time interleaving and after-allocation migration. Also it fee= ls > even more aligned with a potential future extension of this project that = we > discussed[1]: letting users set multiple target nodes for > DAMOS_MIGRATE_{HOT,COLD} with arbitrary weights. > > [1] https://lore.kernel.org/20250613171237.44776-1-sj@kernel.org Given this discussion, as well as Joshua's comments earlier [1], it sounds like while people aren't exactly opposed to using mempolicy for this, the building consensus is that it would be best not to. I will move the interleave logic to DAMON for the next revision. However, I still think it makes sense to use the global weights (probably via get_il_weight) for now to avoid allocating pages a certain way and then migrating them soon after. I'll try to send the next version of the patch set by the end of the week. Thanks everyone for their feedback, Bijan [1] https://lore.kernel.org/linux-mm/20250613152517.225529-1-joshua.hahnjy@= gmail.com/ [...]