All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Marek Marczykowski <marmarek@invisiblethingslab.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Joanna Rutkowska <joanna@invisiblethingslab.com>,
	Rafal Wojtczuk <rafal@invisiblethingslab.com>
Subject: Re: Memory fragmentation and PCI passthrough
Date: Wed, 7 Sep 2011 13:36:22 -0400	[thread overview]
Message-ID: <20110907173622.GJ32190@dumpdata.com> (raw)
In-Reply-To: <4E665E53.3@invisiblethingslab.com>

On Tue, Sep 06, 2011 at 07:54:27PM +0200, Marek Marczykowski wrote:
> Hello,
> 
> I've hit known problem with dynamic memory management - memory
> fragmentation... This dynamic memory management basically does xl
> mem-set to balance memory.
> 
> After some time of running system, xen memory is so fragmented that it
> is impossible to start new VM with PCI device. Sometimes it crashes
> during boot (no 64MB contiguous memory for SWIOTLB), or later - eg.
> iwlagn cannot allocate memory for loading firmware (few allocs, each
> bellow 100k).
> 
> DomU kernel cmdline: console=hvc0 iommu=soft earlyprintk=xen
> 
> There is two cases (I think):
> 1. With IOMMU
> 2. Without IOMMU
> I've tried only the second one.
> 
> Is there any known solution for this problem?
> Some ideas:
> 1. With IOMMU pass iommu=pv to Xen. AFAIU domU will not need iommu=soft
> parameter then, right? Will it work then with fragmented memory?

It will still need it. Otherwise the Xen SWIOTLB won't be used.

But you can limit the amount of memory for the SWIOTLB, say by
doing 'swiotlb=2048'

> 
> 2. Force somehow on xen/libxl to allocate memory (for domU) in chunks
> of, say 4MB, to not fragment it so badly. Is it doable?
> 
> In tmem documentation is also described some workaround for this:
> reserve some memory region for allocations with 0<order<=9. But SWIOTLB
> tries to allocate 64MB, which much bigger than 2MB... Is it really
> needed to allocate such big region of contiguous memory in one piece?

Nope. It only uses that pool for 32-bit devices too - so there is not
really a big need for it.


> 
> -- 
> Pozdrawiam / Best Regards,
> Marek Marczykowski
> Invisible Things Lab
> 



> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2011-09-07 17:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-06 17:54 Memory fragmentation and PCI passthrough Marek Marczykowski
2011-09-07 10:01 ` Jan Beulich
2011-09-07 17:36 ` Konrad Rzeszutek Wilk [this message]
2011-09-07 21:00   ` Pasi Kärkkäinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110907173622.GJ32190@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=joanna@invisiblethingslab.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=rafal@invisiblethingslab.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.