xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dulloor <dulloor@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: xen-devel@lists.xensource.com, Keir Fraser <keir.fraser@eu.citrix.com>
Subject: Re: tmem and construct_dom0 memory allocation race
Date: Tue, 22 Jun 2010 00:17:21 -0700	[thread overview]
Message-ID: <AANLkTilpcK7fxh10G8WaPTCQvamAjl5crV_24L9-W-An@mail.gmail.com> (raw)
In-Reply-To: <8ec6725a-7211-4461-8931-d0196025fb2d@default>

Hi Dan, I am using a pvops kernel.

Hi Keir, You are right .. there is no race. I spent some time
debugging this. The problem is that a zero-order allocation (from
alloc_chunk, for the last dom0 page) fails with tmem on (in
alloc_heap_pages), even though there are pages available in the heap.
I don't think tmem really intends to get triggered so early. What do
you think ?

Also, on an unrelated note, the number of pages estimated for dom0
(nr_pages) could be off by (opt_dom0_vcpus/16) pages, due to the
perdomain_pt_page allocation (in vcpu_initialise).

thanks
dulloor

On Mon, Jun 21, 2010 at 8:35 AM, Dan Magenheimer
<dan.magenheimer@oracle.com> wrote:
> Hi Dulloor --
>
> Intel had previously reported a failure for 2.6.18-xen
> dom0+tmem with dom0_mem unspecified.  I'm not sure if
> this is the same bug or not.
>
> The latest versions of the Linux-side tmem patch disable
> tmem by default (in Linux, not Xen!) and require a kernel
> boot option to turn it on.  Since dom0 is special and
> I've done very little testing with dom0 using tmem (as
> tmem is primarily used with guests), I think the correct
> (at least short-term) fix for this will be to not enable
> tmem for dom0 when dom0_mem is unspecified.  I haven't
> gotten around to updating 2.6.18-xen for awhile, assuming
> it is increasingly rarely used (except in products where
> dom0_mem is always specified).
>
> I'll try to submit a major update to the Linux-side
> tmem patch for the 2.6.18-xen tree soon so at least
> it is consistent with other Linux-side Xen patches.
>
> Dan
>
>> -----Original Message-----
>> From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
>> Sent: Saturday, June 19, 2010 1:27 AM
>> To: Dulloor; xen-devel@lists.xensource.com
>> Subject: Re: [Xen-devel] tmem and construct_dom0 memory allocation race
>>
>> On 19/06/2010 00:10, "Dulloor" <dulloor@gmail.com> wrote:
>>
>> > Following is the sequence :
>> > - init_tmem allocates a set of pages and sets up dstmem and workmem
>> to
>> > alloc pages in MP case (with cpu notifiers)
>> > - construct_dom0 estimates nr_pages by calling avail_domheap_pages
>> > - On other CPUs, tmem cpu_notifier gets called and allocates pages
>> > from domheap, making the construct_dom0's estimate stale.
>> > - construct_dom0 fails
>> >
>> > tmem=off or dom0_mem=xxx both solve the problem for now.
>>
>> Xen boot is pretty serialised. In particular SMP boot, and all cpu
>> notification calls, should be done before dom0 is constructed. So, have
>> you
>> actually seen this race?
>>
>>  -- Keir
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>

  reply	other threads:[~2010-06-22  7:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-18 23:10 tmem and construct_dom0 memory allocation race Dulloor
2010-06-19  7:26 ` Keir Fraser
2010-06-21 15:35   ` Dan Magenheimer
2010-06-22  7:17     ` Dulloor [this message]
2010-06-22  7:36       ` Jan Beulich
2010-06-22  7:38       ` Keir Fraser
2010-06-22 17:23         ` Dan Magenheimer
2010-06-22 18:56           ` Dulloor

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=AANLkTilpcK7fxh10G8WaPTCQvamAjl5crV_24L9-W-An@mail.gmail.com \
    --to=dulloor@gmail.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=keir.fraser@eu.citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).