All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Karel Zak <kzak@redhat.com>, Naohiro Aota <Naohiro.Aota@wdc.com>
Cc: "util-linux@vger.kernel.org" <util-linux@vger.kernel.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Subject: Re: [PATCH v2 0/3] implement zone-aware probing/wiping for zoned btrfs
Date: Wed, 14 Apr 2021 22:04:55 +0000	[thread overview]
Message-ID: <BL0PR04MB6514EAAA034ADFFAFBF61CFCE74E9@BL0PR04MB6514.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20210414140946.j57uo7kvlfkpwsz3@ws.net.home

[-- Attachment #1: Type: text/plain, Size: 2591 bytes --]

On 2021/04/14 23:11, Karel Zak wrote:
> On Wed, Apr 14, 2021 at 10:33:36AM +0900, Naohiro Aota wrote:
>> This series implements probing and wiping of the superblock of zoned btrfs.
> 
> I have no disk with zones support, but it seems scsi_debug supports
> it. Do you have any step by step example how to test with btrfs? If
> yes, I will add a test to our test suite.

Yes, scsi_debug does support emulating a ZBC disk. You can setup a disk like this:

modprobe scsi_debug \
	max_luns=1 \
	sector_size=4096 \
	zbc=host-managed \
	dev_size_mb=2048 \
	zone_size_mb=64 \
	zone_nr_conv=0

This will create a 2GB capacity disk with 64 MB zones.
Another solution, may be simpler, is to use null_blk. I am attaching a script
that I use to create zoned null block devices.

# nullblk-create.sh --help
Usage: nullblk-create.sh [options]
Options:
    -h | --help      : Display this help message and exit
    -v               : Be verbose (display final config)
    -cap <size (GB)> : set device capacity (default: 8)
                       For zoned devices, capacity is determined
                       with zone size and total number of zones
    -bs <size (B)>   : set sector size (default: 512)
    -m               : enable memory backing (default: false)
    -z               : create a zoned device (default: false)
    -qm <mode>       : set queue mode (default: 2)
                       0=bio, 1=rq, 2=multiqueue
    -sq <num>        : set number of submission queues
                       (default: nproc)
    -qd <depth>      : set queue depth (default: 64)
    -im <mode>       : set IRQ mode (default: 0)
                       0=none, 1=softirq, 2=timer
    -c <nsecs>       : set completion time for timer completion
                       (default: 10000 ns)
Options for zoned devices:
    -zs <size (MB)>  : set zone size (default: 8 MB)
    -zc <size (MB)>  : set zone capacity (default: zone size)
    -znc <num>       : set number of conv zones (default: 0)
    -zns <num>       : set number of swr zones (default: 8)
    -zr              : add a smaller runt swr zone (default: none)
    -zmo <num>       : set max open zones (default: no limit)
    -zma <num>       : set max active zones (default: no limit)

Something like this:

# nullblk-create.sh -m -cap 2 -z -zs 64 -znc 0
Created /dev/nullb0

Will also create a 2GB capacity disk with memory backing and 64 MB zones.

For the correct setup of the drive to test btrfs, I will let Naohiro and
Johannes comment.

-- 
Damien Le Moal
Western Digital Research

[-- Attachment #2: nullblk-create.sh --]
[-- Type: application/x-sh, Size: 3574 bytes --]

  reply	other threads:[~2021-04-14 22:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  1:33 [PATCH v2 0/3] implement zone-aware probing/wiping for zoned btrfs Naohiro Aota
2021-04-14  1:33 ` [PATCH v2 1/3] blkid: implement zone-aware probing Naohiro Aota
2021-04-14  9:14   ` Damien Le Moal
2021-04-14  9:17   ` Johannes Thumshirn
2021-04-14 13:31   ` Karel Zak
2021-04-14 15:03     ` Naohiro Aota
2021-04-14  1:33 ` [PATCH v2 2/3] blkid: add magic and probing for zoned btrfs Naohiro Aota
2021-04-14  9:49   ` Johannes Thumshirn
2021-04-14 13:47   ` Karel Zak
2021-04-14 15:08     ` Naohiro Aota
2021-04-16 15:52   ` David Sterba
2021-04-26  1:38     ` Naohiro Aota
2021-04-14  1:33 ` [PATCH v2 3/3] blkid: support zone reset for wipefs Naohiro Aota
2021-04-14  9:13   ` Damien Le Moal
2021-04-14  9:50   ` Johannes Thumshirn
2021-04-14 13:57   ` Karel Zak
2021-04-16 16:04     ` David Sterba
2021-04-14 14:09 ` [PATCH v2 0/3] implement zone-aware probing/wiping for zoned btrfs Karel Zak
2021-04-14 22:04   ` Damien Le Moal [this message]
2021-04-22 14:41 ` Karel Zak

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=BL0PR04MB6514EAAA034ADFFAFBF61CFCE74E9@BL0PR04MB6514.namprd04.prod.outlook.com \
    --to=damien.lemoal@wdc.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=Naohiro.Aota@wdc.com \
    --cc=kzak@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=util-linux@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.