Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4601672iog; Wed, 22 Jun 2022 02:03:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vtXz4NhT++koZrSwZy9x8wH5OGSKWytltM5XCEE4stcwMkULpRhhDmlwvoiJLNhT2O//wg X-Received: by 2002:a17:902:8689:b0:14e:f1a4:d894 with SMTP id g9-20020a170902868900b0014ef1a4d894mr33293962plo.65.1655888603473; Wed, 22 Jun 2022 02:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655888603; cv=none; d=google.com; s=arc-20160816; b=ZOwN6BOc79eZ5o/KsB3ZbdhA8K0bNp33rZHf1wo2nko5V98FuhFV+I5fyLKso5fq9R p5Zcj4xH8q3fksC6zElHjHgI10ROfXIaXo7qnt+lXbZOqwAKtVSnwBcXiO99eIr+Rpnt yb4p1p2hPLbs8lfK//6Lql5+eicUmSyOuOlX+jLvpO+fSGM9xsJ1v4pK/ay/tVlDWwtj x0AEx0yl2gpeZxHIwTrEpj8JWNpINeD9rIjgPqbBNZ7tAPLhmpUMf4oP2tZ6Y8y5N1Yy Zai6PKbGBc3DV+oW40/i9ukwE83h1sQ180ViINPGF4t5E2wrIe71Y8KSljudLgnOg3Mj bbCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NPz6aysJ4lKE5JHLkll4+SwUhp9oiQCtyExa/aZASL4=; b=Qumeg7e08ybQgNFcPdtkIu0KXeKaYdkxiZLj+utTCqYU8OEGkxKiwafYb0y3mh8b7M 46M6M4z20FZ9IKGBwuzi5KBmYIRLLyUK5rh1VTUWwQfEYP9tFNk1pR4T1ttQuDaN2r7c ZXNWAnESl2I9ydyISlw5+BISkHHF0VmoKz2nExUSDlij2zgOOVZ6bNo0kMSwhupYUouK TB9aIkv/jIIMn25DCTH2czAYLGIvgV6lxn9LE47tm8x1gZP6LqDMoAqBouX49DN9ABAW 3/y90Lr2CXv094ag3ySX24GuDObkg0IGeYRiiQ16mF1tvId1j7LnA5P4VKMR2PZMFeyy GHLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="t8+Nm/Nm"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a6553c2000000b00403fbc9167bsi10399245pgr.623.2022.06.22.02.02.59; Wed, 22 Jun 2022 02:03:23 -0700 (PDT) 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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="t8+Nm/Nm"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232954AbiFVIyw (ORCPT + 99 others); Wed, 22 Jun 2022 04:54:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbiFVIyv (ORCPT ); Wed, 22 Jun 2022 04:54:51 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2345733E88 for ; Wed, 22 Jun 2022 01:54:50 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id d129so15516181pgc.9 for ; Wed, 22 Jun 2022 01:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NPz6aysJ4lKE5JHLkll4+SwUhp9oiQCtyExa/aZASL4=; b=t8+Nm/Nm3fXHIky43hvB+9u58dnsstVeJtDa1cLpnYXi3KWOTWJz9oC0BVaeFQB+ge mtdYrumXWF5Lr6HmweRlNPE1tDXUKb+tj8tT2BeJoyl4uKUK6fc3JCnCZTD7C87gqKTx GO+0JsZnSnzpyuc+rLCfG1Ek4tUtEWC62rGye6AGP3UvKsyajg8FS7uHZqMc7W90I8ZM hWfWwo1gp9RlFLdW2W3ApzWN9o2kHzFIczO6MzuT8b04PIDl4n9BL6eu7MACppiaA8xk AKZ1UPPELrH8bHYsgRZPJzT8EdtqN5RQ7L7rDPhyq/L2lhtB/eksIqnXQHMKKreH2W2Q jXcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NPz6aysJ4lKE5JHLkll4+SwUhp9oiQCtyExa/aZASL4=; b=Se/fBSCaHJjRUXXLgiJM4xQx7sRfQEl+m8d7tsivIInPEVOGMUHXRQpDQnBI0ctVCg czu1+gbXy0CHvCYQMjRXqJFhLhT+NMqhUebMMo1OX9RHgZg1MUWvU7vp/kXzo0Gxlp89 3Ool4lx5uKYZ67v2GuaIlxWtIj7ILC4JMiQ4yzKenZxrizGJoZql28RNCXewy7hN8+qP f4K/92jG4w1HL251+eczYJZjSDn452xgQR5Xk/GZJwOm5sVwnBYUAypDS2IN3393b/Wl YToKR9nqhQnQLyQ8vAQwL5Y33PlvDOajCIfcl9NaaCJ3HxxzHKqnUK2N9/1AeNMsiSzo lshQ== X-Gm-Message-State: AJIora+D4Jv+Z55l27aTNwfYo+nIGFk+M0zA3CIkYNPsBV95usser4cu u9ayq6lOz0qtQMynZXyuJcHAag== X-Received: by 2002:a05:6a00:1a09:b0:525:a0d:d1d3 with SMTP id g9-20020a056a001a0900b005250a0dd1d3mr21848009pfv.27.1655888089663; Wed, 22 Jun 2022 01:54:49 -0700 (PDT) Received: from localhost ([139.177.225.231]) by smtp.gmail.com with ESMTPSA id f11-20020a170902684b00b00163f3e91ea0sm1641513pln.238.2022.06.22.01.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 01:54:49 -0700 (PDT) Date: Wed, 22 Jun 2022 16:54:46 +0800 From: Muchun Song To: David Hildenbrand Cc: Oscar Salvador , Andrew Morton , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] mm/page_alloc: Do not calculate node's total pages and memmap pages when empty Message-ID: References: <20220621041717.6355-1-osalvador@suse.de> <20220621041717.6355-2-osalvador@suse.de> <506203e3-1de0-1187-5234-7afc66d4ddfe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Wed, Jun 22, 2022 at 10:31:12AM +0200, David Hildenbrand wrote: > On 22.06.22 05:56, Muchun Song wrote: > > On Wed, Jun 22, 2022 at 05:47:22AM +0200, Oscar Salvador wrote: > >> On Tue, Jun 21, 2022 at 09:44:47AM +0200, David Hildenbrand wrote: > >>> > >>> > >>> It's worth noting that the check in pgdat_is_empty() is slightly > >>> different. I *think* it doesn't matter in practice, yet I wonder if we > >>> should simply fixup (currently unused) pgdat_is_empty(). > >> > >> I guess we could change it to > >> > >> static inline bool pgdat_is_empty(pg_data_t *pgdat) > >> { > >> return node_start_pfn(pgdat->node_id) == node_end_pfn(pgdat->node_id) > >> } > >> > >> ? And maybe even rename it to to node_is_empty (not sure why but I tend to like > > > > At least I like this name (node_is_empty) as well. > > > > Let's try keeping it consistent. I think node_is_empty() might indicate > that we're punching in a node id instead of a pgdat. > I suspect Oscar will change the argument to "nid" as well, like: static inline bool node_is_empty(int nid) { return node_start_pfn(nid) == node_end_pfn(nid); } Does this look good? Thanks. > > -- > Thanks, > > David / dhildenb > >