[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hard disk slows linux system



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 14 May 2003 00:33, Rus Foster wrote:
> Hi,
> Assuming you have got IDE disks then you want to look at hdparm. This
> can switch on DMA etc. Try running hdparm /dev/hda to see what you have

As for why increasing the speed of the HD helps, well... it doesn't.
The reason enabling DMA works is because the fall-back mode, PIO, sends all 
data through the CPU (using *polling*!) instead of writing directly to 
memory.
That is, with PIO there are *at least* two memory writes and reads per 
request, all mediated by the CPU (not to mention polling the IDE bus).
Compare DMA, where there would be the same number of writes/reads, or half if 
zero-copy is implemented, and only the read (plus one read/write w/o 
zero-copy) part is done by the CPU.
No polling, either, which is what takes most of the time, really.

The reason PIO is actually faster for the HD as well is that polling the IDE 
bus too much kills bandwidth/latency and modern drives *need* that, whereas 
polling seldom would cause a buffer overflow in the HD...

(On a sidenote, is there any need for HDs with lots of cache on a proper OS, 
with DMA enabled, which caches stuff in the much more plentiful - not to 
mention faster - main RAM anyway?)

- -- 
On the night before her family moved from Kansas to California, the little
girl knelt by her bed to say her prayers.  "God bless Mommy and Daddy and
Keith and Kim," she said.  As she began to get up, she quickly added, "Oh,
and God, this is goodbye.  We're moving to Hollywood."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+wnoV9OlFkai3rMARAgfOAJ42ErxEcOZv6FdlTD5dDgkuqTK5QgCdFtP5
urlu0Bk1Iy2qh9uBaLnYZs8=
=XGlz
-----END PGP SIGNATURE-----



Reply to: