Message-ID: <3CE05FC7.9081278D@sympatico.ca>
From: Lew Pitcher <lpitcher@sympatico.ca>
X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.2.20 i686)
X-Accept-Language: en, en-GB, en-US, fr-CA
MIME-Version: 1.0
Newsgroups: comp.os.minix
Subject: Re: math calculation? urgent please help
References: <3cde3621_2@news.tm.net.my>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 52
Date: Mon, 13 May 2002 20:52:23 -0400
NNTP-Posting-Host: 64.228.39.171
X-Complaints-To: abuse@sympatico.ca
X-Trace: news20.bellglobal.com 1021354190 64.228.39.171 (Tue, 14 May 2002 01:29:50 EDT)
NNTP-Posting-Date: Tue, 14 May 2002 01:29:50 EDT
Organization: Bell Sympatico
Path: bunyip.cc.uq.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sunqbc.risq.qc.ca!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!merlin.l6s4x6-4.ca!nobody
Xref: bunyip.cc.uq.edu.au comp.os.minix:38762
X-Cache: nntpcache 1.0.7.1 (see ftp://suburbia.net/pub/nntpcache)

al wrote:
> 
> Hi,
> 
> I got a mathematical problem here, please help and give opinion please:
> 
> I have:
> - a 64k program to be loaded from a disk
> - the disk seek time is 30msec
> - the disk rotation time is 20msec
> - the disk tracks hold 32k for a 2k page size
> - objective: calculate the time taken to load the 64k program from the disk
> (note: pages are spread randomly around the disk)
> 
> Below is my calculation:
> 
> - With 2k page size, 32 pages is needed to load 64k program.
> - 1 page of 2k page size needs 30msec (seek time) + 20msec (rotation time) =
> 50msec to load
> - therefore 32 pages needs 32 * 50msec = 1600msec to load.
> 
> Is my calculation above make sense or this is not the correct way to
> calculate it.

No. Your calculation fails to recognize the "disk track holds 32k"

Your 64K program is made up of 32 'pages', and one disk track can hold
(by your figures) 16 'pages'.
Assuming that a page read and transfer to memory completes before the
read head encounters the nest page, your number should be
  20ms (one rotation = 16 pages) + 30ms (seek to next track) + 20ms (one
rotation = 16 pages)
= 70ms

Of course, sectors are not usually organized in such a convenient
manner, and it usually takes many rotations of the disk to gather all
track's sectors sequentially, so this number becomes
= (N * 20ms) + 30ms + (N * 20ms)
where N is an unknown "interleaving" constant, and is dependant on the
physical makeup of your disk drive.

Then, of course, the filesystem can layer some delays on top of this, so
this number will likely grow larger again.




-- 
Lew Pitcher

Master Codewright and JOAT-in-training
Registered (Slackware) Linux User #112576 (http://counter.li.org/)
