Bug 1942434

Summary: gfs2_jadd is slow
Product: Red Hat Enterprise Linux 8 Reporter: Andrew Price <anprice>
Component: gfs2-utilsAssignee: Andrew Price <anprice>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: cluster-maint, gfs2-maint, nstraz
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gfs2-utils-3.2.0-11.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:31:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew Price 2021-03-24 10:57:13 UTC
Current RHEL 8:

[root@rhel8-1 ~]# /usr/bin/time gfs2_jadd /mnt/
Filesystem: /mnt/
Old journals: 2
New journals: 3
1.64user 10.10system 15:26.59elapsed 1%CPU (0avgtext+0avgdata 2156maxresident)k
168inputs+792904outputs (2major+84minor)pagefaults 0swaps

Current upstream:

[root@rhel8-1 ~]# /usr/bin/time gfs2-utils/gfs2/mkfs/gfs2_jadd /mnt/
Filesystem: /mnt/
Old journals: 3
New journals: 4
0.35user 0.38system 0:08.18elapsed 9%CPU (0avgtext+0avgdata 2180maxresident)k
160inputs+268960outputs (0major+82minor)pagefaults 0swaps

Relevant upstream patches:

657bbcfb gfs2_jadd: Don't fsync after each block written
2010383c gfs2_jadd: Use fallocate to preallocate journals

Comment 4 Dean Jansa 2021-04-08 17:06:12 UTC
ON_QA bug without Verified:Tested should be in the MODIFIED state.

Comment 7 Nate Straz 2021-04-21 19:34:02 UTC
BEFORE (gfs2-utils-3.2.0-11.el8.x86_64):
[root@host-139 ~]# rpm -q gfs2-utils
gfs2-utils-3.2.0-11.el8.x86_64
[root@host-139 ~]# mkfs -t gfs2 -j 1 -p lock_dlm -t STSRHTS21412:STSRHTS214120 /dev/STSRHTS21412/STSRHTS214120 -O
It appears to contain an existing filesystem (gfs2)
/dev/STSRHTS21412/STSRHTS214120 is a symbolic link to /dev/dm-2
This will destroy any data on /dev/dm-2
Discarding device contents (may take a while on large devices): Done
Adding journals: Done
Building resource groups: Done
Creating quota file: Done
Writing superblock and syncing: Done
Device:                    /dev/STSRHTS21412/STSRHTS214120
Block size:                4096
Device size:               399.99 GB (104855552 blocks)
Filesystem size:           399.99 GB (104855550 blocks)
Journals:                  1
Journal size:              128MB
Resource groups:           1601
Locking protocol:          "lock_dlm"
Lock table:                "STSRHTS21412:STSRHTS214120"
UUID:                      4c52b512-f871-45a6-ad16-6ae517582ddc
[root@host-139 ~]# mount /dev/STSRHTS21412/STSRHTS214120  /mnt/STSRHTS214120/
[root@host-139 ~]# /usr/bin/time gfs2_jadd -j 4 /mnt/STSRHTS214120/
Filesystem: /mnt/STSRHTS214120/
Old journals: 1
New journals: 5
2.06user 6.44system 0:34.32elapsed 24%CPU (0avgtext+0avgdata 2012maxresident)k
176inputs+1075736outputs (1major+94minor)pagefaults 0swaps

================================================================================

AFTER (gfs2-utils-3.2.0-10.el8.x86_64):
[root@host-139 ~]# rpm -q gfs2-utils
gfs2-utils-3.2.0-10.el8.x86_64
[root@host-139 ~]# mkfs -t gfs2 -j 1 -p lock_dlm -t STSRHTS21412:STSRHTS214120 /dev/STSRHTS21412/STSRHTS214120 -O
It appears to contain an existing filesystem (gfs2)
/dev/STSRHTS21412/STSRHTS214120 is a symbolic link to /dev/dm-2
This will destroy any data on /dev/dm-2
Discarding device contents (may take a while on large devices): Done
Adding journals: Done
Building resource groups: Done
Creating quota file: Done
Writing superblock and syncing: Done
Device:                    /dev/STSRHTS21412/STSRHTS214120
Block size:                4096
Device size:               399.99 GB (104855552 blocks)
Filesystem size:           399.99 GB (104855550 blocks)
Journals:                  1
Journal size:              128MB
Resource groups:           1601
Locking protocol:          "lock_dlm"
Lock table:                "STSRHTS21412:STSRHTS214120"
UUID:                      fc7511dd-853b-4d59-b48b-f0323e97874c
[root@host-139 ~]# mount /dev/STSRHTS21412/STSRHTS214120  /mnt/STSRHTS214120/
[root@host-139 ~]# /usr/bin/time gfs2_jadd -j 4 /mnt/STSRHTS214120/
Filesystem: /mnt/STSRHTS214120/
Old journals: 1
New journals: 5
3.38user 27.11system 7:33.61elapsed 6%CPU (0avgtext+0avgdata 2076maxresident)k
0inputs+3171056outputs (0major+95minor)pagefaults 0swaps

Comment 8 Andrew Price 2021-04-23 09:33:42 UTC
NB the previous comment has the "before" and "after" switched :)

Comment 10 Nate Straz 2021-04-29 20:09:38 UTC
Verified updated package is in nightly compose and performs the same.

[root@host-006 ~]# rpm -q gfs2-utils
gfs2-utils-3.2.0-11.el8.x86_64
[root@host-006 ~]# mkfs -t gfs2 -j 1 -p lock_dlm -t STSRHTS16636:STSRHTS166360 /dev/STSRHTS16636/STSRHTS166360  -O
It appears to contain an existing filesystem (gfs2)
/dev/STSRHTS16636/STSRHTS166360 is a symbolic link to /dev/dm-2
This will destroy any data on /dev/dm-2
Discarding device contents (may take a while on large devices): Done
Adding journals: Done
Building resource groups: Done
Creating quota file: Done
Writing superblock and syncing: Done
Device:                    /dev/STSRHTS16636/STSRHTS166360
Block size:                4096
Device size:               199.99 GB (52425728 blocks)
Filesystem size:           199.99 GB (52425725 blocks)
Journals:                  1
Journal size:              128MB
Resource groups:           801
Locking protocol:          "lock_dlm"
Lock table:                "STSRHTS16636:STSRHTS166360"
UUID:                      21e22f1b-afa8-48cc-baa6-ae2d1d22e5c9
[root@host-006 ~]# mount /dev/STSRHTS16636/STSRHTS166360 /mnt/STSRHTS166360
[root@host-006 ~]# /usr/bin/time gfs2_jadd -j 4 /mnt/STSRHTS166360
Filesystem: /mnt/STSRHTS166360
Old journals: 1
New journals: 5
2.68user 5.08system 0:47.35elapsed 16%CPU (0avgtext+0avgdata 2012maxresident)k
176inputs+1075760outputs (1major+93minor)pagefaults 0swaps

Comment 12 errata-xmlrpc 2021-11-09 19:31:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (gfs2-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4363