Mailinglist Archive: opensuse (1470 mails)

< Previous Next >
Re: [opensuse] experiences with bache / logic of caching
On Son, 2016-02-14 at 10:54 -0500, Anton Aylward wrote:
On 02/13/2016 07:51 PM, Olav Reinert wrote:
Because the cache is small, it only serves to speed up random
-access
reads of the active working set, and to speed up most writes
(writeback
cache mode).

The net effect is that, even though all data (including user home
directories) is stored on a pair of spinning disks, the cache
manages
to hide that fact well enough to make the machine feel very snappy
in
use - it's close enough to a real SSD for my needs.

Sorry, I can't give any concrete numbers to back up my experiences.
[cut]
One SMB manager described the use of a disc accelerator board, which
was
really a cache. It too had write-though. The write-though basically
released the system call immediately and wrote the block when
convenient.

Now historically, one of the changes from classical V6 UNIX to
classical
V7 UNIX back in the 1970s was that the file system changed the order
of
the writes to preserve the structural integrity. Data was written to
the disk before the metadata and pointers. I won't go into why that
ensured that FSCK could work properly, google for that yourself. But
it
is important that it was done that way. The use of this board
could
not guarantee that. A CompSci type from UofT warned of this. A
couple
of months later the SMB guy reported corrupted and unrecoverable
disk.
There was a "I told you so" feeling.

Committing to disk, and committing in the right order is important.

A write cache that 'accelerates' by releases the system call while
deferring the actual transfer from the cache to storage simply cannot
guarantee the integrity of the file system in the event of, for
example,
a power loss. Certainly a SSD, which will retain content, can, if
the
supporting software is there to do the job, ameliorate this. It gets
back to the issue of the window/timing. But there are a few too many
'ifs" in this to inspire confidence in an old cynic like me.
[cut]

I agree that caching can be non-trivial. As for write caching, bcache
also supports writethrough.

With writeback, bcache releases system calls as soon as the blocks
involved have been written to the SSD. Flushing to the underlying
storage happens later, asynchronously. Importantly, bcache guarantees
that the system can be safely shut down even if the cache is dirty; it
will resume flushing at the next reboot.

Regards,
Olav
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >