|
|
Log in / Subscribe / Register

Bcache: Caching beyond just RAM

Bcache: Caching beyond just RAM

Posted Jul 9, 2010 12:27 UTC (Fri) by eludias (guest, #4058)
Parent article: Bcache: Caching beyond just RAM

How will O_DIRECT be handled? I need this to circumvent any caching layer to keep my hardware healthy.

Background: I've also got one of those nasty WD Caviar Green (1Tb) drives, and there is a feature in the firmware of the drives which auto-parks the heads after 8 seconds of inactivity. This interacts quite badly with an OS which saves its data once per 30 seconds, resulting in a drive worn down in about 6 months.

Now the way to circumvent this behaviour is to read something from the drive, say once per 5 seconds. And the most efficient way to do so is to read from the cache of the drive, so we re-read sector 0 over and over again. With O_DIRECT we can bypass the disk cache of Linux traditionally, but will this also be the case when using bcache?


to post comments

O_DIRECT read of sector 0

Posted Jul 9, 2010 15:37 UTC (Fri) by wstearns (guest, #4102) [Link] (2 responses)

Since bcache can only cache individual filesystems and I assume your actual filesystems are on partitions (as opposed to a single filesystem covering the entire drive), bcache won't be caching sector 0 as that's not part of a filesystem.

O_DIRECT read of sector 0

Posted Jul 10, 2010 10:45 UTC (Sat) by eludias (guest, #4058) [Link] (1 responses)

I was under the impression that bcache cached block devices (hence the name ), and not filesystems. But you have a good point: if I would cache the partition and not the whole device, I might be able to circumvent it by reading outside the partition.

O_DIRECT read of sector 0

Posted Jul 10, 2010 21:13 UTC (Sat) by wstearns (guest, #4102) [Link]

You're correct; bcache does cache block devices. I phrased it poorly; the idea I failed to get across was that the filesystems we'd normally submit to bcache to cache are on individual partitions (which linux treats as block devices) as opposed to the entire drive, allowing you to bypass bcache on sector 0 and still cache the partitions.

Bcache: Caching beyond just RAM

Posted Jul 12, 2010 9:16 UTC (Mon) by etienne (guest, #25256) [Link]

> there is a feature in the firmware of the drives which auto-parks the heads after 8 seconds of inactivity

Probably maximum power saving more, you can usually see/adjust (and save the setup) using hdparm.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds