Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp359849pxb; Thu, 7 Apr 2022 07:31:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeRFlSl0IlYrNPB7RrCFpv09WfKe56cp7GQZHJ1WcLUtvyIIFxu5yzWTTwWFt29x48+/qe X-Received: by 2002:a17:906:edd6:b0:6e8:40b2:74cf with SMTP id sb22-20020a170906edd600b006e840b274cfmr1604086ejb.137.1649341915781; Thu, 07 Apr 2022 07:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649341915; cv=none; d=google.com; s=arc-20160816; b=WN8c54pb4opsaBikC9tei0bNMWcjQFIkuriV4OuEQlHp2XIEyPJcTINhD5uQsdDIni GF4YNap978yqU1Er7FyYc6LCztl0dZBTN1yHfItp0FVKZK2UTzi9TOAMz5s+wmsCKtWB BpKDqWr/Ot/XCpYAnqa3YZo4zSlJTJKR7i0Va5frVdMDJ9PaAs4+0lARSoHju7d/4Ux1 OblDgfo/ROYjpFw3HL5g7mfPYjpwzIev0k1fYFGE/xW85q3TdvWlH10CbHVq5R8x8U+D nJAaaq4VypBeKIOlO2YqVQgkOTV/LEo44tnZQXP8/4yQWWHUahuXUBQprGJ6YPPb81kE rV9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=0inCEjJJWw//2DoC93l0BxRCxkrP6GV4SWwsKG2zpLQ=; b=cqq8yk+9f41wgRft8Qa8nDBq1OZEw+iJPIQCRWIm51LoMbnuVvduJBwnW8eGG2x903 wVTw3ddSH5VoA6X2mmJ90jTZQqL4eLwpjLEgzAsPq6ZlJOEDIVPwtMMhSgFgSWJpriLS 0UTqD/rmuVW3jTEGjEXlPyfK6P9zv5tl9GrOldpCO9ctDvMkA/6zMtQ/XO/aiQFUEIRt RajW1r71bAk7ntL+EFs9DE3PjmRl2WUv56PV5bOSjd6m1m1XpgFNGhWubnN28Kw99zlj RDvE1sp2UTZXrDQFqoI0n4L65iQeZSde7db6AgdDAG3sIjP3arYUrMiojxFPjDTHve8F 7ReQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aJxOc89I; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a50e041000000b00418c2b5becbsi14599547edl.429.2022.04.07.07.31.28; Thu, 07 Apr 2022 07:31:55 -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=@redhat.com header.s=mimecast20190719 header.b=aJxOc89I; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237591AbiDGJDs (ORCPT + 99 others); Thu, 7 Apr 2022 05:03:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243602AbiDGJCk (ORCPT ); Thu, 7 Apr 2022 05:02:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D886215DAB2 for ; Thu, 7 Apr 2022 02:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649322037; 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=0inCEjJJWw//2DoC93l0BxRCxkrP6GV4SWwsKG2zpLQ=; b=aJxOc89Id1Wis/A/CoCs0zLw7VELjzmN2teAJK6WWAhLr6n7bnho+Y0w9T2rKrUXufBbP9 GNU81ZsqKgErQZHC+xC+DN5PJcussH5ZmHjY1rd8JHXIPUjUBAAgU1p76xGc015DhRfX45 0LrTsmj5F8cxn7sGsqm4lv/aU1MsYCY= 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-593-oaIHuCeKPAaVUJYwE42asQ-1; Thu, 07 Apr 2022 05:00:36 -0400 X-MC-Unique: oaIHuCeKPAaVUJYwE42asQ-1 Received: by mail-wm1-f69.google.com with SMTP id c62-20020a1c3541000000b003815245c642so4286221wma.6 for ; Thu, 07 Apr 2022 02:00:36 -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=0inCEjJJWw//2DoC93l0BxRCxkrP6GV4SWwsKG2zpLQ=; b=kzn6ssAo5JRF63I4o2dZmGmu5gqbe8hjWJ40j8dUtePo5ERQWu4yASHjbeCKoniDZg F8gOpvW+2p1kRlWksb4yKzB65sr1I00TS+0/5/HZUidpAGpj4vT9XBgNUaSPkXimW3// teiOlRmRO03kZFa4hr53qeWwEiMyRwIpLby9U6/KN5JO56DRlo7Q7BaleBWx60MuEsrc 0OlaIZwHOOQEaooODDXiaavOtEF2+410V1Zjr9Vap5pYGbsuvXxvGTVcBdjhff0MeSL2 2JIi/+dkuxcqxGIx39YHLcUW4aFNTDOk4JQ5P7gv08H2czc+dh8NSRyxRUOQS2zbOWVt a/iA== X-Gm-Message-State: AOAM531ZsJu0egyYQmFnD/kcmh40pOELDC+DwayNZ6tCZiYnv2zBu1Px jt4MXrR5Go9zPTvvQLZpALuuFztRONgpg97gT2r+6xeTZ32B/3+bHKTjnHz8yeVWgLq1gwIWFEm KvzsCv0ikZoZQ4WhHwFGAM2UE X-Received: by 2002:a05:600c:17c5:b0:38e:7853:e915 with SMTP id y5-20020a05600c17c500b0038e7853e915mr11065439wmo.123.1649322035314; Thu, 07 Apr 2022 02:00:35 -0700 (PDT) X-Received: by 2002:a05:600c:17c5:b0:38e:7853:e915 with SMTP id y5-20020a05600c17c500b0038e7853e915mr11065408wmo.123.1649322035047; Thu, 07 Apr 2022 02:00:35 -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 u7-20020a05600c19c700b0038cc9aac1a3sm7933452wmq.23.2022.04.07.02.00.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Apr 2022 02:00:34 -0700 (PDT) Message-ID: Date: Thu, 7 Apr 2022 11:00:33 +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] xen/balloon: fix page onlining when populating new zone Content-Language: en-US To: Juergen Gross , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Boris Ostrovsky , Stefano Stabellini , stable@vger.kernel.org, =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= , Wei Yang , Michal Hocko References: <20220406133229.15979-1-jgross@suse.com> <89ad978d-e95e-d3ea-5c8f-acf4b28f992c@redhat.com> <4f1908b5-5674-a772-3cd9-78e4dc40f776@suse.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <4f1908b5-5674-a772-3cd9-78e4dc40f776@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,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 07.04.22 10:50, Juergen Gross wrote: > On 07.04.22 10:23, David Hildenbrand wrote: >> On 06.04.22 15:32, Juergen Gross wrote: >>> When onlining a new memory page in a guest the Xen balloon driver is >>> adding it to the ballooned pages instead making it available to be >>> used immediately. This is meant to enable to add a new upper memory >>> limit to a guest via hotplugging memory, without having to assign the >>> new memory in one go. >>> >>> In case the upper memory limit will be raised above 4G, the new memory >>> will populate the ZONE_NORMAL memory zone, which wasn't populated >>> before. The newly populated zone won't be added to the list of zones >>> looked at by the page allocator though, as only zones with available >>> memory are being added, and the memory isn't yet available as it is >>> ballooned out. >> >> I think we just recently discussed these corner cases on the -mm list. > > Indeed. > >> The issue is having effectively populated zones without manages pages >> because everything is inflated in a balloon. > > Correct. > >> That can theoretically also happen when managing to fully inflate the >> balloon in one zone and then, somehow, the zones get rebuilt. > > I think you are right. I didn't think of that scenario. > >> build_zonerefs_node() documents "Add all populated zones of a node to >> the zonelist" but checks for managed zones, which is wrong. >> >> See https://lkml.kernel.org/r/20220201070044.zbm3obsoimhz3xd3@master > > I found commit 6aa303defb7454 which introduced this test. I thought > it was needed due to the problem this commit tried to solve. Maybe I > was wrong and that commit shouldn't have changed the condition when > building the zonelist, but just the ones in the allocation paths. In regard to kswapd, that is currently being worked on via https://lkml.kernel.org/r/20220329010901.1654-2-richard.weiyang@gmail.com -- Thanks, David / dhildenb