linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Huang, Ying" <ying.huang@intel.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Tvrtko Ursulin <tursulin@igalia.com>,
	 linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	 kernel-dev@igalia.com,
	 Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
	 Mel Gorman <mgorman@suse.de>,
	 Peter Zijlstra <peterz@infradead.org>,
	 Ingo Molnar <mingo@redhat.com>,  Rik van Riel <riel@surriel.com>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	 Dave Hansen <dave.hansen@intel.com>,
	 Andi Kleen <ak@linux.intel.com>,  Michal Hocko <mhocko@suse.com>,
	 David Rientjes <rientjes@google.com>
Subject: Re: [PATCH] mm/numa_balancing: Teach mpol_to_str about the balancing mode
Date: Fri, 28 Jun 2024 11:12:42 +0800	[thread overview]
Message-ID: <87bk3lpxp1.fsf@yhuang6-desk2.ccr.corp.intel.com> (raw)
In-Reply-To: <Zn3eBbJ377VeZGcc@casper.infradead.org> (Matthew Wilcox's message of "Thu, 27 Jun 2024 22:47:49 +0100")

Hi, Matthew,

Matthew Wilcox <willy@infradead.org> writes:

> On Tue, Jun 25, 2024 at 02:26:05PM +0100, Tvrtko Ursulin wrote:
>>  		/*
>> -		 * Currently, the only defined flags are mutually exclusive
>> +		 * The below two flags are mutually exclusive:
>>  		 */
>>  		if (flags & MPOL_F_STATIC_NODES)
>>  			p += snprintf(p, buffer + maxlen - p, "static");
>>  		else if (flags & MPOL_F_RELATIVE_NODES)
>>  			p += snprintf(p, buffer + maxlen - p, "relative");
>> +
>> +		if (flags & MPOL_F_NUMA_BALANCING)
>> +			p += snprintf(p, buffer + maxlen - p, "balancing");
>>  	}
>
> So if MPOL_F_STATIC_NODES and MPOL_F_NUMA_BALANCING are set, then we
> get a string "staticbalancing"?  Is that intended?
>
> Or are these three all mutually exclusive and that should have been
> as "else if"?

Yes, this is an issue!

Dig the git history, in commit 2291990ab36b ("mempolicy: clean-up
mpol-to-str() mempolicy formatting"), the support for multiple flags are
removed.  I think that we need to restore it.

Done some basic testing.  It was found that when MPOL_F_NUMA_BALANCING
is set, /proc/PID/numa_maps always display "default".  That is wrong.

This make me think that this patch has never been tested!

The "default" displaying is introduced in commit 8790c71a18e5
("mm/mempolicy.c: fix mempolicy printing in numa_maps").  We need to fix
it firstly for MPOL_F_NUMA_BALANCING with more accurate filtering.  The
fix needs to be backported to -stable kernel.

--
Best Regards,
Huang, Ying


  reply	other threads:[~2024-06-28  3:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 13:26 Tvrtko Ursulin
2024-06-26  8:48 ` Huang, Ying
2024-06-26 11:51   ` Tvrtko Ursulin
2024-06-27  3:04     ` Huang, Ying
2024-06-27 21:37 ` Andrew Morton
2024-06-28  9:03   ` Tvrtko Ursulin
2024-06-27 21:47 ` Matthew Wilcox
2024-06-28  3:12   ` Huang, Ying [this message]
2024-06-28  8:56     ` Tvrtko Ursulin
2024-06-28  9:32       ` Huang, Ying

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=87bk3lpxp1.fsf@yhuang6-desk2.ccr.corp.intel.com \
    --to=ying.huang@intel.com \
    --cc=ak@linux.intel.com \
    --cc=dave.hansen@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.com \
    --cc=rientjes@google.com \
    --cc=tursulin@igalia.com \
    --cc=tvrtko.ursulin@igalia.com \
    --cc=willy@infradead.org \
    /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