Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1755046

Summary: [RFE] mkfs.xfs should make use of efficient zeroing (REQ_OP_WRITE_ZEROES)
Product: Red Hat Enterprise Linux 8 Reporter: Ilya Dryomov <idryomov>
Component: xfsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact: Zorro Lang <zlang>
Severity: unspecified Docs Contact:
Priority: high    
Version: ---CC: esandeen, swhiteho, xzhou
Target Milestone: rcKeywords: FutureFeature
Target Release: 8.3Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:02:51 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 Ilya Dryomov 2019-09-24 15:45:30 UTC
Update libxfs to take advantage of the efficient zeroing interface for block devices (REQ_OP_WRITE_ZEROES exposed via fallocate(blkdev_fd, FALLOC_FL_ZERO_RANGE) added in 2016-2017) instead of manually zeroing.  This is particularly useful for network block devices such as rbd because manual zeroing with repeated (p)write() calls sends blocks of zeros over the network.  scsi and nvme have various "write zeros" commands as well.

mkfs.ext4 was updated in v1.45.0.  A quick test on a 10G rbd image shows a 6x improvement: 3.7 seconds with v1.44.4 vs 0.6 seconds with v1.45.3 (lazy_itable_init=1 by default, so it's just zeroing of the journal -- exactly what mkfs.xfs would do).  For mkfs.xfs I expect the improvement to be smaller because xfs log is typically a lot smaller than ext4 journal (in this case it's 10M vs 64M for a 10G filesystem), but still worth it!

mkfs performance has become an important factor in the context of OCS (OpenShift Container Storage).  Filesystem PVs (persistent volumes) are currently implemented as rbd images with a local filesystem on top.  PV creation/deletion speeds is one of the key benchmarks.  Creating and mapping an rbd image to a block device is almost instantaneous, so it boils down to mkfs performance.

Comment 1 Eric Sandeen 2019-09-24 17:02:10 UTC
Please give this a test:

ttp://brew-task-repos.usersys.redhat.com/repos/scratch/esandeen/xfsprogs/5.0.0/1.el8.bz1755046/

Comment 3 Ilya Dryomov 2019-09-24 18:51:53 UTC
I extracted the patch from the rpm and tested on top of v5.2.1 (just because that is what I've been testing with before).  Works as expected:

10G image (10M log): 1.3 seconds vs 2.1 seconds
100G image (50M log): 1.5 seconds vs 5.2 seconds

Comment 4 Steve Whitehouse 2020-02-12 11:16:56 UTC
Eric, do you have an update on this one?

Comment 5 Eric Sandeen 2020-02-14 22:21:06 UTC
The patch is in review upstream, I expect we can make 8.3 for this.

Comment 6 Eric Sandeen 2020-03-09 19:48:55 UTC
This patch is now upstream:

9d6023a libxfs: use FALLOC_FL_ZERO_RANGE in libxfs_device_zero

Comment 12 errata-xmlrpc 2020-11-04 02:02:51 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 (xfsprogs 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-2020:4554