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 67C0BC433EF for ; Thu, 7 Apr 2022 12:13:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B4BE66B0071; Thu, 7 Apr 2022 08:12:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFA5F6B0073; Thu, 7 Apr 2022 08:12:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99B306B0074; Thu, 7 Apr 2022 08:12:53 -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 8BB976B0071 for ; Thu, 7 Apr 2022 08:12:53 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 565EF2802F for ; Thu, 7 Apr 2022 12:12:43 +0000 (UTC) X-FDA: 79329971406.11.7440541 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 96DE518000B for ; Thu, 7 Apr 2022 12:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649333562; 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=He8h+g9gcpriqclLdlbV5LzBn0WlLmTvUFHHwXaoICE=; b=GxmHoz3mvqVkuOjk50fkuE1bi4h4MZKOWFLKa8nWsAp4YZeFb+45Jq3XxZW8Ch4/bqxTCH NiSizmijzHDzMGDBd2VjGmFse/ElX8XZmscI9WhNXKHw3EiJQhL/mgoijBx40taApubI6I /svwLnGe2oH6OIOks9qZNBG3rOYe4mg= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-556-TqXLpdkhOUKteZQJj587yQ-1; Thu, 07 Apr 2022 08:12:41 -0400 X-MC-Unique: TqXLpdkhOUKteZQJj587yQ-1 Received: by mail-wm1-f69.google.com with SMTP id bg8-20020a05600c3c8800b0038e6a989925so1432258wmb.3 for ; Thu, 07 Apr 2022 05:12:40 -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=He8h+g9gcpriqclLdlbV5LzBn0WlLmTvUFHHwXaoICE=; b=LzOQE0AtS2FDBMZ5EOy7lN1cxGhk9t4Y5lb0ulhje9Pjirt2Uba3Nf3JjXingw2Je3 JZbEirSZyeswwyoyATC51xi5/d8tD4M/Dj+hvPDjoenp8hKQlgTXzptEn4ZDNc4J2UCJ rdqB2Eqs9eI8aWqHol534BslQzRFI/WIG35o6EsBtlGXHHxdn5eeFH7v5bLtXfI33r3h fXS7IUbDy/TdRhIZCjM0IjnLh3bLvzjgvnQS+8qCNoVDMiirWYP1z91w9Q3c+mgiMjLf QBSebRCkmw9+liE42cA7fGk63tUZhTa3p1LLIGx23sDMYtSXkUK7m8YjVUmaJsPbd/6w alxg== X-Gm-Message-State: AOAM5303JS9Hjgspn/j+KH6o9xo7gSTMYsesyhRvkGZwFq9pUQWwR8Qs 7v60a9GORSiV4Eu9FJFNdMNLgPw3xiEXxwSI5W9ggsgCl1B8mUEa+jOQIrO20LlTXdjNxI+Js45 XKgFxrjx8Vas= X-Received: by 2002:a05:600c:4f08:b0:38c:93fd:570f with SMTP id l8-20020a05600c4f0800b0038c93fd570fmr12048347wmq.136.1649333559830; Thu, 07 Apr 2022 05:12:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8VD2jmyYCLdT1LS37dFQHExBQz5m/CcSM2lhqIzro2UScARspuOQOmGyPtwzTU/phPmvvNw== X-Received: by 2002:a05:600c:4f08:b0:38c:93fd:570f with SMTP id l8-20020a05600c4f0800b0038c93fd570fmr12048327wmq.136.1649333559539; Thu, 07 Apr 2022 05:12:39 -0700 (PDT) Received: from ?IPV6:2a09:80c0:192:0:20af:34be:985b:b6c8? ([2a09:80c0:192:0:20af:34be:985b:b6c8]) by smtp.gmail.com with ESMTPSA id b8-20020a05600c4e0800b0038c6c37efc3sm7370765wmq.12.2022.04.07.05.12.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Apr 2022 05:12:38 -0700 (PDT) Message-ID: Date: Thu, 7 Apr 2022 14:12:38 +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] mm, page_alloc: fix build_zonerefs_node() To: Michal Hocko Cc: Juergen Gross , xen-devel@lists.xenproject.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , stable@vger.kernel.org, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= , Mel Gorman References: <20220407093221.1090-1-jgross@suse.com> <5e97a7f5-1fc9-d0b4-006e-6894d5653c06@suse.com> <770d8283-4315-3d83-4f8b-723308fffe5c@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 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 48bm7xeu51yqpqeccuujgtwfggpnmyfw Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GxmHoz3m; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf24.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Rspamd-Queue-Id: 96DE518000B X-HE-Tag: 1649333562-788718 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 07.04.22 14:04, Michal Hocko wrote: > On Thu 07-04-22 13:58:44, David Hildenbrand wrote: > [...] >>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >>> index 3589febc6d31..130a2feceddc 100644 >>> --- a/mm/page_alloc.c >>> +++ b/mm/page_alloc.c >>> @@ -6112,10 +6112,8 @@ static int build_zonerefs_node(pg_data_t *pgdat, struct zoneref *zonerefs) >>> do { >>> zone_type--; >>> zone = pgdat->node_zones + zone_type; >>> - if (managed_zone(zone)) { >>> - zoneref_set_zone(zone, &zonerefs[nr_zones++]); >>> - check_highest_zone(zone_type); >>> - } >>> + zoneref_set_zone(zone, &zonerefs[nr_zones++]); >>> + check_highest_zone(zone_type); >>> } while (zone_type); >>> >>> return nr_zones; >> >> I don't think having !populated zones in the zonelist is a particularly >> good idea. Populated vs !populated changes only during page >> onlininge/offlining. >> >> If I'm not wrong, with your patch we'd even include ZONE_DEVICE here ... > > What kind of problem that would cause? The allocator wouldn't see any > pages at all so it would fallback to the next one. Maybe kswapd would > need some tweak to have a bail out condition but as mentioned in the > thread already. !populated or !managed for that matter are not all that > much different from completely depleted zones. The fact that we are > making that distinction has led to some bugs and I suspect it makes the > code more complex without a very good reason. I assume performance problems. Assume you have an ordinary system with multiple NUMA nodes and no MOVABLE memory. Most nodes will only have ZONE_NORMAL. Yet, you'd include ZONE_DMA* and ZONE_MOVABLE that will always remain empty to be traversed on each and every allocation fallback. Of course, we could measure, but IMHO at least *that* part of memory onlining/offlining is not the complicated part :D Populated vs. !populated is under pretty good control via page onlining/offlining. We have to be careful with "managed pages", because that's a moving target, especially with memory ballooning. And I assume that's the bigger source of bugs. > >> I'd vote for going with the simple fix first, which should be good >> enough AFAIKT. > > yes, see the other reply > I think we were composing almost simultaneously :) -- Thanks, David / dhildenb