All of lore.kernel.org
 help / color / mirror / Atom feed
* Few questions on bcache internals
@ 2016-02-25  1:38 Pradeep Fernando
  2016-02-25  4:20 ` Eric Wheeler
  0 siblings, 1 reply; 3+ messages in thread
From: Pradeep Fernando @ 2016-02-25  1:38 UTC (permalink / raw)
  To: linux-bcache

Hi All,

I'm trying to get familiar with the bcache internals. I went through
this detailed write-up [1] and
looked in to the code found in stable Linux kernel release (not the
latest bcache code) as well.

I have few questions on the topic.

Here is my abstract model on how bcache work.

- format the caching device and the backing device with its own bucket
based file system (bcacheFS)
- exposes a virtual block device to the applications (/dev/bcache0)
- the data is organized as buckets, indexed by b+tree structures and
auxilary search structures.
- when a request comes in, search the b+tree based on <inode:offset>
and try finding the data
on caching device, else send the request to backing device.


1. Why bcache refers to inodes ? The block driver layer does not have
an idea about the file system layed on top of it. (ext4). Is this
inode refers to device file? As per my
understanding the block layer gets bio_structure, it does not have a
notion of inodes...

2. How the cache eviction work. ? for an example in processor caches
we evict the cache lines
within a set in a set associative cache using LRU/etc. How does
eviction happens in bcache/policy?

3. Can i use any file system in backing device other than bcacheFS. ?
My abstract model on bcache says NO.

I'm new to Linux driver programming. so I might be missing few trivial
details and hence the confusion..
appreciate if someone can shed some light on the above questions...

[1] bcache.evilpiepirate.org/BcacheGuide

thanks
Pradeep

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Few questions on bcache internals
  2016-02-25  1:38 Few questions on bcache internals Pradeep Fernando
@ 2016-02-25  4:20 ` Eric Wheeler
  2016-02-25  6:11   ` Eric Wheeler
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wheeler @ 2016-02-25  4:20 UTC (permalink / raw)
  To: Pradeep Fernando; +Cc: linux-bcache


On Wed, 24 Feb 2016, Pradeep Fernando wrote:

> Hi All,
> 
> I'm trying to get familiar with the bcache internals. 

do you mean bcache or bcachefs?

> I went through this detailed write-up [1] and looked in to the code 
> found in stable Linux kernel release (not the latest bcache code) as 
> well.
> 
> I have few questions on the topic.
> 
> Here is my abstract model on how bcache work.
> 
> - format the caching device and the backing device with its own bucket
> based file system (bcacheFS)

bcachefs is new and still in development.  Eventually its caching code 
will supply bcache with a cache superblock version 2 and better 
performance. bcache is available from mainline since 3.10 iirc.

> - exposes a virtual block device to the applications (/dev/bcache0)

yes

> - the data is organized as buckets, indexed by b+tree structures and
> auxilary search structures.

That sounds reasonable, though I've not been digging in the metadata 
structure.

> - when a request comes in, search the b+tree based on <inode:offset>

Maybe in bcachefs, but not in bcache at the block layer (current in-kernel 
version).

> and try finding the data on caching device, else send the request to 
> backing device.
> 
> 
> 1. Why bcache refers to inodes ? The block driver layer does not have
> an idea about the file system layed on top of it. (ext4). Is this
> inode refers to device file? As per my
> understanding the block layer gets bio_structure, it does not have a
> notion of inodes...

You're probably looking at bcachefs, not bcache.

If you're interested in looking at bcache, it would be great if you can 
check out the most recent list issues and see if there is one you can work 
on: the "Re: BUG: drivers/md/bcache/writeback.c:237" thread, for example.

Also there are some places that could use a mempool.

> 2. How the cache eviction work. ? for an example in processor caches
> we evict the cache lines
> within a set in a set associative cache using LRU/etc. How does
> eviction happens in bcache/policy?

configurable: lru/fifo

> 3. Can i use any file system in backing device other than bcacheFS. ?
> My abstract model on bcache says NO.

bcache, yes.  bcachefs, no (without loopback)

-Eric

> I'm new to Linux driver programming. so I might be missing few trivial
> details and hence the confusion..
> appreciate if someone can shed some light on the above questions...
> 
> [1] bcache.evilpiepirate.org/BcacheGuide
> 
> thanks
> Pradeep
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Few questions on bcache internals
  2016-02-25  4:20 ` Eric Wheeler
@ 2016-02-25  6:11   ` Eric Wheeler
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wheeler @ 2016-02-25  6:11 UTC (permalink / raw)
  To: Pradeep Fernando; +Cc: linux-bcache

> > 1. Why bcache refers to inodes ? The block driver layer does not have
> > an idea about the file system layed on top of it. (ext4). Is this
> > inode refers to device file? As per my
> > understanding the block layer gets bio_structure, it does not have a
> > notion of inodes...
> 
> You're probably looking at bcachefs, not bcache.
> 
> If you're interested in looking at bcache, it would be great if you can 
> check out the most recent list issues and see if there is one you can work 
> on: the "Re: BUG: drivers/md/bcache/writeback.c:237" thread, for example.
> 
> Also there are some places that could use a mempool.

It also occurs to me that we need a refactor around the cache 
functionality so it can take function pointers for per-cache-version 
cache volume operations.

-Eric

> 
> > 2. How the cache eviction work. ? for an example in processor caches
> > we evict the cache lines
> > within a set in a set associative cache using LRU/etc. How does
> > eviction happens in bcache/policy?
> 
> configurable: lru/fifo
> 
> > 3. Can i use any file system in backing device other than bcacheFS. ?
> > My abstract model on bcache says NO.
> 
> bcache, yes.  bcachefs, no (without loopback)
> 
> -Eric
> 
> > I'm new to Linux driver programming. so I might be missing few trivial
> > details and hence the confusion..
> > appreciate if someone can shed some light on the above questions...
> > 
> > [1] bcache.evilpiepirate.org/BcacheGuide
> > 
> > thanks
> > Pradeep
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-25  6:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-25  1:38 Few questions on bcache internals Pradeep Fernando
2016-02-25  4:20 ` Eric Wheeler
2016-02-25  6:11   ` Eric Wheeler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.