Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 2002 11:43:40 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Zhihui Zhang <zzhang@cs.binghamton.edu>
Cc:        Doug White <dwhite@resnet.uoregon.edu>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Collect process sleeping statistics
Message-ID:  <3CE2AC5C.5B511B16@mindspring.com>
References:  <Pine.SOL.4.21.0205151325290.17622-100000@onyx>

next in thread | previous in thread | raw e-mail | index | archive | help
Zhihui Zhang wrote:
> Basically I have a program that does a lot of I/O and alloctes/frees a lot
> of memory. The time command gives result like this:
> 
> 6.239u 19.329s 7:59.76 5.3%     310+775k 3993+246io 7pf+0w
> 
> I want to know why CPU is running only 5.3% of the total time. I just
> want know how long it is waiting for memory and how long it is waiting for
> I/O.  No other process is running at the same time.

You got 7 page faults with 0 waits.

So it was waiting for I/O 94.7% of the time.  That's statistical;
the real calculation is 100% - 246/3993 = 93.8%.

Generally, this comes down to a design issue that's very common
in code these days, particularly code where people think "threads
solve all concurrency problems".

I think I should patent the correct way of solving this problem,
since no one seems to use it.  I'll call it "interleaved I/O"...

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CE2AC5C.5B511B16>