Skip to contentSkip to conversation

common/xfs: ignore the 32M log size during mkfs.xfs

PATCH In review Yi Zhang 4 participants 14 messages Oct 19, 2022 – Oct 25, 2022 Block layer

lore
Share & tools
lore

Yi Zhang

author
#0 lore raw

PATCH 1/1 common/xfs: ignore the 32M log size during mkfs.xfs

The new minimum size for the xfs log is 64MB which introudced from xfsprogs v5.19.0, let's ignore it, or nvme/013 will be failed at:

$ mkfs.xfs -l size=32m -f /dev/nvme0n1
Log size must be at least 64MB.
Usage: mkfs.xfs
/* blocksize */		[-b size=num]
/* config file */	[-c options=xxx]
/* metadata */		[-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1,reflink=0|1,
			    inobtcount=0|1,bigtime=0|1]
/* data subvol */	[-d agcount=n,agsize=n,file,name=xxx,size=num,
			    (sunit=value,swidth=value|su=num,sw=num|noalign),
			    sectsize=num
/* force overwrite */	[-f]
/* inode size */	[-i perblock=n|size=num,maxpct=n,attr=0|1|2,
			    projid32bit=0|1,sparse=0|1,nrext64=0|1]
/* no discard */	[-K]
/* log subvol */	[-l agnum=n,internal,size=num,logdev=xxx,version=n
			    sunit=value|su=num,sectsize=num,lazy-count=0|1]
/* label */		[-L label (maximum 12 characters)]
/* naming */		[-n size=num,version=2|ci,ftype=0|1]
/* no-op info only */	[-N]
/* prototype file */	[-p fname]
/* quiet */		[-q]
/* realtime subvol */	[-r extsize=num,size=num,rtdev=xxx]
/* sectorsize */	[-s size=num]
/* version */		[-V]
			devicename
<devicename> is required unless -d name=xxx is given.
<num> is xxx (bytes), xxxs (sectors), xxxb (fs blocks), xxxk (xxx KiB),
      xxxm (xxx MiB), xxxg (xxx GiB), xxxt (xxx TiB) or xxxp (xxx PiB).
<value> is xxx (512 byte blocks).
---
 common/xfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/xfs +1 -1
index 210c924..f0c9b7f 100644
@@ -16,7 +16,7 @@ _xfs_mkfs_and_mount() {
 
 	mkdir -p "${mount_dir}"
 	umount "${mount_dir}"
-	mkfs.xfs -l size=32m -f "${bdev}"
+	mkfs.xfs -f "${bdev}"
 	mount "${bdev}" "${mount_dir}"
 }
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 3 lines · Yi Zhang

The new minimum size for the xfs log is 64MB which introudced from xfsprogs v5.19.0, let's ignore it, or nvme/013 will be failed at:
instead of removing set it to 64MB?

#2 lore raw
In reply to Yi Zhang
Quoted 3 lines · Yi Zhang

The new minimum size for the xfs log is 64MB which introudced from xfsprogs v5.19.0, let's ignore it, or nvme/013 will be failed at:

instead of removing it set to 64MB ?

-ck

#3 lore raw
Quoted 6 lines · Chaitanya Kulkarni
Quoted 3 lines · Yi Zhang

The new minimum size for the xfs log is 64MB which introudced from xfsprogs v5.19.0, let's ignore it, or nvme/013 will be failed at:

instead of removing it set to 64MB ?

What is the advantage of hard-coding any log size? By doing so you are overriding mkfs's own best-practice heuristics, and you might run into other failures in the future.

Is there a reason to not just use the defaults?

Thanks,
-Eric

#4 lore raw
Quoted 6 lines · Eric Sandeen
Quoted 5 lines · Chaitanya Kulkarni
Quoted 3 lines · Yi Zhang

The new minimum size for the xfs log is 64MB which introudced from xfsprogs v5.19.0, let's ignore it, or nvme/013 will be failed at:

Quoted 8 lines
Quoted 1 line

instead of removing it set to 64MB ?

What is the advantage of hard-coding any log size? By doing so you are overriding mkfs's own best-practice heuristics, and you might run into other failures in the future.

Is there a reason to not just use the defaults?

I think the point here to use the minimal XFS setup.

Does default size is minimal ? or at least we should document what the size it is.

-ck

#5 lore raw
Quoted 13 lines · Chaitanya Kulkarni
Quoted 12 lines · Eric Sandeen
Quoted 6 lines · Chaitanya Kulkarni
Quoted 3 lines · Yi Zhang

The new minimum size for the xfs log is 64MB which introudced from xfsprogs v5.19.0, let's ignore it, or nvme/013 will be failed at:

instead of removing it set to 64MB ?

What is the advantage of hard-coding any log size? By doing so you are overriding mkfs's own best-practice heuristics, and you might run into other failures in the future.

Quoted 7 lines
Quoted 2 lines

Is there a reason to not just use the defaults?

I think the point here to use the minimal XFS setup.

Does default size is minimal ? or at least we should document what the size it is.

As far as I read man mkfs.xfs, it is not minimal. It changes depending on the filesystem size.

To have minimal XFS setup, do we need to care other parameters than log size? I'm looking at 'man mkfs.xfs' and it mentions data section size and some other size related options.

Two more questions have come up in my mind:

- Did we have nvme driver or block layer issues related to xfs log size in the past? If so, it is reasonable to specify it.

- When we see failures of xfs user test cases (nvme/012,013,035), is xfs log size useful to debug?

Signature · 1 line
Shin'ichiro Kawasaki
#6 lore raw
Quoted 25 lines · Shinichiro Kawasaki
Quoted 13 lines · Chaitanya Kulkarni
Quoted 12 lines · Eric Sandeen
Quoted 6 lines · Chaitanya Kulkarni
Quoted 3 lines · Yi Zhang

The new minimum size for the xfs log is 64MB which introudced from xfsprogs v5.19.0, let's ignore it, or nvme/013 will be failed at:

instead of removing it set to 64MB ?

What is the advantage of hard-coding any log size? By doing so you are overriding mkfs's own best-practice heuristics, and you might run into other failures in the future.

Quoted 7 lines
Quoted 2 lines

Is there a reason to not just use the defaults?

I think the point here to use the minimal XFS setup.

Does default size is minimal ? or at least we should document what the size it is.

As far as I read man mkfs.xfs, it is not minimal. It changes depending on the filesystem size.

Quoted 9 lines

To have minimal XFS setup, do we need to care other parameters than log size? I'm looking at 'man mkfs.xfs' and it mentions data section size and some other size related options.

Two more questions have come up in my mind:

- Did we have nvme driver or block layer issues related to xfs log size in the past? If so, it is reasonable to specify it.

I think creating a minimal setup is a part of the testcase and we should not change it, unless there is a explicit reason for doing so.

Quoted 3 lines

- When we see failures of xfs user test cases (nvme/012,013,035), is xfs log size useful to debug?

I hope so ..

-ck

#7 lore raw

On Oct 21, 2022 / 21:42, Chaitanya Kulkarni wrote:

...

Quoted 2 lines

I think creating a minimal setup is a part of the testcase and we should not change it, unless there is a explicit reason for doing so.

I see, I find no reason to change the "minimal log size policy". Let's go with 64MB log size to keep it.

Yi, would you mind reposting v2 with size=64m?

Signature · 1 line
Shin'ichiro Kawasaki
author
#8 lore raw
Quoted 5 lines · Shinichiro Kawasaki

On Oct 21, 2022 / 21:42, Chaitanya Kulkarni wrote:

...

Quoted 7 lines
Quoted 2 lines

I think creating a minimal setup is a part of the testcase and we should not change it, unless there is a explicit reason for doing so.

I see, I find no reason to change the "minimal log size policy". Let's go with 64MB log size to keep it.

Yi, would you mind reposting v2 with size=64m?

Sure, and before I post it, I want to ask for suggestions about some other code changes:

After set log size with 64M, I found nvme/012 nvme/013 will be failed[1], and there was not enough space for fio with size=950m testing.
Either [2] or [3] works, which one do you prefer, or do you have some other suggestion for it? Thanks.

[1]
nvme/012 (run mkfs and data verification fio job on NVMeOF block device-backed ns) [failed]

    runtime  54.400s  ...  53.514s
    --- tests/nvme/012.out 2022-10-21 10:21:12.461157830 -0400
    +++ /root/blktests/results/nodev/nvme/012.out.bad 2022-10-23
09:10:01.125990759 -0400
    @@ -1,5 +1,22 @@
     Running nvme/012
     91fdba0d-f87b-4c25-b80f-db7be1418b9e
     uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
    +fio: io_u error on file /mnt/blktests//verify.0.0: No space left

on device: write offset=292646912, buflen=4096
+fio: io_u error on file /mnt/blktests//verify.0.0: No space left
on device: write offset=336576512, buflen=4096
+fio: io_u error on file /mnt/blktests//verify.0.0: No space left
on device: write offset=144633856, buflen=4096
+fio: io_u error on file /mnt/blktests//verify.0.0: No space left
on device: write offset=149147648, buflen=4096

    ...
    (Run 'diff -u tests/nvme/012.out
/root/blktests/results/nodev/nvme/012.out.bad' to see the entire diff)
nvme/013 (run mkfs and data verification fio job on NVMeOF file-backed
ns) [failed]
    runtime  172.121s  ...  292.743s
    --- tests/nvme/013.out 2022-10-21 10:21:12.461157830 -0400
    +++ /root/blktests/results/nodev/nvme/013.out.bad 2022-10-23
09:14:43.493752127 -0400
    @@ -1,5 +1,17 @@
     Running nvme/013
     91fdba0d-f87b-4c25-b80f-db7be1418b9e
     uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
    +fio: io_u error on file /mnt/blktests//verify.0.0: No space left

on device: write offset=665759744, buflen=4096
+fio: io_u error on file /mnt/blktests//verify.0.0: No space left
on device: write offset=198172672, buflen=4096
+fio: io_u error on file /mnt/blktests//verify.0.0: No space left
on device: write offset=369643520, buflen=4096
+fio: io_u error on file /mnt/blktests//verify.0.0: No space left
on device: write offset=195624960, buflen=4096

    ...
    (Run 'diff -u tests/nvme/013.out

/root/blktests/results/nodev/nvme/013.out.bad' to see the entire diff)

[2]

tests/nvme/012 +1 -1
index c9d2438..25bde25 100755
@@ -29,7 +29,7 @@ test() {
        local file_path="${TMPDIR}/img"
        local subsys_name="blktests-subsystem-1"
 
-       truncate -s 1G "${file_path}"
+       truncate -s 2G "${file_path}"
 
        loop_dev="$(losetup -f --show "${file_path}")"
 
tests/nvme/013 +1 -1
index 265b696..602c86f 100755
@@ -28,7 +28,7 @@ test() {
 
        local subsys_name="blktests-subsystem-1"
 
-       truncate -s 1G "${file_path}"
+       truncate -s 2G "${file_path}"
 
        _create_nvmet_subsystem "${subsys_name}" "${file_path}" \
                "91fdba0d-f87b-4c25-b80f-db7be1418b9e"

[3]

common/xfs +1 -1
index 210c924..0018212 100644
@@ -26,7 +26,7 @@ _xfs_run_fio_verify_io() {
 
        _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1
 
-       _run_fio_verify_io --size=950m --directory="${mount_dir}/"
+       _run_fio_verify_io --size=900m --directory="${mount_dir}/"
 
        umount "${mount_dir}" >> "${FULL}" 2>&1
        rm -fr "${mount_dir}"
Quoted 4 lines

--
Shin'ichiro Kawasaki

Signature · 2 lines
Best Regards,
  Yi Zhang
#9 lore raw
Quoted 14 lines · Yi Zhang
Quoted 5 lines · Shinichiro Kawasaki

On Oct 21, 2022 / 21:42, Chaitanya Kulkarni wrote:

...

Quoted 7 lines
Quoted 2 lines

I think creating a minimal setup is a part of the testcase and we should not change it, unless there is a explicit reason for doing so.

I see, I find no reason to change the "minimal log size policy". Let's go with 64MB log size to keep it.

Yi, would you mind reposting v2 with size=64m?

Quoted 8 lines

Sure, and before I post it, I want to ask for suggestions about some other code changes:

After set log size with 64M, I found nvme/012 nvme/013 will be failed[1], and there was not enough space for fio with size=950m testing.
Either [2] or [3] works, which one do you prefer, or do you have some other suggestion for it? Thanks.

Thank you for testing. I guess fio I/O size=950m was chosen subtracting some super block and log size from 1GB NVME device size. Now we increase the log size, then the I/O size 950m is larger than the usable xfs size, probably.

Chaitania, what' your thought about the fix approach? To keep the "minimal log size policy", I guess the approach [3] to reduce fio I/O size to 900m is more appropriate, but would like to hear your insight.

From Yi's observation, I found a couple of improvement opportunities which are beyond scope of this fix. Here I note them as memorandum (patches are welcome :)

1) Assuming nvme device size 1GB define in nvme/012 and nvme/013 has relation to the fio I/O size 950m defined in common/xfs, these values should be defined at single place. Probably we should define both in nvme/012 and nvme/013.

2) The fio I/O size 950m is defined in _xfs_run_fio_verify_io() which is called from nvme/035. Then, it is implicitly assumed that TEST_DEV for nvme/035 has size 1GB (or larger). I found that nvme/035 fails with 512MB nvme device. We should fix this by calculating fio I/O size from TEST_DEV size. (Or require 1GB nvme device size for the test case.)

Signature · 1 line
Shin'ichiro Kawasaki
author
#10 lore raw
Quoted 29 lines · Shinichiro Kawasaki
Quoted 14 lines · Yi Zhang
Quoted 5 lines · Shinichiro Kawasaki

On Oct 21, 2022 / 21:42, Chaitanya Kulkarni wrote:

...

Quoted 7 lines
Quoted 2 lines

I think creating a minimal setup is a part of the testcase and we should not change it, unless there is a explicit reason for doing so.

I see, I find no reason to change the "minimal log size policy". Let's go with 64MB log size to keep it.

Yi, would you mind reposting v2 with size=64m?

Quoted 8 lines

Sure, and before I post it, I want to ask for suggestions about some other code changes:

After set log size with 64M, I found nvme/012 nvme/013 will be failed[1], and there was not enough space for fio with size=950m testing.
Either [2] or [3] works, which one do you prefer, or do you have some other suggestion for it? Thanks.

Thank you for testing. I guess fio I/O size=950m was chosen subtracting some super block and log size from 1GB NVME device size. Now we increase the log size, then the I/O size 950m is larger than the usable xfs size, probably.

Quoted 7 lines

Chaitania, what' your thought about the fix approach? To keep the "minimal log size policy", I guess the approach [3] to reduce fio I/O size to 900m is more appropriate, but would like to hear your insight.

From Yi's observation, I found a couple of improvement opportunities which are beyond scope of this fix. Here I note them as memorandum (patches are welcome :)

I resend the patch to set log size to 64M and another two which could address below :)

Quoted 14 lines

1) Assuming nvme device size 1GB define in nvme/012 and nvme/013 has relation to the fio I/O size 950m defined in common/xfs, these values should be defined at single place. Probably we should define both in nvme/012 and nvme/013.

2) The fio I/O size 950m is defined in _xfs_run_fio_verify_io() which is called from nvme/035. Then, it is implicitly assumed that TEST_DEV for nvme/035 has size 1GB (or larger). I found that nvme/035 fails with 512MB nvme device. We should fix this by calculating fio I/O size from TEST_DEV size. (Or require 1GB nvme device size for the test case.)

--
Shin'ichiro Kawasaki

Signature · 2 lines
Best Regards,
  Yi Zhang
#11 lore raw
Quoted 2 lines · Yi Zhang

On Mon, Oct 24, 2022 at 8:50 AM Shinichiro Kawasaki <[email protected]> wrote:

...

Quoted 5 lines
Quoted 2 lines

From Yi's observation, I found a couple of improvement opportunities which are beyond scope of this fix. Here I note them as memorandum (patches are welcome :)

I resend the patch to set log size to 64M and another two which could address below :)

