Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2013924pxj; Sat, 19 Jun 2021 00:04:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrkN5ijl4A4Vrde8AdaH2e/sSFnJK8Ii0tGGK/mnRq8NvoeT3pKk86npnjvO7N/6CGtug2 X-Received: by 2002:aa7:d344:: with SMTP id m4mr9495727edr.281.1624086299599; Sat, 19 Jun 2021 00:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624086299; cv=none; d=google.com; s=arc-20160816; b=UCTjxEdZiqqT1YVzG0yU7UAOqQSlQwiU8LZq2JkSkm4DfOQVRgxOvDvIfE3P2/KNBh GIoEzjItjl+HUfoIxxnPU4b3BKKW8SS1Ab0HF16oq4AmGMaKVe5xbb5WQ8Lvv8kj80Ki zYTKkG4RbdXKhKeNQzUAUPf+blA2B2Lmh5HXRHkuVajNVDVmfDt/KBSYX/gZZLo2kU4e JD0ydtUkx0WelBZN0A3bbO7dinO6HbkWEt+7pMJ6bnmiaBSQtuqFHcd+xuIB/cju9Niq BDt9BQEtkINOgAxeQlFffJtXyqovxyqL//Ygw3RVe4OVfyDgNClL30l+6ujAnFp3dgSK 5X4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=y8uLk574cNjkUMauBw4W7JzMk9tMu3V0u7rxDPL6miw=; b=WNjAj58PtthxVd9Ok2h/XLfLvzwbzaeGvzkI4O6PEPmrgFaSml4BATysrLsheeHLAb 8ne9i0nkgECjhIypnwUjMuu5S/R7P/ZPVR1kDPFUyvqssFWrF4uZ5q0D0E6OjpLNxKV/ ZZxvt7+PM/xmhBODz+XYl4NFNPLcjj3gqfIbDYGW+FX61UgSFH+LD/Gtn+tpLLTijYBf MMLzr4iOogv84SBRfPKvC4k1ag/zuhpju/xmby7UZ5zYw7AjtiIJyXcUJmTpiWxjckqa nO+h9288u1qISyMrI5FxiW/EbqnJSiApXV/kNlKh+sGnwxzoWtOFQLYlcrXf/S6N+N92 qfXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mp3O28Yx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si1437647edr.77.2021.06.19.00.04.37; Sat, 19 Jun 2021 00:04:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mp3O28Yx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234613AbhFRVvi (ORCPT + 99 others); Fri, 18 Jun 2021 17:51:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:34122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbhFRVvi (ORCPT ); Fri, 18 Jun 2021 17:51:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4CD0E60FF4; Fri, 18 Jun 2021 21:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624052968; bh=5/rudTHymhS5/VkI6IvvQ85pgOE0dlvzeUnEKWNpFME=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=mp3O28Yx6lGIUqPBlRzqUcz3w3lYXgEkW+Fs5UqRIDqZNRVI4a3AooALQ3rJf4+lE dyTiRxyreslt8Wvu3O3GyV3YpgwQsZlqJnEPSacB2DbU1NIjaRMGOtrS893DPf+ZqV BEQ47w2nm9aQL2u3wM1MPZ9NE+mkuK8MG/BH5qzLrxwsA/gad7zUPBxlWzggilnxfy 3rVSpHVWIzRtEt8AIGFz8ou3OpWhkAdNaFPrsMHaNEiKTv3yRkmnp3USfAgHtD1Ufj lL1mOFO0GjpMoBNLqrOMZ//cXA1ArNJle9f0NZQ+nloy2ORAV51ALozQPggohhOLqT cQBsJe72Z+Ifw== Subject: Re: vmemmap alloc failure in hot_add_req() To: Michael Kelley , David Hildenbrand Cc: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , "linux-hyperv@vger.kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Oscar Salvador , Hillf Danton References: <20210612021115.2136-1-hdanton@sina.com> <951ddbaf-3d74-7043-4866-3809ff991cfd@redhat.com> <98cba3fa-f787-081f-b833-cfea3a124254@redhat.com> From: Nathan Chancellor Message-ID: Date: Fri, 18 Jun 2021 14:49:22 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michael, On 6/17/2021 5:16 PM, Michael Kelley wrote: > From: David Hildenbrand Sent: Thursday, June 17, 2021 1:43 AM >> >>> It does look like this kernel configuration has >>> CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y. >> >> Okay, so then it's most likely really more of an issue with fragmented >> physical memory -- which is suboptimal but not a show blocker in your setup. >> >> (there are still cases where memory onlining can fail, especially with >> kasan running, but these are rather corner cases) >> >>> >>>> If it's not getting onlined, you easily sport after hotplug e.g., via >>>> "lsmem" that there are quite some offline memory blocks. >>>> >>>> Note that x86_64 code will fallback from populating huge pages to >>>> populating base pages for the vmemmap; this can happen easily when under >>>> memory pressure. >>> >>> Not sure if it is relevant or not but this warning can show up within a >>> minute of startup without me doing anything in particular. >> >> I remember that Hyper-V will start with a certain (configured) boot VM >> memory size and once the guest is up and running, use memory stats of >> the guest to decide whether to add (hotplug) or remove (balloon inflate) >> memory from the VM. >> >> So this could just be Hyper-V trying to apply its heuristics. > > Nathan -- > > Could you clarify if your VM is running in the context of the Windows > Subsystem for Linux (WSL) v2 feature in Windows 10? Or are you > running a "traditional" VM created using the Hyper-V Manager UI > or Powershell? This is a traditional VM created using the Hyper-V Manager. > If the latter, how do you have the memory configuration set up? In > the UI, first you can specify the RAM allocated to the VM. Then > separately, you can enable the "Dynamic Memory" feature, in which > case you also specify a "Minimum RAM" and "Maximum RAM". It > looks like you must have the "Dynamic Memory" feature enabled > since the original stack trace includes the hot_add_req() function > from the hv_balloon driver. That is correct. I believe Dynamic Memory is the default setting so I just left that as it was. The startup memory for this virtual machine is 2GB as it is a lightweight Arch Linux Xfce4 configuration and aside from occasionally compiling software, it will just be sitting there because it is mainly there for testing kernels. > The Dynamic Memory feature is generally used only when you > need to allow Hyper-V to manage the allocation of physical memory > across multiple VMs. Dynamic Memory is essentially Hyper-V's way of > allowing memory overcommit. If you don't need that capability, > turning off Dynamic Memory and just specifying the amount of > memory you want to assign to the VM is the best course of action. Ack. My workstation was occasionally memory constrained so I figured relying on the Dynamic Memory feature would make sense. I upgraded the amount of RAM that I had today so I will probably just end up disabling the Dynamic Memory feature and allocating the amount of memory up front. > With Dynamic Memory enabled, you may have encountered a > situation where the memory needs of the VM grew very quickly, > and Hyper-V balloon driver got into a situation where it needed > to allocate memory in order to add memory, and it couldn't. If > you want to continue to use the Dynamic Memory feature, then > you probably need to increase the initial amount of RAM assigned > to the VM (the "RAM" setting in the Hyper-V Manager UI). I will keep that in mind and see if I can find a good number. Thanks for the reply! Cheers, Nathan