Skip to content

Commit

Permalink
Remove linux_make_writeback_buffering_not_suck()
Browse files Browse the repository at this point in the history
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 .
  • Loading branch information
WaxyMocha committed Jul 24, 2020
1 parent 88c56f0 commit 78e850f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
5 changes: 0 additions & 5 deletions WoeUSB/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
27 changes: 0 additions & 27 deletions WoeUSB/workaround.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 78e850f

Please sign in to comment.