Skip to content

Commit

Permalink
Update lvm.py
Browse files Browse the repository at this point in the history
Break the ioctl calls from blkdiscard into max 1GB worth of blocks per call. This ensures that the amount of pending discards (both for the virtual lvm thin volume as well as any lower level device recipients) do not dominate the IO streams to the devices. Before this change, IO blocking was leading to both UI and processing freezes in Qubes while very large LVM volumes were being removed. The change will allow other device IOs to be interleaved between the internal ioctl calls from blkdiscard.
  • Loading branch information
brendanhoar committed May 12, 2021
1 parent f9bfcd8 commit 16d0692
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qubes/storage/lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ def qubes_lvm_coro(cmd, log=logging.getLogger('qubes.storage.lvm')):
environ = os.environ.copy()
environ['LC_ALL'] = 'C.utf8'
if cmd[0] == "remove":
pre_cmd = ['blkdiscard', '/dev/'+cmd[1]]
pre_cmd = ['blkdiscard', '-p', '1G', '/dev/'+cmd[1]]
p = yield from asyncio.create_subprocess_exec(*pre_cmd,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
Expand Down

0 comments on commit 16d0692

Please sign in to comment.