Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Recently I'm seeing 2 different values in computer stores for hard disk cache. (2MB and 8MB)
but I'm wondering, my Linux system uses 300MB of free main memory as disk cache. how does this relate to the 8MB cache on the disk itself? Does this memory cache make the hd-cache useless, or is there something else stored in there?
they are completely different. the disk cache buffer will store frequently accessed hard disk sectors to make it quicker to access the same data again. where as the memory cache saves pages of memory that have been used frequently. these two sets of data do not really overlap.
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
the hard disk cache on the drive itself is optimized for the drive, and uses read-ahead and
all kinds of cool stuff. there is almost nothing you can do to configure that.
it isn't to be messed with.
linux uses unused ram as disk cache. as soon as a program needs some
more ram, linux will dump the oldest data in the disk cache to give to the
program. that's what you want it to do.
netbsd will let you configure the percentage of ram to use as disk cache, and
will leave it fixed.
if you open up a whole bunch of programs, and i mean a bunch, you will
see the amount of ram used as cache go down.
thanks for your explaination. I think I got it now.
* though the ext2 drivers also perform readaheads, is the disk cache far more optimized for the disk, and at a low level?
* because the cache is an internal feature of the hard disk, it runs independantly without any control from the kernel? (ie. perform readheads while your computer is busy with other things)
* This cache contains data you're about to read, but the Linux cache contains data that has been read?
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
i think the best thing about a big cache on the hard drive itself, is that the
controller can blast bigger chunks of data to the drive, and go do something
else. the data moving between the hard drive, and down that cable is much
slower than your ram. much much slower. but data from that hard drive
cache can be moved several times faster than the actual data from the
hard drive. so the drive's cache speeds up the slowest thing, the drive itself,
and the system ram data cache speeds up the slower thing, ( by not having
to go to it as often), the hard drive's cache. you may just as well think of
it as your processor's cache. ram > faster ram(cache) > even faster ram
(smaller faster cache) > processor.
platters > drive cache > system ram drive cache.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.