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 E96DBC433EF for ; Fri, 8 Apr 2022 08:09:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 371F96B0071; Fri, 8 Apr 2022 04:09:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 320D76B0072; Fri, 8 Apr 2022 04:09:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1EA696B0074; Fri, 8 Apr 2022 04:09:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 0FDE46B0071 for ; Fri, 8 Apr 2022 04:09:56 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id CF375253EC for ; Fri, 8 Apr 2022 08:09:55 +0000 (UTC) X-FDA: 79332988350.20.BE3007C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 24F3720006 for ; Fri, 8 Apr 2022 08:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649405394; h=from:from: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; bh=CcXrNeqe2d679/7T/cumgD1+iQFM+QhH/5xePXKMtL8=; b=VeTHD/vX+OO2bqFaYWp5Rgbta2ijL1HzaL9qw0wqEENvnz5WSD+CNa3UUNSJQANRI8q5aN 6LZ1a2KCn06rx9zZxNAU/2y+ePcb8R3tgwyb5TPsmbYgQiKW+VmijZ8AgXF/C/JWbPaTJm I/rn5bRNF1rHgE7g1I37iBouumGGxOw= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-653-mxqY_hS9PsS7hyI484EVWQ-1; Fri, 08 Apr 2022 04:09:53 -0400 X-MC-Unique: mxqY_hS9PsS7hyI484EVWQ-1 Received: by mail-wr1-f71.google.com with SMTP id 65-20020adf8147000000b00207982c3692so175661wrm.15 for ; Fri, 08 Apr 2022 01:09:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=CcXrNeqe2d679/7T/cumgD1+iQFM+QhH/5xePXKMtL8=; b=eStcWXt6auBAgggc0ip/qwKRtbxQanQNHDCFLE/nVIsgHkuYMGAomhtoQVFoeycUVy rrYBMEcYsK3MAr52WOh7tyNWC/qbsUb80dd5xTaf/zfZQ959QId32CTX7JVqEEmWNinq GJdL0Os8kjXP6PIEiA0a/3DY0Wg7M9FZWwS5eCGJQW4zUXIjH/ZLCRAGDt5pPcaMYoMG L1vAqMht3XLA7AQrJnn+vt2Q1Gwn246PkXKFnSiFd6M17F5FzZtJT6MmEF3FSRw0a4i+ 1Y02+C/S6iFJOpyZ6OGxarvHLq++5y1vp2ct4qkztD4aUJqlOMmcj7L01WMKuGdA9lDh QrIQ== X-Gm-Message-State: AOAM533HdSCc9HEligAFXXq10QLERVlp+TqeqmLElT9YxXYEuJRExOvu FurKTtek4Sp7z5yVhk+Dd8AXa9xqVIf6UsX2w/E5Od5vXJ8o+Rqmnqp0snrHCKxYeWe+m/VE5vY 9N/rm7cvuA/k= X-Received: by 2002:adf:ed46:0:b0:207:9938:459a with SMTP id u6-20020adfed46000000b002079938459amr890168wro.616.1649405390191; Fri, 08 Apr 2022 01:09:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvB9pEimcRrXWKvS4O9/AWFcyaz+lDKYZYfFrx7zCPwp5QZLZjiBdf5xuIYfBYgzayBNRh2A== X-Received: by 2002:adf:ed46:0:b0:207:9938:459a with SMTP id u6-20020adfed46000000b002079938459amr890153wro.616.1649405389985; Fri, 08 Apr 2022 01:09:49 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:fd00:612:f12b:a4a2:26b0? (p200300cbc704fd000612f12ba4a226b0.dip0.t-ipconnect.de. [2003:cb:c704:fd00:612:f12b:a4a2:26b0]) by smtp.gmail.com with ESMTPSA id s12-20020a7bc38c000000b0038e708d163dsm7743752wmj.0.2022.04.08.01.09.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 01:09:49 -0700 (PDT) Message-ID: Date: Fri, 8 Apr 2022 10:09:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [Patch v2 2/2] mm/page_alloc: not necessary to multiply MAX_NODE_LOAD To: Wei Yang , akpm@linux-foundation.org Cc: linux-mm@kvack.org, Vlastimil Babka , Oscar Salvador References: <20220408025947.1619-1-richard.weiyang@gmail.com> <20220408025947.1619-2-richard.weiyang@gmail.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220408025947.1619-2-richard.weiyang@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 24F3720006 X-Stat-Signature: 8tpw79hq53yhr1i9a8ijjoam9x1inxr1 Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="VeTHD/vX"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf03.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-Rspam-User: X-HE-Tag: 1649405394-890846 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 08.04.22 04:59, Wei Yang wrote: > Since we just increase a constance of 1 to node penalty, it is not > necessary to multiply MAX_NODE_LOAD for preference. > > This patch also remove the definition. > > [vbabka@suse.cz: suggests] > > Signed-off-by: Wei Yang > CC: Vlastimil Babka > CC: David Hildenbrand > CC: Oscar Salvador > --- > mm/page_alloc.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 86b6573fbeb5..ca6a127bbc26 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -6170,7 +6170,6 @@ int numa_zonelist_order_handler(struct ctl_table *table, int write, > } > > > -#define MAX_NODE_LOAD (nr_online_nodes) > static int node_load[MAX_NUMNODES]; > > /** > @@ -6217,7 +6216,7 @@ int find_next_best_node(int node, nodemask_t *used_node_mask) > val += PENALTY_FOR_NODE_WITH_CPUS; > > /* Slight preference for less loaded node */ > - val *= (MAX_NODE_LOAD*MAX_NUMNODES); > + val *= MAX_NUMNODES; > val += node_load[n]; > > if (val < min_val) { I feel like this should be squashed into the previous patch. It has the same effect of making this code independent of nr_online_nodes. And I had to scratch my head a couple of times in patch #1 why the change in patch #1 is fine with thus remaining in place. Having that said, I consider this code highly unnecessary over-complicated at first sight. Removing some of the magic most certainly is very welcome. This semantics of the global variable node_load[] remains mostly mysterious for me. -- Thanks, David / dhildenb