On Mon, May 15, 2023 at 4:46 AM Damien Le Moal <dlemoal@xxxxxxxxxx> wrote: > >> > >> === > >> At another terminal, > >> > >> root@smr_dev:~# ps aux | grep mkfs.ext4 > >> root 1411791 2.8 0.0 30992 19864 pts/1 D+ 01:30 0:01 > >> mkfs.ext4 /dev/dm-0 > >> root 1413640 0.0 0.0 13972 2496 pts/0 S+ 01:31 0:00 > >> grep mkfs.ext4 > >> > >> root@smr_dev:~# cat /proc/1411791/stack > >> [<0>] wait_on_page_bit+0x133/0x270 > >> [<0>] wait_on_page_writeback+0x25/0x70 > >> [<0>] __filemap_fdatawait_range+0x86/0xf0 > >> [<0>] file_write_and_wait_range+0x74/0xb0 > >> [<0>] blkdev_fsync+0x16/0x40 > >> [<0>] do_fsync+0x38/0x60 > >> [<0>] __x64_sys_fsync+0x10/0x20 > >> [<0>] do_syscall_64+0x2d/0x70 > >> [<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > Not sure if this is a bug, but doing a simple mkfs.ext4 on dm-zoned with a large > SMR disk can take *a very loooooong* time. This is because mkfs.ext4 does a lot > of random writes all over the place. So just running that, dm-zoned goes into > heavy GC mode... > > To speed things up (and improve runtime performance), use the packed-metadata > format: mkfs.ext4 -E packed_meta_blocks=1 > Or do a mkfs.xfs to compare and see how much faster it is. My SMR disk is 24T, 969 conventional zones + 95891 sequential zones, each zone is 256M. Amazingly, mkfs.xfs only takes ~8 seconds and mkfs.ext4 -E packed_meta_blocks=1 only takes 32 seconds. Thanks! root@smr_dev:~# time mkfs.xfs /dev/dm-3 meta-data=/dev/dm-3 isize=512 agcount=24, agsize=268435455 blks = sectsz=4096 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=0 data = bsize=4096 blocks=6346375168, imaxpct=5 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=521728, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 real 0m8.834s user 0m0.002s sys 0m0.322s root@smr_dev:~# time mkfs.ext4 -F -E packed_meta_blocks=1 /dev/dm-3 mke2fs 1.44.5 (15-Dec-2018) /dev/dm-3 contains a xfs file system Discarding device blocks: done Creating filesystem with 6346375168 4k blocks and 396648448 inodes Filesystem UUID: 93136647-0214-4ea2-8403-2561a4cd3e42 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 2560000000, 3855122432, 5804752896 Allocating group tables: done Writing inode tables: done Creating journal (262144 blocks): done Writing superblocks and filesystem accounting information: done real 0m32.449s user 0m0.320s sys 0m1.165s -- dm-devel mailing list dm-devel@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/dm-devel