From: Roman Mamedov <rm@romanrm.net>
To: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
Cc: Alexander Tomokhov <alexoundos@ya.ru>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Is it possible to have metadata-only device with no data?
Date: Mon, 6 Feb 2017 04:54:21 +0500 [thread overview]
Message-ID: <20170206045421.02e18d70@natsu> (raw)
In-Reply-To: <0dbbe15a-59f7-ef0e-1ed6-83fec7ef165a@mendix.com>
On Sun, 5 Feb 2017 22:55:42 +0100
Hans van Kranenburg <hans.van.kranenburg@mendix.com> wrote:
> On 02/05/2017 10:42 PM, Alexander Tomokhov wrote:
> > Is it possible, having two drives to do raid1 for metadata but keep data on a single drive only?
>
> Nope.
>
> Would be a really nice feature though... Putting metadata on SSD and
> bulk data on HDD...
>
You can play around with this hack just to see how that would perform, but it
comes with no warranty and untested even by me. I was going to try it, but put
it on hold since you'd also need to make sure the SSD is being preferred for
metadata reads (and not HDD), but so far have not figured out a simple way of
ensuring that.
--- linux-amd64-4.4/fs/btrfs/volumes.c.orig 2016-11-01 22:41:41.970978721 +0500
+++ linux-amd64-4.4/fs/btrfs/volumes.c 2016-11-01 22:58:45.958977731 +0500
@@ -4597,6 +4597,14 @@
if (total_avail == 0)
continue;
+ /* If we have two devices and one is less than 25% of the total FS size, then
+ * presumably it's a small device just for metadata RAID1, don't use it
+ * for new data chunks. */
+ if ((fs_devices->num_devices == 2) &&
+ (device->total_bytes * 4 < fs_devices->total_rw_bytes) &&
+ (type & BTRFS_BLOCK_GROUP_DATA))
+ continue;
+
ret = find_free_dev_extent(trans, device,
max_stripe_size * dev_stripes,
&dev_offset, &max_avail);
--
With respect,
Roman
next prev parent reply other threads:[~2017-02-05 23:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-05 21:42 Is it possible to have metadata-only device with no data? Alexander Tomokhov
2017-02-05 21:55 ` Hans van Kranenburg
2017-02-05 23:54 ` Roman Mamedov [this message]
2017-02-14 1:20 ` Alexander Tomokhov
2017-02-06 4:26 ` Duncan
2017-02-06 12:37 ` Austin S. Hemmelgarn
2017-02-05 22:27 ` Kai Krakow
2017-02-14 1:22 ` Alexander Tomokhov
2017-02-06 18:39 ` Omar Sandoval
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=20170206045421.02e18d70@natsu \
--to=rm@romanrm.net \
--cc=alexoundos@ya.ru \
--cc=hans.van.kranenburg@mendix.com \
--cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).