All of lore.kernel.org
 help / color / mirror / Atom feed
From: mingzhe <mingzhe.zou@easystack.cn>
To: Eric Wheeler <bcache@lists.ewheeler.net>
Cc: Coly Li <colyli@suse.de>,
	Andrea Tomassetti <andrea.tomassetti-opensource@devo.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	linux-bcache@vger.kernel.org
Subject: Re: [RFC] Live resize of backing device
Date: Tue, 28 Feb 2023 10:46:18 +0800	[thread overview]
Message-ID: <ee891d7d-df93-e170-4ece-37d115c0fab2@easystack.cn> (raw)
In-Reply-To: <f4c4ecf3-6c86-dc72-d537-e2b9f2e2b490@ewheeler.net>



在 2023/2/28 06:08, Eric Wheeler 写道:
> On Mon, 20 Feb 2023, mingzhe wrote:
>> 在 2023/2/19 17:39, Coly Li 写道:
>>>> Subject: [PATCH v2] bcache: Add support for live resize of backing devices
>>>>
>>>> Signed-off-by: Andrea Tomassetti <andrea.tomassetti-opensource@devo.com>
>>>
>>> Hi Andrea,
>>>
>>> I am fine with this patch and added it in my test queue now. Do you have an
>>> updated version, (e.g. more coding refine or adding commit log), then I can
>>> update my local version.
>>>
>>>
>> Hi, Coly
>>
>> I posted some patchsets about online resize.
>>
>> -[PATCH v5 1/3] bcache: add dirty_data in struct bcache_device
>> -[PATCH v5 2/3] bcache: allocate stripe memory when partial_stripes_expensive
>> is true
>> -[PATCH v5 3/3] bcache: support online resizing of cached_dev
>>
>> There are some differences:
>> 1. Create /sys/block/bcache0/bcache/size in sysfs to trigger resize
> 
> Can the final version name the sysfs entry "resize", because "size" sounds
> like you are setting a specific size, not triggering a resize.
> 
> --
> Eric Wheeler
> 
OK. I will update a version.

mingzhe
> 
> 
>> 2. Allocate stripe memory only if partial_stripes_expensive is true
>> 3. Simplify bcache_dev_sectors_dirty()
>>
>> Since the bcache superblock uses some sectors, the actual space of the bcache
>> device is smaller than the backing. In order to provide a bcache device with a
>> user-specified size, we need to create a backing device with a larger space,
>> and then resize bcache. So resize can specify the size is very necessary.
>>
>>
>>
>>
>>>
>>>
>>>> ---
>>>> Hi Coly,
>>>> this is the second version of the patch. As you correctly pointed out,
>>>> I implemented roll-back functionalities in case of error.
>>>> I'm testing this funcionality using QEMU/KVM vm via libvirt.
>>>> Here the steps:
>>>>    1. make-bcache --writeback -B /dev/vdb -C /dev/vdc
>>>>    2. mkfs.xfs /dev/bcache0
>>>>    3. mount /dev/bcache0 /mnt
>>>>    3. dd if=/dev/random of=/mnt/random0 bs=1M count=1000
>>>>    4. md5sum /mnt/random0 | tee /mnt/random0.md5
>>>>    5. [HOST] virsh blockresize <vm-name> --path <disk-path> --size
>>>>    <new-size>
>>>>    6. xfs_growfs /dev/bcache0
>>>>    6. Repeat steps 3 and 4 with a different file name (e.g. random1.md5)
>>>>    7. umount/reboot/remount and check that the md5 hashes are correct with
>>>>          md5sum -c /mnt/random?.md5
>>>>
>>>> drivers/md/bcache/super.c | 84 ++++++++++++++++++++++++++++++++++++++-
>>>> 1 file changed, 83 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
>>>> index ba3909bb6bea..1435a3f605f8 100644
>>>> --- a/drivers/md/bcache/super.c
>>>> +++ b/drivers/md/bcache/super.c
>>>>>
>>>
>>> [snipped]
>>>
>>>
>>

  reply	other threads:[~2023-02-28  2:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03 10:05 [RFC] Live resize of backing device Andrea Tomassetti
2022-08-04 14:32 ` Coly Li
2022-08-05 19:38 ` Eric Wheeler
2022-09-06 13:22   ` Andrea Tomassetti
2022-09-08  8:32     ` Andrea Tomassetti
2022-09-19 11:42       ` Andrea Tomassetti
2022-09-19 12:16         ` Coly Li
2022-12-09  8:57           ` Andrea Tomassetti
2022-12-09  9:36             ` Coly Li
2022-12-30 10:40       ` Coly Li
2023-01-11 16:01         ` Andrea Tomassetti
2023-01-17 13:08           ` Error messages with kernel 6.1.[56] Pierre Juhen
2023-01-17 16:08             ` Coly Li
2023-01-17 16:18           ` [RFC] Live resize of backing device Coly Li
2023-01-25 10:07             ` Andrea Tomassetti
2023-01-25 17:59               ` Coly Li
2023-01-27 12:44                 ` Andrea Tomassetti
2023-01-27 22:40                   ` Eric Wheeler
2023-01-31 10:20                     ` Andrea Tomassetti
2023-02-02 17:18                   ` Coly Li
2023-02-02 20:48                     ` Eric Wheeler
2023-02-03  2:41                       ` Coly Li
2023-02-19  9:39                   ` Coly Li
2023-02-20  8:27                     ` mingzhe
2023-02-20 12:29                       ` Coly Li
2023-02-22  8:42                         ` Andrea Tomassetti
2023-02-27 22:08                       ` Eric Wheeler
2023-02-28  2:46                         ` mingzhe [this message]
2023-01-27  2:53               ` [RFC] Live resize of bcache " Eric Wheeler

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=ee891d7d-df93-e170-4ece-37d115c0fab2@easystack.cn \
    --to=mingzhe.zou@easystack.cn \
    --cc=andrea.tomassetti-opensource@devo.com \
    --cc=bcache@lists.ewheeler.net \
    --cc=colyli@suse.de \
    --cc=kent.overstreet@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 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.