From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78B57C4332F for ; Fri, 2 Dec 2022 20:00:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 745806B0071; Fri, 2 Dec 2022 15:00:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F4FC6B0072; Fri, 2 Dec 2022 15:00:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BC3F6B0078; Fri, 2 Dec 2022 15:00:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 473B76B0071 for ; Fri, 2 Dec 2022 15:00:01 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C713380CC8 for ; Fri, 2 Dec 2022 20:00:00 +0000 (UTC) X-FDA: 80198432160.20.65E09B4 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf03.hostedemail.com (Postfix) with ESMTP id 1FBB920013 for ; Fri, 2 Dec 2022 19:59:58 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=XFBleSmo; spf=pass (imf03.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670011199; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aDWPoym21V3L2pdOS0GvV8MCuFkla4Aq3hknUMU1YmA=; b=JBOcQLNLnHiyuAJL4I1kfs3wpO8ZyxQPJuEabv3JVHPN0UcyI8T9I2dHKb9DOKZieHD5Jh xBTjByhy0k+9o3NJFS9KFQn9MAXPxTPvA2g48tMoUCQ/CVz0meecPLQNVD9wo/LNcO9NvZ MLWGx6cfAuItcjZjgfdiCDWlW/5Mw6o= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=XFBleSmo; spf=pass (imf03.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670011199; a=rsa-sha256; cv=none; b=j5UppkqgLSKZzqvgmyjWT3BJ9IZfPdYK/mZ4PeK45PPz86NmMYgufC+JriTEwdiG4EUGYp YRCiGxEvcuymHQTovnLPHBiQ3TK8l634wWAc7BM3zcJIrESRWlWSuY2xWwpUU9EjWW4hwp 3tLy+pZJm1gpcpxNofl92wOzHi6DkqY= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ED706B8226A; Fri, 2 Dec 2022 19:59:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88235C433C1; Fri, 2 Dec 2022 19:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1670011195; bh=TX0AQoDfjQ4ZbnVcTd0C+6HAmwMewsTbT3BnxuxMcCM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XFBleSmod6qXnyGd6Aj1/6zXkp3J+l41YJOFvtwsh2/dGobsQwYdqAFno/AR0QQfZ z4QIsbuNwHWGFH0ehg+EY6xxvi0XRrt1arjLXPtnF3Wa+h1YY/DM3VhLITdEY8YVik 1uzHOpGSb1IfZp84aWej9hC2a9KGayNm+2xBoh8M= Date: Fri, 2 Dec 2022 11:59:54 -0800 From: Andrew Morton To: tzm Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mel Gorman Subject: Re: [PATCH] mm/mempolicy: failed to disable numa balancing Message-Id: <20221202115954.a226f8ef3051266d04caff54@linux-foundation.org> In-Reply-To: <20221202141630.41220-1-tcm1030@163.com> References: <20221202141630.41220-1-tcm1030@163.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 1FBB920013 X-Stat-Signature: 3k1cpy4hxznubn63kybh18kd3xahbuwo X-Rspam-User: X-Spamd-Result: default: False [7.59 / 9.00]; TC_DBL_BL_100(5.00)[163.com:email]; IRL_BL_25(2.00)[52.25.139.140:received]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; BAD_REP_POLICIES(0.10)[]; BAYES_HAM(-0.01)[42.51%]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[linux-foundation.org:+]; RCVD_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[linux-foundation.org]; MID_RHS_MATCH_FROM(0.00)[]; R_DKIM_ALLOW(0.00)[linux-foundation.org:s=korg]; ARC_NA(0.00)[]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(0.00)[+a:ams.source.kernel.org]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Server: rspam08 X-HE-Tag: 1670011198-316970 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 2 Dec 2022 22:16:30 +0800 tzm wrote: > It will be failed to disable numa balancing policy permanently by passing > 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. 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.