Thanks! I'll wait for comment by Chaitanya then review your patches.

Quoted 21 lines
Quoted 15 lines

1) Assuming nvme device size 1GB define in nvme/012 and nvme/013 has relation to the fio I/O size 950m defined in common/xfs, these values should be defined at single place. Probably we should define both in nvme/012 and nvme/013.

2) The fio I/O size 950m is defined in _xfs_run_fio_verify_io() which is called from nvme/035. Then, it is implicitly assumed that TEST_DEV for nvme/035 has size 1GB (or larger). I found that nvme/035 fails with 512MB nvme device. We should fix this by calculating fio I/O size from TEST_DEV size. (Or require 1GB nvme device size for the test case.)

--
Shin'ichiro Kawasaki

Signature · 2 lines
Best Regards,
  Yi Zhang
Signature · 1 line
Shin'ichiro Kawasaki
#12 lore raw
In reply to Shinichiro Kawasaki

Shinichiro/Yi,

Quoted 24 lines · Shinichiro Kawasaki
Quoted 14 lines · Yi Zhang
Quoted 5 lines · Shinichiro Kawasaki

On Oct 21, 2022 / 21:42, Chaitanya Kulkarni wrote:

...

Quoted 7 lines
Quoted 2 lines

I think creating a minimal setup is a part of the testcase and we should not change it, unless there is a explicit reason for doing so.

