lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 28 Jun 2024 09:56:05 +0100
From: Tvrtko Ursulin <tvrtko.ursulin@...lia.com>
To: "Huang, Ying" <ying.huang@...el.com>, Matthew Wilcox <willy@...radead.org>
Cc: Tvrtko Ursulin <tursulin@...lia.com>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, kernel-dev@...lia.com,
 Mel Gorman <mgorman@...e.de>, Peter Zijlstra <peterz@...radead.org>,
 Ingo Molnar <mingo@...hat.com>, Rik van Riel <riel@...riel.com>,
 Johannes Weiner <hannes@...xchg.org>, Dave Hansen <dave.hansen@...el.com>,
 Andi Kleen <ak@...ux.intel.com>, Michal Hocko <mhocko@...e.com>,
 David Rientjes <rientjes@...gle.com>
Subject: Re: [PATCH] mm/numa_balancing: Teach mpol_to_str about the balancing
 mode


On 28/06/2024 04:12, Huang, Ying wrote:
> Hi, Matthew,
> 
> Matthew Wilcox <willy@...radead.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?

Regards,

Tvrtko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