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 36D1AC43334 for ; Wed, 22 Jun 2022 10:49:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E9BF8E00B0; Wed, 22 Jun 2022 06:49:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 571BC8E00AB; Wed, 22 Jun 2022 06:49:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EB208E00B0; Wed, 22 Jun 2022 06:49:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2B54B8E00AB for ; Wed, 22 Jun 2022 06:49:53 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id EF09280E9F for ; Wed, 22 Jun 2022 10:49:52 +0000 (UTC) X-FDA: 79605551466.25.EF476F0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 798814001E for ; Wed, 22 Jun 2022 10:49:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655894977; 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=QchBbQyipF458CAuLWLqnynSF1BJuncWmu+EGU0Vk4U=; b=eLINVa1cIuAn9hcEchQUGcYZbpct4pEgsMTqHn25J8Nm2rq/kOEYBmHx6L+fimxycVVa77 0f5jWwoUVxlZgkj7SdJbiKFZSWZUPfF0fu7zbrp9J1+AGHYmUq12MiO6/tMTHelm57zmrJ rSxXqbDl7+5Sm+d+SEmn+w1mxrxBHEk= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-217-t8572VyHNBGkuPhy2hyk5g-1; Wed, 22 Jun 2022 06:49:34 -0400 X-MC-Unique: t8572VyHNBGkuPhy2hyk5g-1 Received: by mail-wm1-f71.google.com with SMTP id n15-20020a05600c4f8f00b0039c3e76d646so7645388wmq.7 for ; Wed, 22 Jun 2022 03:49:34 -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=QchBbQyipF458CAuLWLqnynSF1BJuncWmu+EGU0Vk4U=; b=4eAN1i6VVRr1S00IfBUBV9p4e5uuzWp5EbDtyDdXKL4H3u2+2otSAB6zw78Ms9cZ25 w9Ws/L5FxXRneoQlAX2mPJba2QAb8nkBytytbP/WlEhd81gJvXkKH90eOo1wVlRSfRVJ Mz2feQC5C6gPfJWhnRuv3wOHRLl0mdIZxvXurPtCVnMKDPaUFUzXDf9URkf1sLcbRLMQ tkdqxxCV54ghICIfnnc/Mt7GpKgnuwjJVkh7l5I1H+Z2n3sWZTq/vWRuvi/B/NlDjU40 M3s02e+WJXm1Heindg8RQmhNXE1syAUG0YWpM8UzwwVhIIbbAKQjMJgJ8Kjnkw8OFonZ gkHg== X-Gm-Message-State: AJIora8nWiAVJyhz6wkby2eyosRBFfDz9shfux4I6ufjdp3bifpb1uDN jAkCefbzc3dgklaV0snNznqcVhWvY7VcSRUc8AMmuWLGUSB4paWxyn+oRBCgTsUiGXfr1T5YsKr jb+91nQ9U47I= X-Received: by 2002:adf:dc50:0:b0:21b:874e:e76a with SMTP id m16-20020adfdc50000000b0021b874ee76amr2733890wrj.169.1655894973253; Wed, 22 Jun 2022 03:49:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uzhmbY0XGICZUrcb13PNEQTwpr0zmZiFQY/BI8oFh9a0jlQrA0RaKNeL9TEIJwy3ecrc60rw== X-Received: by 2002:adf:dc50:0:b0:21b:874e:e76a with SMTP id m16-20020adfdc50000000b0021b874ee76amr2733864wrj.169.1655894972986; Wed, 22 Jun 2022 03:49:32 -0700 (PDT) Received: from ?IPV6:2003:cb:c703:5100:9c77:ce13:2aeb:8748? (p200300cbc70351009c77ce132aeb8748.dip0.t-ipconnect.de. [2003:cb:c703:5100:9c77:ce13:2aeb:8748]) by smtp.gmail.com with ESMTPSA id g16-20020a05600c4ed000b003974860e15esm29565856wmq.40.2022.06.22.03.49.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jun 2022 03:49:32 -0700 (PDT) Message-ID: Date: Wed, 22 Jun 2022 12:49:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2 1/2] mm/page_alloc: Do not calculate node's total pages and memmap pages when empty To: Muchun Song Cc: Oscar Salvador , Andrew Morton , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220621041717.6355-1-osalvador@suse.de> <20220621041717.6355-2-osalvador@suse.de> <506203e3-1de0-1187-5234-7afc66d4ddfe@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: 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 ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eLINVa1c; spf=none (imf17.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655894992; 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=QchBbQyipF458CAuLWLqnynSF1BJuncWmu+EGU0Vk4U=; b=bcB8lYfxSfP+ZNKnpT3qN9iwI/xLW0DgOIT8fiF1VuyaqX68iFvS9zXF7IDXyPJ5415lHT Wx/Tjs8qXjwi6isq0sWtKS5xerVGQ8k/iSaiENL7BTXXranX5KXG/NHLJOr6XCjmPB8PTV 82VWhfG1p4GlyYAmK9NoW1a41KxR5+0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655894992; a=rsa-sha256; cv=none; b=cmAaOnl8AmNztWHOalOa++6W9VZKWdzg4n+u6j83YMjJaBAxlm5MrHZH33OBvrsjWK60Yc 9Tz+U2itpZAJ/+b8wNTKHUse+5L+4DW8vg7AF8h5nOGUWsfg6HQeEAHVPC/J5UPHaO9IBH oYDoq3FEPRfKf7KRjhEGQ+X/vdDRIr8= X-Stat-Signature: utr9s9ju4w9mq5kggue8rwu5exuh4d9t X-Rspam-User: X-Rspamd-Server: rspam07 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eLINVa1c; spf=none (imf17.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Queue-Id: 798814001E X-HE-Tag: 1655894990-797476 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 22.06.22 10:54, Muchun Song wrote: > 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? Then we have to lookup the pgdat multiple times for (IMHO) no real compelling reason. -- Thanks, David / dhildenb