I see, I find no reason to change the "minimal log size policy". Let's go with 64MB log size to keep it.

Yi, would you mind reposting v2 with size=64m?

Quoted 8 lines

Sure, and before I post it, I want to ask for suggestions about some other code changes:

After set log size with 64M, I found nvme/012 nvme/013 will be failed[1], and there was not enough space for fio with size=950m testing.
Either [2] or [3] works, which one do you prefer, or do you have some other suggestion for it? Thanks.

Quoted 7 lines

Thank you for testing. I guess fio I/O size=950m was chosen subtracting some super block and log size from 1GB NVME device size. Now we increase the log size, then the I/O size 950m is larger than the usable xfs size, probably.

Chaitania, what' your thought about the fix approach? To keep the "minimal log size policy", I guess the approach [3] to reduce fio I/O size to 900m is more appropriate, but would like to hear your insight.

I'm fine with adjusting the size to it can fit with new minimum log sizes.

Quoted 8 lines

From Yi's observation, I found a couple of improvement opportunities which are
beyond scope of this fix. Here I note them as memorandum (patches are welcome :)

1) Assuming nvme device size 1GB define in nvme/012 and nvme/013 has relation to the fio I/O size 950m defined in common/xfs, these values should be defined at single place. Probably we should define both in nvme/012 and nvme/013.

