From: xuehai zhang <hai@cs.uchicago.edu>
To: "Petersson, Mats" <mats.petersson@amd.com>
Cc: Kate Keahey <keahey@mcs.anl.gov>,
Tim Freeman <tfreeman@mcs.anl.gov>,
xen-devel@lists.xensource.com
Subject: Re: a question about popen() performance on domU
Date: Fri, 25 Nov 2005 18:37:13 -0600 [thread overview]
Message-ID: <4387AE39.7030300@cs.uchicago.edu> (raw)
In-Reply-To: <907625E08839C4409CE5768403633E0B0EAAB8@sefsexmb1.amd.com>
>>waitpid is called by pclose as shown in the glibc source
>>code. So, my original post questioning the performance of
>>popen should take pclose into consideration too. A more
>>accurate question I should post is, popen+pclose executes
>>faster on my VM than my physical machine. The popen/pclose
>>benchmark I did narrows the problem down to waitpid that
>>waitpid somehow is suffering on the physical machine.
>>So, I did a followup experiment to test the fork and waitpid
>>performance on both machines. The program is a loop of fork
>>call with a followup waitpid call. The source of the program
>>and the strace results are available at
>>http://people.cs.uchicago.edu/~hai/tmp/gt2gram/strace-fork/str
>>ace.txt. The strace results confirm the waitpid costs more
>>time on the physical machine (154 usec/call) than the VM (56
>>usec/call).
>>However, the program runs faster on the physical machine (not
>>like the popen/pclose program) and the results suggest the
>>fork syscall used on the VM costs more time than the clone
>>syscall on the physical machine. I have a question here, why
>>the physical machine doesn't use fork syscall but the clone
>>syscall for the same program?
>
>
> Because it's using the same source for glibc! glibc says to use
> _IO_fork(), which is calling the fork syscall. Clone would probably do
> the same thing, but for whatever good or bad reason, the author(s) of
> thise code chose to use fork. There may be good reasons, or no reason at
> all to do it this way. I couldn't say. I don't think it makes a whole
> lot of difference if the actual command executed by popen is actually
> "doing something", rather than just an empty "return".
Mats,
I am not very sure about your comment in the last sentence. Are you suggesting the command passed to
popen should have no big effect on popen's performance?
Thanks.
Xuehai
next prev parent reply other threads:[~2005-11-26 0:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-24 14:47 a question about popen() performance on domU Petersson, Mats
2005-11-24 15:40 ` xuehai zhang
2005-11-26 0:37 ` xuehai zhang [this message]
2005-11-27 5:30 ` Errors installing Vnet Rustam Bhote
-- strict thread matches above, loose matches on Subject: below --
2005-11-28 10:01 a question about popen() performance on domU Petersson, Mats
2005-11-24 15:51 Petersson, Mats
2005-11-24 10:07 Petersson, Mats
2005-11-24 14:02 ` xuehai zhang
2005-11-23 20:25 xuehai zhang
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=4387AE39.7030300@cs.uchicago.edu \
--to=hai@cs.uchicago.edu \
--cc=keahey@mcs.anl.gov \
--cc=mats.petersson@amd.com \
--cc=tfreeman@mcs.anl.gov \
--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.