linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Huang, Ying" <ying.huang@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	 Tvrtko Ursulin <tursulin@igalia.com>,
	 linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	kernel-dev@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 17:32:12 +0800	[thread overview]
Message-ID: <87y16po1k3.fsf@yhuang6-desk2.ccr.corp.intel.com> (raw)
In-Reply-To: <22e9cd24-1ed4-4f1d-b7de-b44cefca6009@igalia.com> (Tvrtko Ursulin's message of "Fri, 28 Jun 2024 09:56:05 +0100")

Tvrtko Ursulin <tvrtko.ursulin@igalia.com> writes:

> On 28/06/2024 04:12, Huang, Ying wrote:
>> 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!
>
> Sigh, my apologies. I was sure I tested it as this patch was part of a
> larger series I have, but then I decided to extract it and send out
> and the problems obviously go deeper. What I think happened is that I
> probably only tested the other direction, setting of via
> mpol_parse_str().
>
> Andrew please dequeue it if you haven't already?
>
>> 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.
>
> Will you work on this or I can follow up if you want?

Please go forward to work on this, Thanks!

--
Best Regards,
Huang, Ying


      reply	other threads:[~2024-06-28  9:34 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
2024-06-28  8:56     ` Tvrtko Ursulin
2024-06-28  9:32       ` Huang, Ying [this message]

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=87y16po1k3.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