linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit"
@ 2024-12-27  9:57 Honggyu Kim
  2024-12-27 15:37 ` Gregory Price
  2024-12-30  1:22 ` Hyeonggon Yoo
  0 siblings, 2 replies; 4+ messages in thread
From: Honggyu Kim @ 2024-12-27  9:57 UTC (permalink / raw)
  To: Gregory Price
  Cc: linux-mm, linux-kernel, kernel_team, Honggyu Kim, Andi Kleen

The fa3bea4e1f82 introduced MPOL_WEIGHTED_INTERLEAVE but it missed
adding its counter to "interleave_hit" of numastat, which is located at
/sys/devices/system/node/nodeN/ directory.

It'd be better to add weighted interleving counter info to the existing
"interleave_hit" instead of introducing a new counter
"weighted_interleave_hit".

Fixes: fa3bea4e1f82 ("mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving")
Cc: Gregory Price <gourry@gourry.net>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
---
 mm/mempolicy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 04f35659717a..162407fbf2bc 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2268,7 +2268,8 @@ struct page *alloc_pages_mpol_noprof(gfp_t gfp, unsigned int order,
 
 	page = __alloc_pages_noprof(gfp, order, nid, nodemask);
 
-	if (unlikely(pol->mode == MPOL_INTERLEAVE) && page) {
+	if (unlikely(pol->mode == MPOL_INTERLEAVE ||
+		     pol->mode == MPOL_WEIGHTED_INTERLEAVE) && page) {
 		/* skip NUMA_INTERLEAVE_HIT update if numa stats is disabled */
 		if (static_branch_likely(&vm_numa_stat_key) &&
 		    page_to_nid(page) == nid) {

base-commit: 4bbf9020becbfd8fc2c3da790855b7042fad455b
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit"
  2024-12-27  9:57 [PATCH] mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit" Honggyu Kim
@ 2024-12-27 15:37 ` Gregory Price
  2024-12-30  1:22 ` Hyeonggon Yoo
  1 sibling, 0 replies; 4+ messages in thread
From: Gregory Price @ 2024-12-27 15:37 UTC (permalink / raw)
  To: Honggyu Kim
  Cc: Gregory Price, linux-mm, linux-kernel, kernel_team, Andi Kleen

On Fri, Dec 27, 2024 at 06:57:37PM +0900, Honggyu Kim wrote:
> The fa3bea4e1f82 introduced MPOL_WEIGHTED_INTERLEAVE but it missed
> adding its counter to "interleave_hit" of numastat, which is located at
> /sys/devices/system/node/nodeN/ directory.
> 
> It'd be better to add weighted interleving counter info to the existing
> "interleave_hit" instead of introducing a new counter
> "weighted_interleave_hit".
> 
> Fixes: fa3bea4e1f82 ("mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving")
> Cc: Gregory Price <gourry@gourry.net>
> Cc: Andi Kleen <ak@linux.intel.com>
> Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
> ---
>  mm/mempolicy.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Reviewed-by: Gregory Price <gourry@gourry.net>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit"
  2024-12-27  9:57 [PATCH] mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit" Honggyu Kim
  2024-12-27 15:37 ` Gregory Price
@ 2024-12-30  1:22 ` Hyeonggon Yoo
  2024-12-31  3:08   ` Honggyu Kim
  1 sibling, 1 reply; 4+ messages in thread
From: Hyeonggon Yoo @ 2024-12-30  1:22 UTC (permalink / raw)
  To: Honggyu Kim, Gregory Price
  Cc: kernel_team, 42.hyeyoo, linux-mm, linux-kernel, Andi Kleen,
	Andrew Morton, Yunjeong Mun



On 2024-12-27 6:57 AM, Honggyu Kim wrote:
> The fa3bea4e1f82 introduced MPOL_WEIGHTED_INTERLEAVE but it missed
> adding its counter to "interleave_hit" of numastat, which is located at
> /sys/devices/system/node/nodeN/ directory.
> 
> It'd be better to add weighted interleving counter info to the existing
> "interleave_hit" instead of introducing a new counter
> "weighted_interleave_hit".
> 
> Fixes: fa3bea4e1f82 ("mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving")
> Cc: Gregory Price <gourry@gourry.net>
> Cc: Andi Kleen <ak@linux.intel.com>
> Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
> ---
>   mm/mempolicy.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 04f35659717a..162407fbf2bc 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -2268,7 +2268,8 @@ struct page *alloc_pages_mpol_noprof(gfp_t gfp, unsigned int order,
>   
>   	page = __alloc_pages_noprof(gfp, order, nid, nodemask);
>   
> -	if (unlikely(pol->mode == MPOL_INTERLEAVE) && page) {
> +	if (unlikely(pol->mode == MPOL_INTERLEAVE ||
> +		     pol->mode == MPOL_WEIGHTED_INTERLEAVE) && page) {
>   		/* skip NUMA_INTERLEAVE_HIT update if numa stats is disabled */
>   		if (static_branch_likely(&vm_numa_stat_key) &&
>   		    page_to_nid(page) == nid) {
> 
> base-commit: 4bbf9020becbfd8fc2c3da790855b7042fad455b

[+Cc Andrew]

Looks good to me,
Reviewed-by: Hyeonggon Yoo <hyeonggon.yoo@sk.com>

We discovered that interleave_hit is not correctly accounted
while testing MPOL_WEIGHTED_INTERLEAVE on libnuma and this patch
fixes the issue.

Tested-by: Yunjeong Mun <yunjeong.mun@sk.com>

For reference:
https://github.com/numactl/numactl/pull/238#issuecomment-2563532910

--
Hyeonggon


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit"
  2024-12-30  1:22 ` Hyeonggon Yoo
@ 2024-12-31  3:08   ` Honggyu Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Honggyu Kim @ 2024-12-31  3:08 UTC (permalink / raw)
  To: Andrew Morton
  Cc: kernel_team, 42.hyeyoo, linux-mm, linux-kernel, Hyeonggon Yoo,
	Yunjeong Mun, Gregory Price, Andi Kleen

On Mon, 30 Dec 2024 10:22:24 +0900 Hyeonggon Yoo <hyeonggon.yoo@sk.com> wrote:
> 
> 
> On 2024-12-27 6:57 AM, Honggyu Kim wrote:
> > The fa3bea4e1f82 introduced MPOL_WEIGHTED_INTERLEAVE but it missed
> > adding its counter to "interleave_hit" of numastat, which is located at
> > /sys/devices/system/node/nodeN/ directory.
> > 
> > It'd be better to add weighted interleving counter info to the existing
> > "interleave_hit" instead of introducing a new counter
> > "weighted_interleave_hit".
> > 
> > Fixes: fa3bea4e1f82 ("mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving")
> > Cc: Gregory Price <gourry@gourry.net>
> > Cc: Andi Kleen <ak@linux.intel.com>
> > Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
> > ---
> >   mm/mempolicy.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> > index 04f35659717a..162407fbf2bc 100644
> > --- a/mm/mempolicy.c
> > +++ b/mm/mempolicy.c
> > @@ -2268,7 +2268,8 @@ struct page *alloc_pages_mpol_noprof(gfp_t gfp, unsigned int order,
> >   
> >   	page = __alloc_pages_noprof(gfp, order, nid, nodemask);
> >   
> > -	if (unlikely(pol->mode == MPOL_INTERLEAVE) && page) {
> > +	if (unlikely(pol->mode == MPOL_INTERLEAVE ||
> > +		     pol->mode == MPOL_WEIGHTED_INTERLEAVE) && page) {
> >   		/* skip NUMA_INTERLEAVE_HIT update if numa stats is disabled */
> >   		if (static_branch_likely(&vm_numa_stat_key) &&
> >   		    page_to_nid(page) == nid) {
> > 
> > base-commit: 4bbf9020becbfd8fc2c3da790855b7042fad455b
> 
> [+Cc Andrew]
> 
> Looks good to me,
> Reviewed-by: Hyeonggon Yoo <hyeonggon.yoo@sk.com>
> 
> We discovered that interleave_hit is not correctly accounted
> while testing MPOL_WEIGHTED_INTERLEAVE on libnuma and this patch
> fixes the issue.
> 
> Tested-by: Yunjeong Mun <yunjeong.mun@sk.com>
> 
> For reference:
> https://github.com/numactl/numactl/pull/238#issuecomment-2563532910

Hi Andrew,

I saw this patch has been merged into mm-unstable only with Gregory's
Reviewed-by tag.
https://lore.kernel.org/mm-commits/20241231002913.D5122C4CED0@smtp.kernel.org

But this patch is contributed by Hyeonggon and Yunjeong together for
their review and testing so please add their tags above in the commit
message together.

Thanks,
Honggyu

> --
> Hyeonggon
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-31  3:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-27  9:57 [PATCH] mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit" Honggyu Kim
2024-12-27 15:37 ` Gregory Price
2024-12-30  1:22 ` Hyeonggon Yoo
2024-12-31  3:08   ` Honggyu Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox