From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751721AbdJXHrg (ORCPT ); Tue, 24 Oct 2017 03:47:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:52428 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbdJXHrf (ORCPT ); Tue, 24 Oct 2017 03:47:35 -0400 Subject: Re: [Xen-devel] [PATCH v3] xen/balloon: don't online new memory initially To: Boris Ostrovsky , HW42 , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org References: <20170710081045.874-1-jgross@suse.com> <89348679-2db3-b1ea-f1e3-725493ac5ab8@ipsumj.de> From: Juergen Gross Message-ID: <37f323bd-8f2b-b7d6-e867-1b3faaa3c3cd@suse.com> Date: Tue, 24 Oct 2017 09:47:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/10/17 23:33, Boris Ostrovsky wrote: > On 10/02/2017 05:37 PM, HW42 wrote: >> Juergen Gross: >>> When setting up the Xenstore watch for the memory target size the new >>> watch will fire at once. Don't try to reach the configured target size >>> by onlining new memory in this case, as the current memory size will >>> be smaller in almost all cases due to e.g. BIOS reserved pages. >>> >>> Onlining new memory will lead to more problems e.g. undesired conflicts >>> with NVMe devices meant to be operated as block devices. >>> >>> Instead remember the difference between target size and current size >>> when the watch fires for the first time and apply it to any further >>> size changes, too. >>> >>> In order to avoid races between balloon.c and xen-balloon.c init calls >>> do the xen-balloon.c initialization from balloon.c. >>> >>> Signed-off-by: Juergen Gross >> This patch seems to introduce a regression. If I boot a HVM or PVH >> domain with memory != maxmem then the kernel inside the domain reports >> that it has maxmem available even though Xen reports only what is set as >> memory. Sooner or later Xen logs "out of PoD memory!" and kills the >> domain. If I revert the corresponding commit (96edd61d) then everything >> works as expected. >> >> Tested this with Xen 4.9.0 and Linux 4.13.4. >> > > > Yes, this indeed doesn't look like it's doing the right thing (although > I haven't seen the "out of memory" error). You need to use enough memory (e.g. via memhog). > I wonder whether target_diff should be computed against xenstore's > "static-max" and not "target" and the memory should be ballooned down > immediately and not on a subsequent watch firing. Right. And we need to keep target_diff = 0 for PV domains. Patch coming soon. Juergen