From: Keir Fraser Subject: Re: [Patch] by default don't give all memory to dom0 Date: Fri, 19 Aug 2005 09:44:03 +0100 Message-ID: <6320da47ae30ead9a43bc18b7e878ae9@cl.cam.ac.uk> References: <20050818122413.C17270@unix-os.sc.intel.com> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20050818122413.C17270@unix-os.sc.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Siddha, Suresh B" Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 18 Aug 2005, at 20:24, Siddha, Suresh B wrote: > By default, xen needs to reserve some portion of memory to satisfy > SWIOTLB and other contguous memory region requests. Following > the current swiotlb enabling mechanism, Appended patch reserves 128MB > of memory on systems with more than 2GB of RAM. Hmmm... sounds reasonable. I'd rather have one dom0 memory parameter though --- keeping dom0_mem but have +ve value mean 'allocate this amount' and -ve mean 'allocate full memory - this amount'. Otherwise we have two competing parameters specifying basically the same thing... I don't much like hacky 'policies' that hardcode default reservations in the hypervisor, but I think this one is pretty sensible. > Ideally shouldn't we enable SWIOTLB in dom0 and this DMA memory > reservation > in hypervisor by default? Otherwise we will have a problem(even on > systems > with less than 2GB of RAM) in servicing a driver DMA request to a > kmalloc'd buffer which spans more than a page or the various > xen_create_contiguous_region() requests. You get a pretty clear BUG() message out if this happens. It actually tells you to enable 'swiotlb=force'! The number of drivers that actually use multi-page buffers is really small -- we only fixed that case in 2.0 a few weeks ago. I'd rather not waste 64MB of pre-reserved bounce buffers on small-memory systems that almost certainly don't need bounce buffers. -- Keir