[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] x86/PVH: improve Dom0 memory size calculation


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 31 Aug 2021 17:30:07 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YrHhJgw6JNniaTdTN/dAOYdsAIUG+a9r5VPgstCwwkc=; b=Yka1cRprlzXEq08IOdZrMaeq8lT9uQNwTg9M6IpU4G/iQ2TchkO9G0bx4pjnnt/vO7JdZya4ftP64fVrUqldQ6ndxf7VRU6oN2zPsl3x4WC4Oi0ub0y7W6jx1vXvfKUmXwLyLsuiBoQA4zKI5qsCMVER8E1LVC082p4JCuPdn4AYlsNnoEfxwOwefFwXCEP67z26+sFKjPk3ro3USkn6vzxwrgQo2CCiVBkgR0IkXRySS9JlLkFi/cz7mCZAQd8W9LgAJvP0CjPfrr5sksfQF2Znp06UhMUzQcgR0zlRGqRSFPVyFWmmU0uePvUXiwr8IVBZB9MSWueNPFJoGUv5bg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QjVoBzouN051jMJBD3Msed5ooT8Va+2Ysr87mUwltwxOp7DhQk/LzFXxU0/hza1BGyTXSw3CZo21gsLtWgOi0Aj7s7kCx8AVF+KJ9QLhBoUY3gFkfYq3RlPSOMouyQJ1G4y84oztCO6EK9g2p3hCBnmy7HuYKI5h/xra4sRFTCAUdk+Jqs7chVrJWj6UI93+AK7hpCDTmIQbO5ikzKQEGGNckoRGbED+FvniwRIZ0lN40MOOlSj9nmjqUmvc/l/cpPTIEpm8sbnH/hvfDutrvqjFc47hNtA/5YN2+EBSMdQKioz1wJcmp3JzjxDCiKfO0V97g0WTjvwEGwLMJyA5ZA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 31 Aug 2021 15:30:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.08.2021 16:07, Andrew Cooper wrote:
> On 30/08/2021 14:03, Jan Beulich wrote:
>> Assuming that the accounting for IOMMU page tables will also take care
>> of the P2M needs was wrong: dom0_paging_pages() can determine a far
>> higher value, high enough for the system to run out of memory while
>> setting up Dom0. Hence in the case of shared page tables the larger of
>> the two values needs to be used (without shared page tables the sum of
>> both continues to be applicable).
> 
> I'm afraid that I can't follow this at all.
> 
> What causes the system to run out of RAM while constructing dom0?

Without any "dom0_mem=" we set aside 128Mb. In my .config that was in
use I default to "dom0_mem=-255". Yet this was still far from enough to
cover the gap between the original IOMMU page table accounting and the
value returned from dom0_paging_pages(). Since this is what also gets
used to actually populate Dom0's P2M pool, with the P2M pool populated
there wasn't enough RAM anymore to reach the Dom0 size which
dom0_compute_nr_pages() did establish.

Putting it in a simplified formula, what we did so far when sharing
page tables was

RAM = total - IOMMU

but what we need is

RAM = total - max(IOMMU, P2M)

In the non-shared case we already correctly did

RAM = total - (IOMMU + P2M)

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.