lkml.org 
[lkml]   [2022]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm/mempolicy: failed to disable numa balancing
On Fri, Dec 2, 2022 at 1:00 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Fri, 2 Dec 2022 22:16:30 +0800 tzm <tcm1030@163.com> wrote:
>
> > It will be failed to disable numa balancing policy permanently by passing
> > <numa_balancing=disable> to boot cmdline parameters.
> > The numabalancing_override variable is int and 1 for enable -1 for disable.
> > So, !enumabalancing_override will always be true, which cause this bug.

!enumabalancing_override is false when enumabalancing_override = -1
(numa_balancing=disable).

> That's really old code!
>
> > --- a/mm/mempolicy.c
> > +++ b/mm/mempolicy.c
> > @@ -2865,7 +2865,7 @@ static void __init check_numabalancing_enable(void)
> > if (numabalancing_override)
> > set_numabalancing_state(numabalancing_override == 1);
> >
> > - if (num_online_nodes() > 1 && !numabalancing_override) {
> > + if (num_online_nodes() > 1 && (numabalancing_override == 1)) {
> > pr_info("%s automatic NUMA balancing. Configure with numa_balancing= or the kernel.numa_balancing sysctl\n",
> > numabalancing_default ? "Enabling" : "Disabling");
> > set_numabalancing_state(numabalancing_default);
>
> Looks right to me. Mel?
>
> After eight years, I wonder if we actually need this.

NAK.

The original code works as intended. This patch breaks my test with
CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=n and numa_balancing=enable.

\
 
 \ /
  Last update: 2022-12-05 00:00    [W:0.043 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site