All of lore.kernel.org
 help / color / mirror / Atom feed
From: tupeng212 <tupeng212@gmail.com>
To: Keir Fraser <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: alloc_heap_pages is low efficient with more CPUs
Date: Fri, 12 Oct 2012 20:24:16 +0800	[thread overview]
Message-ID: <201210122024123436447@gmail.com> (raw)
In-Reply-To: CC9CA725.4EB45%keir@xen.org


[-- Attachment #1.1: Type: text/plain, Size: 1177 bytes --]

With 16 CPUs you find domain startup takes 3s always. 
:No
With 16CPUs, first 0.3s, second 3s
With 64CPUs, first 3s, second 30s.

With 64 CPUs you find it takes 3s first time, then 30s in future? 
: Yes

And this is due to cost of tlbflush_filter() (not actual TLB flushes, because you always end up with mask=0)? 
: Yes, it costs much in tlbflush_filter() in the judgement.
TLB flushing is really very fast, it just sends a IPI to related CPU.
In the starting process's allocation, it always ends up with mask=0 which seems needless.

If tlbflush_filter() were that expensive I’d expect the 16-CPU case to have slowdown after the first domain startup, too.
: Yes, you are right, 16CPU slows down too after its first startup.

The reason is very clear, I have discussed it with others, tlbflush_filter() is low efficient is no doubt, 
But I don't know how to improve it .

and I also used  xen oprofile to find the following two functions are called high frequently:
alloc_heap_pages: 40%
__next_cpu : 20%
others: 0.x%
.....
alloc_heap_pages -> tlbflush_filter -> for_each_cpu_mask next_cpu  -> __next_cpu 
it seems traveling among CPUs is expensive.

[-- Attachment #1.2: Type: text/html, Size: 3023 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2012-10-12 12:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 15:18 alloc_heap_pages is low efficient with more CPUs tupeng212
2012-10-11 15:41 ` Keir Fraser
2012-10-12 12:24   ` tupeng212 [this message]
2012-10-12 22:39     ` Mukesh Rathor
2012-10-13  6:03       ` Keir Fraser
2012-10-13  7:20         ` tupeng212
2012-10-13  8:59           ` Keir Fraser
     [not found] <CC9EC91B.41A16%keir.xen@gmail.com>
2012-10-13  6:46 ` tupeng212
2012-10-13  8:59   ` Keir Fraser
2012-10-15 13:27     ` tupeng212
2012-10-15 15:45       ` Keir Fraser
2012-10-16  7:51         ` Jan Beulich
2012-10-16  8:03           ` Keir Fraser
2012-10-16  8:28             ` Jan Beulich
2012-10-16  8:53               ` 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=201210122024123436447@gmail.com \
    --to=tupeng212@gmail.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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.