public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
From: Kai Krakow <hurikhan77@gmail.com>
To: linux-bcache@vger.kernel.org
Subject: Re: caching device setup
Date: Sat, 11 Apr 2015 00:26:06 +0200	[thread overview]
Message-ID: <u8vlvb-ciu.ln1@hurikhan77.spdns.de> (raw)
In-Reply-To: 55265CE0020000E100020423@relay2.provo.novell.com

Lidong Zhong <lzhong@suse.com> schrieb:

>>>> On 4/9/2015 at 02:56 AM, in message
>>>> <98agvb-l7r.ln1@hurikhan77.spdns.de>, Kai
> Krakow <hurikhan77@gmail.com> wrote:
>> David Mohr <david@mcbf.net> schrieb:
>>  
>> > On 2015-04-06 09:44, arnaud gaboury wrote:
>> >> Here is my overall plan:
>> >>  
>> >> root filesystem & OS on a SSD
>> >> DB and other stuff on HD.
>> >> Use ssd as caching device and HD as backing.
>> >>  
>> >> Shall I partition the SSD with : one partition for OS and one empty
>> >> for bcache? Or install the OS on the whole SSD and use the whole SSD
>> >> as caching device?
>> >>  
>> >> Thank you for hint.
>> >  
>> > So this is just depending on your preference, how big the SSD is, and
>> > how much space you expect your OS to take up.
>> >  
>> > Personally I split my SSD into two partitions: one for the root FS, and
>> > the other as a caching device for /home.
>>  
>> The other preference is valid, too: I chose to put bcache only on the SSD
>> to
>>  
>> get maximum benefit from its capacity, rootfs and home dynamically share
>> the
>>  
> I am curious about how rootfs and home share the SSD dynamically. Are they
> on the same partition? Sorry for stupid questions since I just touched
> bcache recently.

Cache and backing device association is not 1:1. You can attach multiple 
backing partitions (even from distinct filesystems) to the one and same 
caching partition. So, accesses to one of the cached filesystems will go 
through the same bcache, thus sharing the cache space through bcache's LRU 
implementation (or if you change it from the default, even something else 
like LRU).

Here's my setup (shortened):

├─sdb3        8:19   0  79,5G  0 part
│ ├─bcache0 252:0    0 925,5G  0 disk
│ ├─bcache1 252:1    0 925,5G  0 disk
│ └─bcache2 252:2    0 925,5G  0 disk

with sdb3 being the one and only bcache partition on SSD:

$ ls -al /sys/fs/bcache/
insgesamt 0
drwxr-xr-x  3 root root    0 11. Apr 00:25 .
drwxr-xr-x 11 root root    0  6. Apr 19:07 ..
drwxr-xr-x  7 root root    0  8. Apr 20:33 bf2b67f9-a261-4d27-
a6ef-2961f2ce2cc2
--w-------  1 root root 4096  8. Apr 20:33 register
--w-------  1 root root 4096  6. Apr 19:08 register_quiet

$ ls -al /sys/fs/bcache/bf2b67f9-a261-4d27-a6ef-2961f2ce2cc2/
insgesamt 0
drwxr-xr-x 7 root root    0 11. Apr 00:25 .
drwxr-xr-x 3 root root    0 11. Apr 00:25 ..
-r--r--r-- 1 root root 4096  8. Apr 20:33 average_key_size
lrwxrwxrwx 1 root root    0  8. Apr 20:33 bdev0 -> 
../../../devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/block/sdc/sdc2/bcache
lrwxrwxrwx 1 root root    0  8. Apr 20:33 bdev1 -> 
../../../devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/block/sdd/sdd2/bcache
lrwxrwxrwx 1 root root    0  8. Apr 20:33 bdev2 -> 
../../../devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sde/sde2/bcache
-r--r--r-- 1 root root 4096  8. Apr 20:33 block_size
-r--r--r-- 1 root root 4096  8. Apr 20:33 btree_cache_size
-r--r--r-- 1 root root 4096  8. Apr 20:33 bucket_size
lrwxrwxrwx 1 root root    0  8. Apr 20:33 cache0 -> 
../../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sdb/sdb3/bcache
[...]


-- 
Replies to list only preferred.

  reply	other threads:[~2015-04-10 22:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 15:44 caching device setup arnaud gaboury
2015-04-06 15:57 ` David Mohr
2015-04-08 18:56   ` Kai Krakow
2015-04-09  3:05     ` Lidong Zhong
2015-04-10 22:26       ` Kai Krakow [this message]
2015-04-13  7:58         ` Lidong Zhong
2015-04-09  3:08     ` Lidong Zhong
     [not found] ` <CAPBO7TY13PYVh3d0bt3tkc_+_vJVybCy-kBBT223VfPmQkjuWw@mail.gmail.com>
2015-04-06 17:44   ` arnaud gaboury

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u8vlvb-ciu.ln1@hurikhan77.spdns.de \
    --to=hurikhan77@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox