From patchwork Fri Apr 8 02:59:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 12806003 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 39A2FC433FE for ; Fri, 8 Apr 2022 03:00:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 606356B0075; Thu, 7 Apr 2022 23:00:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 58EBB6B0078; Thu, 7 Apr 2022 23:00:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E27C6B007B; Thu, 7 Apr 2022 23:00:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 2C05A6B0075 for ; Thu, 7 Apr 2022 23:00:03 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0A06C252CD for ; Fri, 8 Apr 2022 03:00:03 +0000 (UTC) X-FDA: 79332207486.17.7D9BC10 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf04.hostedemail.com (Postfix) with ESMTP id 93E1340003 for ; Fri, 8 Apr 2022 03:00:02 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id a6so14742736ejk.0 for ; Thu, 07 Apr 2022 20:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rCTPfR0OsCsGAkSWFHouXjLvgPdOS7sgJyO6BmIJ4Pg=; b=XMuzkKYUoByxZeSidIXqpc4zA/xLCXuzcpiLfzbJSmKsRJAzP9Mmvf7ayiBrJ5bnhY VxT9cfTcOBeUqERcnaXIWUo5GCXf1ZbghwuFHUWPGxRpYpTmBx0VeIil+oIWcGNb06Lh ez6qcUJHi/SxxbipPbB84bmaQDSPtmT8PEm0DYs3hoTq69TQTFgIFk9pbfVHCt2x9A/X LG/L6lmHDA14p4yo45p/7z3g5kCyU3kkEK88Gc+GlsgnRwU9TNSbmN2LM9x5Guk99N4K 3fIa/zSAGs69hsC6Pa8ZkqJXHdbStNDfgBNGybvGCbP35VbGpLrBdPaHeApKHkaz6cT5 OVlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rCTPfR0OsCsGAkSWFHouXjLvgPdOS7sgJyO6BmIJ4Pg=; b=Xp98aTUWPFlDiDJEULhNdWuyyRIur71F7aDHFEXNrqYPXs8ZRRrtoerRkEaV7VOG9w y+AtmZuvAectcG3ssayE0GIo6da4vE6G4Sb9d1ZhmYaCFurqCFq2Rmwq+qO223g9TMZa Ms1sTp+jIzi8olhylcitKh5IU53k39vxjOzUc0pXa/an8wFBV8yIXHfOZpfnHzaC2n5G ++FL60a01GX6u1339b9LRg5tedyqUnP43enDgFIMLJLs7xfL2su0Z6Sd/ULN/4ya25BK EAIev2ASCzPYjwiZdqGIRwuPmvbGc0tVxMfNhAYKQYnE4JJfxJyWnH02xGw02E1Dzja0 Eqiw== X-Gm-Message-State: AOAM5310nokzMz7iNxpT35OixWr4HlZnf63mz7pNpFvubyVkWb/EDDah YGsdwPTres//aFxeWK5ICKI= X-Google-Smtp-Source: ABdhPJy/N4UaMWp9pv0XblqzTTIr9i7Ly8oNAkoR+WPJd8S7fclYBViezdsHEXeD7C3Y2Nw0i1wnzQ== X-Received: by 2002:a17:906:1c07:b0:6e8:2f2c:6b24 with SMTP id k7-20020a1709061c0700b006e82f2c6b24mr6927102ejg.660.1649386801353; Thu, 07 Apr 2022 20:00:01 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id k14-20020a50e18e000000b0041b6f23f7f6sm10008086edl.22.2022.04.07.20.00.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Apr 2022 20:00:01 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang , Vlastimil Babka , David Hildenbrand , Oscar Salvador Subject: [Patch v2 2/2] mm/page_alloc: not necessary to multiply MAX_NODE_LOAD Date: Fri, 8 Apr 2022 02:59:47 +0000 Message-Id: <20220408025947.1619-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20220408025947.1619-1-richard.weiyang@gmail.com> References: <20220408025947.1619-1-richard.weiyang@gmail.com> X-Stat-Signature: 57xofptiku88gon7bxpo6zdojzir5rpj Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=XMuzkKYU; spf=pass (imf04.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 93E1340003 X-HE-Tag: 1649386802-586480 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: 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) {