Re: how does the caching works in bcachefs

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

 



On Wed, Jul 08, 2020 at 11:46:00PM +0200, Stefan K wrote:
> Hello,
> 
> short question: how does the caching works with bcachefs? Is it like  "first
> in first out" or is it more complex like the ARC system in zfs?

LRU, same as bcache.

> The same with the write-cache,  will be everything written to the SSD/NVMe
> (Cache) and then to the HDD? When will will the filesystem say "its written to
> disk"? And what happens with the data on the write cache if we have a
> powerfail?

Disks that are used as caches are treated no differently from other disks by the
filesystem. If you want bcachefs to not rely on a specific disk, you can set its
durability to 0, and then it'll basically only be used as a writethrough cache.

> 
> And can I say have this file/folder always in the cache, while it works "normal" ?

Yes.

So caching is configured differently, specifically so that it can be configured
on a per file/directory basis. Instead of having a notion of "cache device",
there are options for
 - foregroud target: which device or group of devices are used for foreground
   writes
 - background target: if enabled, the rebalance thread will in the background
   move data to this target in the background, leaving a cached copy on the
   foreground target
 - promote target: if enabled, when data is read and it doesn't exist in this
   target, a cached copy will be added there

So these options can be set to get you writeback mode, by setting foreground
target and promote target to your SSD and background target to your HDD.

And you can pin specific files/folders to a device, by setting foreground target
to that device and setting background target and promote target to nothing.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM Kernel]     [Linux Filesystem Development]     [Linux Bcache]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux