Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2644378rwb; Fri, 2 Dec 2022 12:48:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf4BKdziYSTYaxf3UsMG5+vP3LfHPhNrUUpvFDujJipibBUyqYWYZCphia573beZ847cU2V2 X-Received: by 2002:a17:90a:5417:b0:219:7c23:8a32 with SMTP id z23-20020a17090a541700b002197c238a32mr9465896pjh.68.1670014135786; Fri, 02 Dec 2022 12:48:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670014135; cv=none; d=google.com; s=arc-20160816; b=BaxWaoDPBQ4L4Pudd4+m8qsAqlpeT8IkhYWHD0SlgkpRkICOrtYbAOLGgaFwqKV8vb y8WRK+I+zXMxme9h2RwkELaq3I9gBwMgX7tZmvnNbWcif05sY533N4T9Ly6hrJKd2IG/ 5+8F+i9eoG8IWvXz4YKEpB1S7yIlExXJ19LFMt7qyrD36LlISrox2BSP+eQu4Ucx4mHX LKMKekGU7I/iYSKmL7BiwW3/ZMNX1HYXf+ud0c2fKIAt+4mvJzeulA7oukalqLLbyrLe yMQZdGBIMUih1WAAfwRyASkz8t63z6d/iCH2ONLj8nPsmf9VUnpoN1RRKgi8z8FkoGo7 ZQUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=aDWPoym21V3L2pdOS0GvV8MCuFkla4Aq3hknUMU1YmA=; b=LNusDIlnwpYXeqmk7jNvxZ3BD+gdDnQ2AEwiOz8x1KBGfBaIxSshD+s2TRmX9WkmIQ rhsYvpUz8OQ3N+wYnmMnyF6KKeICqjocpMyAj4CzBOI8veO0IzqC9IO8+ehtLrXwIfk1 2iRY7SekZnreuaE1QynZNbfHaFDSccKGejD7tQsXcqM5/QYhOIPSDpDRiRbNWfYJWSdJ SbJfoof2ogCEgVUKi0EpztcD1w9k1It8NaDwDxPaGU5nH5kXUSbfwE5AiDVqShK/4SYO CfYTARWF69GhoVz9TPGkY5o/Ok+TzPlyGLJKARtixNHxFIh/9+OlZSZRuLne6nSIHZUY u7Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=XFBleSmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a056a0022cd00b0056d7aaaf1eesi9240862pfj.122.2022.12.02.12.48.45; Fri, 02 Dec 2022 12:48:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=XFBleSmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229554AbiLBUAA (ORCPT + 82 others); Fri, 2 Dec 2022 15:00:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiLBT77 (ORCPT ); Fri, 2 Dec 2022 14:59:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67C6BDBF77 for ; Fri, 2 Dec 2022 11:59:58 -0800 (PST) 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 17D14B8227D for ; Fri, 2 Dec 2022 19:59:57 +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-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.