linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: tzm <tcm1030@163.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	 Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [PATCH] mm/mempolicy: failed to disable numa balancing
Date: Sun, 4 Dec 2022 15:58:46 -0700	[thread overview]
Message-ID: <CAOUHufZaL2S6Aa1ey3Mk+h+bGr2Tbg_LxOkjbuj87psukPe-gQ@mail.gmail.com> (raw)
In-Reply-To: <20221202115954.a226f8ef3051266d04caff54@linux-foundation.org>

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.


  parent reply	other threads:[~2022-12-04 22:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221202141630.41220-1-tcm1030@163.com>
2022-12-02 19:59 ` Andrew Morton
2022-12-03  3:44   ` Mina Almasry
2022-12-04 22:58   ` Yu Zhao [this message]
2022-12-16 10:46   ` Mel Gorman

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=CAOUHufZaL2S6Aa1ey3Mk+h+bGr2Tbg_LxOkjbuj87psukPe-gQ@mail.gmail.com \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=tcm1030@163.com \
    /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