Bug 745506

Summary: RFE: storage: add flag to use O_DIRECT for vol-wipe
Product: [Community] Virtualization Tools Reporter: Stanislav Petr <glux>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, lcheng, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-03 16:31:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Stanislav Petr 2011-10-12 14:37:56 UTC
When is virsh vol-wipe running on server with more VPS, performance is very bad, because of too big press to disk scheduler. This patch adds very little sleep to the wipe loop.


diff -r -c libvirt-0.9.6-a/src/storage/storage_driver.c libvirt-0.9.6/src/storage/storage_driver.c
*** libvirt-0.9.6-a/src/storage/storage_driver.c	2011-09-05 09:54:49.000000000 +0200
--- libvirt-0.9.6/src/storage/storage_driver.c	2011-10-06 12:03:03.692829671 +0200
***************
*** 1781,1786 ****
--- 1781,1788 ----
  
          *bytes_wiped += written;
          remaining -= written;
+ 
+ 	usleep(10);
      }
  
      if (fdatasync(fd) < 0) {

Comment 1 Dave Allan 2011-10-12 16:04:28 UTC
Stanislav, thanks for the patch.  Would you mind submitting it to the upstream list for discussion?  Thanks, Dave

Comment 2 Stanislav Petr 2011-10-12 16:20:17 UTC
Yes, i think, it is a good idea. :)

Some additional comment:
After a few seconds of running the wipe loop is the device buffer full, so it is unnecessary to create additional pressure on the disk scheduler. Purging it does not accelerate, but will only slow down system responsiveness.

Comment 3 Daniel Berrangé 2011-10-12 16:50:30 UTC
If the problem is that we're saturating the kernels' buffer cache, then we probably ought to make  disk wiping use  Direct IO, as we did for save/restore & coredump's recently.

Comment 4 Cole Robinson 2016-04-19 17:59:05 UTC
See the BYPASS_CACHE flags for dump and save APIs

Comment 5 Daniel Berrangé 2020-11-03 16:31:11 UTC
Thank you for reporting this issue to the libvirt project. Unfortunately we have been unable to resolve this issue due to insufficient maintainer capacity and it will now be closed. This is not a reflection on the possible validity of the issue, merely the lack of resources to investigate and address it, for which we apologise. If you none the less feel the issue is still important, you may choose to report it again at the new project issue tracker https://gitlab.com/libvirt/libvirt/-/issues The project also welcomes contribution from anyone who believes they can provide a solution.