Agree.

Quoted 7 lines

2) The fio I/O size 950m is defined in _xfs_run_fio_verify_io() which is called from nvme/035. Then, it is implicitly assumed that TEST_DEV for nvme/035 has size 1GB (or larger). I found that nvme/035 fails with 512MB nvme device. We should fix this by calculating fio I/O size from TEST_DEV size. (Or require 1GB nvme device size for the test case.)

Also, agree on this.

Above two listed fixes should be done as a part of this fix only.

I'd expect to see a patch series to fix all the issues listed above, please CC me so I can review this with priority.

-ck

#13 lore raw
Quoted 31 lines · Chaitanya Kulkarni

Shinichiro/Yi,

Quoted 28 lines · Shinichiro Kawasaki
Quoted 14 lines · Yi Zhang
Quoted 5 lines · Shinichiro Kawasaki

On Oct 21, 2022 / 21:42, Chaitanya Kulkarni wrote:

...

Quoted 7 lines
Quoted 2 lines

I think creating a minimal setup is a part of the testcase and we should not change it, unless there is a explicit reason for doing so.

I see, I find no reason to change the "minimal log size policy". Let's go with 64MB log size to keep it.

Yi, would you mind reposting v2 with size=64m?

Quoted 8 lines

Sure, and before I post it, I want to ask for suggestions about some other code changes:

