Re: Disk caching

From: Michael T. Babcock (mikebabcock@pobox.com)
Date: Thu Apr 20 2000 - 12:04:54 EST


Mark Hahn wrote:

> > I was wondering if the Linux kernel's disk cache algorithms take into
> > account caches on specific devices, whether the hard drives or a raid
> > controller.
>
> no, they don't. but how could they?

They could easily know if the drive has caching at all. It would be
relatively simple to allow for an "echo 0 > /proc/ide/ide0/hdb/cache_toggle"
based on the contents of /proc/ide/ide0/hdb/cache ... or at least a priority
scheme (like swap file usage) allowing the caching of a drive, but at a very
low memory usage priority (expires much faster).

> but how? the kernel has no way to know what's in the drive cache, no
> control, no information, so no use for it.

It doesn't have to know what's cached, although that would be a neat trick.
That's not relevant here.

> drive cache is when the drive guesses prefetching correctly,
> or if it can reorder commands to schedule seeks better than the OS does,
> or if you enable lazy/writeback caching on the disk.

I don't care if the kernel knows about it; I know about it, and my drive with
4M on-drive is faster than the one with 2M on-drive and I'll bet you its the
caching algorithms ... I just don't want Linux wasting memory caching these
accesses data at all. And yes, I have writeback caching on my drives with a
battery backup controller and machine.

> > In reality, I'm using a DPT RAID V Century controller with 16M of
> > on-board ECC RAM and will be upgrading that in the next few months.
>
> it's useless to Linux, unless the controller's cpu takes so long
> computing parity that it's necessary.

Its quite useful, actually, and yes, the controller does elevator sorting,
command queuing, write back caching and everything else you can think of.
Its much more efficient than the kernel so far, and I think thats
expectable. What I think is a waste is for the kernel to be doing this work
at all on this machine.

> again, the kernel has no knowlege or control over what the controller
> caches, therefore it's useless.

wrong.

> controller and disk cache is basically useless, unless they're
> doing better readahead, writebehind or head scheduling than the kernel.

The fact that they allow me my 132M/sec over my Ultra2Wide bus doesn't count?

--
               _____/~-=##=-~\_____
       -=+0+=-< Michael T. Babcock >-=+0+=-
               ~~~~~\_-=##=-_/~~~~~
http://www.linuxsupportline.com/~pgp/ ICQ: 4835018

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:18 EST