linux-um archives
 help / color / mirror / Atom feed
From: BlaisorBlade <blaisorblade_spam@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: Young K <young_uml@hotmail.com>
Subject: Re: [uml-devel] slow execution in uml?
Date: Tue, 5 Oct 2004 20:21:25 +0200	[thread overview]
Message-ID: <200410052021.25170.blaisorblade_spam@yahoo.it> (raw)
In-Reply-To: <BAY22-F38Fm15k4R9xC00023711@hotmail.com>

On Monday 04 October 2004 23:35, Young K wrote:
> hi, folks,
>
> i was comparing uml network performance with genuine linux. the experiment
> i did was to insert time-stamping code in network stack, and see how slower
> uml is. i was sending 32-byte udp packets to another machine every 10 msec,
> and used rdtsc to measure the elapsed cpu cycles between sendto() and
> nf_hook_slow() (which is called inside ip_build_xmit()).

> what i found was that it took around 29,000 cycles from sendto() to
> nf_hook_slow() in uml whereas only 2,000 cycles in genuine linux. it looks
> like a big difference. but i think it's purely code execution without any
> I/O operation between sendto() to nf_hook_slow(). then, why is it so slow
> in uml? is there any possible factors that make uml slower?

> (more cache 
> misses?)

What is slower in UML (a lot slower) is (at least):
- syscall execution
- page fault

At a first glance, I wouldn't be surprised if the syscall itself took 26,000 
cycles (they are rdtsc units, right?). Please check by running either 
getpid() or a non-existing syscall (with the _syscall0 macro from 
<asm/unistd.h>). With SKAS mode and without SYSEMU for each syscall, 4 host 
context switches are needed. This number drops down to 2 with SYSEMU, and 
pure getpid() loops show 66% improvement from this. I also remember one test 
(I think they were ByteBench result against an host system) where the exec() 
throughput was various order of magnitude lower than the host, as the syscall 
throughput.

> i used 2.4.22 for guest os(tt mode)

Well, using TT mode is a sure recipe for slow execution. And, quite frankly, 
almost nobody cares about TT mode performance. It's too much slower. Don't 
ask me why (I've read on the web-site that signal delivery is very slow, even 
slower than a context switch, so TT mode is slower than SKAS, even if in TT 
mode there are no context switches at all). So the syscall cost is your 
problem. Try to run anything which is purely userspace, and if it does not do 
a lot of page faults (which are VERY slow), it will run at full speed.

If you want to do any test in SKAS mode, they are welcome. For the host patch, 
go to http://www.user-mode-linux.org/~blaisorblade/

Bye
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2004-10-05 18:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-04 21:35 [uml-devel] slow execution in uml? Young K
2004-10-05 18:21 ` BlaisorBlade [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-10-05 18:41 Young K

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=200410052021.25170.blaisorblade_spam@yahoo.it \
    --to=blaisorblade_spam@yahoo.it \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=young_uml@hotmail.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