From: David Hildenbrand <david@redhat.com>
To: Bijan Tabatabai <bijan311@gmail.com>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Cc: sj@kernel.org, akpm@linux-foundation.org, 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 1/2] mm/mempolicy: Expose get_il_weight() to MM
Date: Mon, 23 Jun 2025 21:14:34 +0200 [thread overview]
Message-ID: <0067568e-a604-46d3-96fd-41b62968a90e@redhat.com> (raw)
In-Reply-To: <20250620180458.5041-2-bijan311@gmail.com>
On 20.06.25 20:04, Bijan Tabatabai wrote:
> From: Bijan Tabatabai <bijantabatab@micron.com>
>
> This patch exposes get_il_weight() in mm/internal.h. This patch is to
> allow other parts of the MM subsystem, such as DAMON, to make page
> placement decisions based on the global interleave weights.
>
> Signed-off-by: Bijan Tabatabai <bijantabatab@micron.com>
> ---
> mm/internal.h | 6 ++++++
> mm/mempolicy.c | 2 +-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index 3823fb356d3b..b718ebe7cad5 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -1169,6 +1169,7 @@ extern int node_reclaim_mode;
>
> extern int node_reclaim(struct pglist_data *, gfp_t, unsigned int);
> extern int find_next_best_node(int node, nodemask_t *used_node_mask);
> +extern u8 get_il_weight(int node);
No new "extern". It's a blast from the past :)
> #else
> #define node_reclaim_mode 0
>
> @@ -1181,6 +1182,11 @@ static inline int find_next_best_node(int node, nodemask_t *used_node_mask)
> {
> return NUMA_NO_NODE;
> }
> +
> +static inline u8 get_il_weight(int node)
> +{
> + return 1;
> +}
> #endif
>
> static inline bool node_reclaim_enabled(void)
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 1ff7b2174eb7..b1713430ee9c 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -165,7 +165,7 @@ static unsigned int *node_bw_table;
> */
> static DEFINE_MUTEX(wi_state_lock);
>
> -static u8 get_il_weight(int node)
> +u8 get_il_weight(int node)
The function name is shockingly confusing when used outside this file.
Do we have some namespace to at least highlight what this is about?
node_interleave_weight() might be a lot clearer?
So maybe let's just rename it to something less confusing as we use it
from other files.
> {
> struct weighted_interleave_state *state;
> u8 weight = 1;
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2025-06-23 19:14 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 18:04 [RFC PATCH v2 0/2] mm/damon/paddr: Allow interleaving in migrate_{hot,cold} actions Bijan Tabatabai
2025-06-20 18:04 ` [RFC PATCH v2 1/2] mm/mempolicy: Expose get_il_weight() to MM Bijan Tabatabai
2025-06-23 19:06 ` Gregory Price
2025-06-23 19:14 ` David Hildenbrand [this message]
2025-06-23 19:38 ` Gregory Price
2025-06-24 10:58 ` Huang, Ying
2025-06-20 18:04 ` [RFC PATCH v2 2/2] mm/damon/paddr: Allow multiple migrate targets Bijan Tabatabai
2025-06-21 18:02 ` SeongJae Park
2025-06-21 18:11 ` SeongJae Park
2025-06-23 14:08 ` Joshua Hahn
2025-06-23 16:50 ` SeongJae Park
2025-06-23 14:27 ` Bijan Tabatabai
2025-06-23 16:52 ` SeongJae Park
2025-06-23 14:16 ` Bijan Tabatabai
2025-06-23 17:52 ` SeongJae Park
2025-06-23 23:15 ` Bijan Tabatabai
2025-06-24 0:34 ` SeongJae Park
2025-06-24 16:01 ` Bijan Tabatabai
2025-06-24 22:33 ` SeongJae Park
2025-06-20 20:21 ` [RFC PATCH v2 0/2] mm/damon/paddr: Allow interleaving in migrate_{hot,cold} actions SeongJae Park
2025-06-20 21:47 ` Bijan Tabatabai
2025-06-20 23:13 ` SeongJae Park
2025-06-21 17:36 ` SeongJae Park
2025-06-23 14:39 ` Bijan Tabatabai
2025-06-23 16:32 ` SeongJae Park
2025-06-23 19:28 ` Gregory Price
2025-06-23 23:21 ` Bijan Tabatabai
2025-06-26 19:13 ` Gregory Price
2025-06-23 13:45 ` Joshua Hahn
2025-06-23 14:57 ` Bijan Tabatabai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0067568e-a604-46d3-96fd-41b62968a90e@redhat.com \
--to=david@redhat.com \
--cc=ajayjoshi@micron.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=bijan311@gmail.com \
--cc=bijantabatab@micron.com \
--cc=byungchul@sk.com \
--cc=damon@lists.linux.dev \
--cc=emirakhur@micron.com \
--cc=gourry@gourry.net \
--cc=joshua.hahnjy@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.com \
--cc=rakie.kim@sk.com \
--cc=sj@kernel.org \
--cc=venkataravis@micron.com \
--cc=vtavarespetr@micron.com \
--cc=ying.huang@linux.alibaba.com \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®