All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: long latency of domain shutdown
Date: Thu, 08 May 2008 11:39:04 +0100	[thread overview]
Message-ID: <4822F468.76E4.0078.0@novell.com> (raw)
In-Reply-To: <C448908C.20667%keir.fraser@eu.citrix.com>

>>> Keir Fraser <keir.fraser@eu.citrix.com> 08.05.08 12:12 >>>
>On 8/5/08 10:58, "Jan Beulich" <jbeulich@novell.com> wrote:
>
>> While looking at this I wondered whether there really is a way for
>> Xen heap pages to end up being guest page tables (or similarly
>> descriptor table ones)? I would think if that happened this would be
>> a bug (and perhaps a security issue). If it cannot happen, then the
>> RELMEM_* states could be simplified and
>> domain_relinquish_resources() shortened.
>
>You mean just force page-table type counts to zero, and drop main reference
>count by the same amount? Might work. Would need some thought.

No, here I mean having just RELMEM_xen and RELMEM_l{1,2,3,4}.
Then simply release Xen pages first, then l4...l1.

For the suggested workaround to reduce latency of relinquish_memory()
preemption, I simply mean utilizing the code to deal with circular
references also for releasing simple ones (that code path doesn't seem
to care to force the type count to zero, but as I understand that's no
problem since these pages end up being freed anyway, and that's
where the whole type_info field gets re-initialized - or was this
happening when the page gets allocated the next time).

>8500 cycles per pte is pretty fantastic. I suppose a few atomic ops are
>involved. Are you running on an old P4? :-)

Not too old, it's what they called Tulsa as codename (i.e. some of the
about two year old Xeons). But I suppose that generally the bigger
the box (in terms of number of threads/cores/sockets) the higher the
price for atomic ops.

In trying to get a picture, I e.g. measured both the cumulative full
free_domheap_pages()' and free_l1_table()'s contributions as well as
just the d != NULL sub-part of free_domheap_pages() - example
results are
0x2a4990400 clocks for full free_l1_table()
0x10f1a3749 clocks for full free_domheap_pages()
0x0ec6748eb clocks for the d != NULL body
Given how little it is that happens outside of that d != NULL body I'm
concluding that the atomic ops are by far not alone responsible for
the long execution time. These are dual-threaded CPUs, however,
so that while the system was doing nothing else I cannot exclude that
the CPUs do something dumb in switching between the threads. But
excluding this possible effect from the picture seems to have little
sense, since we need to be able to deal with the situation anyway.

Jan

  reply	other threads:[~2008-05-08 10:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48189781.76E4.0078.0@novell.com>
     [not found] ` <C43E4040.2022A%keir.fraser@eu.citrix.com>
2008-05-08  9:58   ` long latency of domain shutdown Jan Beulich
2008-05-08 10:12     ` Keir Fraser
2008-05-08 10:39       ` Jan Beulich [this message]
2008-05-08 10:52         ` Keir Fraser
2008-05-08 11:13           ` Jan Beulich
2008-05-08 12:11             ` Keir Fraser
2008-05-08 12:33               ` Jan Beulich
2008-05-08 12:36                 ` Keir Fraser
2008-05-08 14:29                   ` Jan Beulich
2008-05-08 14:38                     ` Keir Fraser
2008-05-09 10:23               ` Jan Beulich
2008-05-09 10:29                 ` Keir Fraser
2008-04-28 13:45 Jan Beulich
2008-04-28 13:59 ` Keir Fraser
2008-04-28 14:30   ` Jan Beulich
2008-04-28 14:42     ` Keir Fraser
2008-05-14 15:54       ` Jan Beulich
2008-05-14 16:05         ` Jan Beulich
2008-05-14 16:08         ` Keir Fraser

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=4822F468.76E4.0078.0@novell.com \
    --to=jbeulich@novell.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 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.