Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Wang Shilong <wangshilong1991@gmail.com>,
	Hans van Kranenburg <hans@knorrie.org>
Cc: "Stéphane Lesimple" <stephane_btrfs@lesimple.fr>,
	"Btrfs BTRFS" <linux-btrfs@vger.kernel.org>
Subject: Re: Metadata chunks on ssd?
Date: Tue, 24 Dec 2019 07:40:48 -0500	[thread overview]
Message-ID: <8a45940d-6634-e49d-cfde-e7087060c060@gmail.com> (raw)
In-Reply-To: <CAP9B-QkL60aELFZzOzZStbAz2UWj11V8YNPtSWWgwzeEnbLpvQ@mail.gmail.com>

On 2019-12-23 21:04, Wang Shilong wrote:
> On Tue, Dec 24, 2019 at 7:38 AM Hans van Kranenburg <hans@knorrie.org> wrote:
>>
>> Hi Stéphane,
>>
>> On 12/23/19 2:44 PM, Stéphane Lesimple wrote:
>>>
>>> Has this ever been considered to implement a feature so that metadata
>>> chunks would always be allocated on a given set of disks part of the btrfs
>>> filesystem?
>>
>> Yes, many times.
>>
> 
> I implement it locally before for my local testing before.
> 
>>> As metadata use can be intensive and some operations are known to be slow
>>> (such as backref walking), I'm under the (maybe wrong) impression that
>>> having a set of small ssd's just for the metadata would give quite a boost
>>> to a filesystem. Maybe even make qgroups more usable with volumes having 10
>>> snapshots?
>>
>> No, it's not wrong. For bigger filesystems this would certainly help.
>>
>>> This could just be a preference set on the allocator,
>>
>> Yes. Now, the big question is, how do we 'just' set this preference?
>>
>> Be sure to take into account that the filesystem has no way to find out
>> itself which disks are those ssds. There's no easy way to discover this
>> in a running system.
>>
> 
> No, there is API for filesystem to detect whether lower device is SSD or not.
> Something like:
>         if (!blk_queue_nonrot(q))
>                  fs_devices->rotating = 1;
> 
> Currently, btrfs will treat filesystem as rotational disks if any of
> one disk is rotational,
> We might record how many non-rotational disks, and make chunk allocation try SSD
> firstly if it possible.
This doesn't tell you that the device is an SSD though, just that it 
reports to the kernel as non+rotational. For example, NBD devices 
present as non-rotational by default, and in most cases you do _not_ 
want hot data on a network disc.

The important thing here is disk performance, not whether it's an SSD or 
not. An SD card is non-rotational and solid-state, but on most systems 
the performance is going to be sufficiently bad for BTRFS-type workloads 
that it's almost useless for this type of thing.
> 
>>> so that a 6 disks
>>> raid1 FS with 4 spinning disks and 2 ssds prefer to allocate metadata on
>>> the ssd than on the slow drives (and falling back to spinning disks if ssds
>>> are full, with the possibility to rebalance later).
>>>
>>> Would such a feature make sense?
>>
>> Absolutely.
>>
>> Hans
>>


  parent reply	other threads:[~2019-12-24 12:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23 13:44 Metadata chunks on ssd? Stéphane Lesimple
2019-12-23 13:59 ` Hugo Mills
2019-12-23 23:30 ` Hans van Kranenburg
2019-12-24  2:04   ` Wang Shilong
2019-12-24  8:20     ` Stéphane Lesimple
2019-12-24 12:40     ` Austin S. Hemmelgarn [this message]
2019-12-24 12:58       ` Stéphane Lesimple

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=8a45940d-6634-e49d-cfde-e7087060c060@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=hans@knorrie.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=stephane_btrfs@lesimple.fr \
    --cc=wangshilong1991@gmail.com \
    /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