After set log size with 64M, I found nvme/012 nvme/013 will be failed[1], and there was not enough space for fio with size=950m testing.
Either [2] or [3] works, which one do you prefer, or do you have some other suggestion for it? Thanks.

Thank you for testing. I guess fio I/O size=950m was chosen subtracting some super block and log size from 1GB NVME device size. Now we increase the log size, then the I/O size 950m is larger than the usable xfs size, probably.

Quoted 6 lines
Quoted 3 lines

Chaitania, what' your thought about the fix approach? To keep the "minimal log size policy", I guess the approach [3] to reduce fio I/O size to 900m is more appropriate, but would like to hear your insight.

I'm fine with adjusting the size to it can fit with new minimum log sizes.

Thank you for the comment. Then let's go with the size 900m.

Quoted 20 lines
Quoted 9 lines

From Yi's observation, I found a couple of improvement opportunities which are
beyond scope of this fix. Here I note them as memorandum (patches are welcome :)

1) Assuming nvme device size 1GB define in nvme/012 and nvme/013 has relation to the fio I/O size 950m defined in common/xfs, these values should be defined at single place. Probably we should define both in nvme/012 and nvme/013.

Agree.

Quoted 7 lines

2) The fio I/O size 950m is defined in _xfs_run_fio_verify_io() which is called from nvme/035. Then, it is implicitly assumed that TEST_DEV for nvme/035 has size 1GB (or larger). I found that nvme/035 fails with 512MB nvme device. We should fix this by calculating fio I/O size from TEST_DEV size. (Or require 1GB nvme device size for the test case.)

Quoted 6 lines

Also, agree on this.

Above two listed fixes should be done as a part of this fix only.

I'd expect to see a patch series to fix all the issues listed above, please CC me so I can review this with priority.

Thank you for these comments also. Yi already posted the series :)

https://lore.kernel.org/linux-block/[email protected]/

Signature · 1 line
Shin'ichiro Kawasaki