From 78e850f4a44fc91adf7109eca43e0e583eb9f3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Szyma=C5=84ski?= Date: Fri, 24 Jul 2020 14:27:03 +0200 Subject: [PATCH] Remove linux_make_writeback_buffering_not_suck() This function doesn't work with modern kernel and may just want to fix issue that doesn't exist anymore. This commit is linked to #4 . --- WoeUSB/core.py | 5 ----- WoeUSB/workaround.py | 27 --------------------------- 2 files changed, 32 deletions(-) diff --git a/WoeUSB/core.py b/WoeUSB/core.py index f77df51..262f078 100644 --- a/WoeUSB/core.py +++ b/WoeUSB/core.py @@ -188,8 +188,6 @@ def main(source_fs_mountpoint, target_fs_mountpoint, source_media, target_media, current_state = "copying-filesystem" - workaround.linux_make_writeback_buffering_not_suck(True) - copy_filesystem_files(source_fs_mountpoint, target_fs_mountpoint) workaround.support_windows_7_uefi_boot(source_fs_mountpoint, target_fs_mountpoint) @@ -579,9 +577,6 @@ def cleanup(source_fs_mountpoint, target_fs_mountpoint, temp_directory): if CopyFiles_handle.is_alive(): CopyFiles_handle.stop = True - if current_state in ["copying-filesystem", "finished"]: - workaround.linux_make_writeback_buffering_not_suck(False) - flag_unclean = False flag_unsafe = False diff --git a/WoeUSB/workaround.py b/WoeUSB/workaround.py index 7727a8e..7bff2bb 100644 --- a/WoeUSB/workaround.py +++ b/WoeUSB/workaround.py @@ -104,30 +104,3 @@ def support_windows_7_uefi_boot(source_fs_mountpoint, target_fs_mountpoint): with open(efi_boot_directory + "/bootx64.efi", "wb") as target_bootloader: target_bootloader.write(bootloader) - - -def linux_make_writeback_buffering_not_suck(mode): - """ - :param mode: True - enable; False - disable - """ - return - if mode: - utils.print_with_color( - "Applying workaround to prevent 64-bit systems with big primary memory from being unresponsive during copying files.", - "yellow") - - vm_dirty_background_bytes = str(16 * 1024 * 1024) # 16MiB - vm_dirty_bytes = str(48 * 1024 * 1024) # 48MiB - else: - utils.print_with_color( - "Resetting workaround to prevent 64-bit systems with big primary memory from being unresponsive during copying files.", - "yellow") - - vm_dirty_background_bytes = "0" - vm_dirty_bytes = "0" - - with open("/proc/sys/vm/dirty_background_bytes", "w") as dirty_background_bytes: - dirty_background_bytes.write(vm_dirty_background_bytes) - - with open("/proc/sys/vm/dirty_bytes", "w") as dirty_bytes: - dirty_bytes.write(vm_dirty_bytes)