From: Joanna Rutkowska <joanna@invisiblethingslab.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>,
xen-devel@lists.xensource.com,
Rafal Wojtczuk <rafal@invisiblethingslab.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: Assigning contiguous memory to a driver domain
Date: Wed, 15 Sep 2010 12:42:50 +0200 [thread overview]
Message-ID: <4C90A32A.7010803@invisiblethingslab.com> (raw)
In-Reply-To: <4C90B31902000078000163E8@vpn.id2.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 3190 bytes --]
On 09/15/10 11:50, Jan Beulich wrote:
>>>> On 15.09.10 at 11:39, Rafal Wojtczuk <rafal@invisiblethingslab.com> wrote:
>> On Wed, Sep 15, 2010 at 11:08:42AM +0200, Rafal Wojtczuk wrote:
>>> On Tue, Sep 14, 2010 at 10:36:56AM +0100, Jan Beulich wrote:
>>>>>>> On 14.09.10 at 11:24, Rafal Wojtczuk <rafal@invisiblethingslab.com> wrote:
>>>>> Hello,
>>>>>
>>>>> Could someone guide me in the right direction with the topic of assigning
>>>>> contiguous memory to a domain.
>>>>>
>>>>> I have an issue with a PV domain that is assigned a PCI device. Sometimes,
>>
>>>>> the
>>>>> driver fails to load
>>>>> Sep 13 10:36:43 localhost kernel: [ 103.651858] iwlagn 0000:00:01.0:
>>>>> firmware: requesting iwlwifi-4965-2.ucode
>>>>> Sep 13 10:36:43 localhost kernel: [ 103.669105] iwlagn 0000:00:01.0:
>> loaded
>>>>> firmware version 228.61.2.24
>>>>> Sep 13 10:36:43 localhost kernel: [ 103.669263] iwlagn 0000:00:01.0:
>> failed
>>>>> to allocate pci memory
>>>>>
>>>>> The reason seems to be that the domain does not have enough contiguous
>>>>> memory, in mfn terms.
>>>>
>>>> No, how (dis)contiguous the memory of a domain is doesn't matter
>>>> here. What matters is whether the domain can *make* the requested
>>>> memory contiguous, and that depends on how much contiguous
>>>> memory Xen has at the point of the allocation.
>>>
>>> Ah, so you are saying that regardless of whether a domain has some
>>> contiguous memory, the driver will call xen_create_contiguous_region when
>> allocating
>>> memory (via dma_alloc_coherent ?).
>>>
>>> Slightly out-of-the-list-scope: is there a convention when a driver should
>>> allocate DMA-able memory ? Is it safe to assume that as soon as the driver
>>> has loaded, it will no longer need to call xen_create_contiguous_region
>>> anymore and we can use up all free Xen memory ?
>>
>> Hmm, at least in case of tg3 driver, if xen free memory = 0, after I have
>> done "ifconfig eth0 down" in the driver domain, the subsequent "ifconfig
>> eth0 up"
>> failed with "SIOCSIFFLAGS: Cannot allocate memory".
>
> Sure - why would the driver waste resources when the device may
> not be used.
>
>> So, it looks like in order to make a PV driver domain work, there must be
>> some Xen free memory
>> all the time ?
>
> Potentially yes, but this really depends on how the respective
> driver is written.
>
>> Moreover, this free Xen memory must be contiguous to some
>> extent; is there any way to assure this ?
>
> No.
>
Wait! Are you saying there is no *way* to guarantee proper operation of
a driver domain in Xen?
Sure, we can tune our memory balancer to always keep some 100MB (or
200MB, or maybe 500MB?) of xen free memory, and *hope* that it will
contain enough continues pages, in case some driver in some driver
domain calls dma_alloc_coherent(), so the call will succeed.
But this is not a good solution: not only because it's a waste of memory
(I'd rather use this memory for Dom0/storage domain page cache instead)
but also, and most importantly, because I don't want to build a system
based on *hope*!
Can we do something about it?
joanna.
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 518 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2010-09-15 10:42 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-14 9:24 Assigning contiguous memory to a driver domain Rafal Wojtczuk
2010-09-14 9:36 ` Jan Beulich
2010-09-15 9:08 ` Rafal Wojtczuk
2010-09-15 9:39 ` Rafal Wojtczuk
2010-09-15 9:50 ` Jan Beulich
2010-09-15 10:42 ` Joanna Rutkowska [this message]
2010-09-15 10:59 ` Jan Beulich
2010-09-15 11:07 ` Joanna Rutkowska
2010-09-15 11:50 ` Jan Beulich
2010-09-15 11:58 ` Goswin von Brederlow
2010-09-15 12:06 ` Rafal Wojtczuk
2010-09-15 13:49 ` Jan Beulich
2010-09-15 14:44 ` Rafal Wojtczuk
2010-09-15 15:29 ` Jan Beulich
2010-09-20 19:48 ` Konrad Rzeszutek Wilk
2010-09-20 20:27 ` Jeremy Fitzhardinge
2010-09-20 21:41 ` Konrad Rzeszutek Wilk
2010-09-20 21:55 ` Jeremy Fitzhardinge
2010-09-20 23:42 ` Dan Magenheimer
2010-09-21 0:45 ` Jeremy Fitzhardinge
2010-09-21 8:04 ` Tim Deegan
2010-09-21 11:28 ` Joanna Rutkowska
2010-09-21 14:34 ` Konrad Rzeszutek Wilk
2010-09-15 19:25 ` Goswin von Brederlow
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=4C90A32A.7010803@invisiblethingslab.com \
--to=joanna@invisiblethingslab.com \
--cc=JBeulich@novell.com \
--cc=dan.magenheimer@oracle.com \
--cc=konrad.wilk@oracle.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.