From c4ccbb650e1921ceea71b47378f083769ea9df91 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Sun, 3 Aug 2014 13:15:09 +0100 Subject: Drop all calls to sync Remove calls to sync as umount correctly flushes the buffers for the filesystem to umount whereas sync forces flushing of all kernel buffers, local and remote, which causes l-m-c tasks to stall when multiple jobs run l-m-c simultaneously on a single machine. Change-Id: I87acbb4fed4717a9d5fdeaf21156562cc8d9c201 --- linaro_image_tools/media_create/android_boards.py | 1 - linaro_image_tools/media_create/boards.py | 8 -------- linaro_image_tools/media_create/partitions.py | 7 ++----- 3 files changed, 2 insertions(+), 14 deletions(-) (limited to 'linaro_image_tools/media_create') diff --git a/linaro_image_tools/media_create/android_boards.py b/linaro_image_tools/media_create/android_boards.py index 85a2197..4f081fa 100644 --- a/linaro_image_tools/media_create/android_boards.py +++ b/linaro_image_tools/media_create/android_boards.py @@ -224,7 +224,6 @@ class AndroidBoardConfig(BoardConfig): boot_script_path = os.path.join(boot_dir, self.boot_script) make_boot_script(boot_env, boot_script_path) - cmd_runner.run(['sync']).wait() try: cmd_runner.run(['umount', boot_disk], as_root=True).wait() except cmd_runner.SubcommandNonZeroReturnValue: diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py index 03294f4..3b3c87d 100644 --- a/linaro_image_tools/media_create/boards.py +++ b/linaro_image_tools/media_create/boards.py @@ -758,8 +758,6 @@ class BoardConfig(object): "Copying spl '%s' to boot partition." % spl_file) cmd_runner.run(["cp", "-v", spl_file, boot_dir], as_root=True).wait() - # XXX: Is this really needed? - cmd_runner.run(["sync"]).wait() if self.spl_dd: self._dd_file(spl_file, boot_device_or_file, self.spl_dd) @@ -1782,8 +1780,6 @@ class ArndaleConfig(SamsungConfig): "Copying spl '%s' to boot partition." % spl_file) cmd_runner.run(["cp", "-v", spl_file, boot_dir], as_root=True).wait() - # XXX: Is this really needed? - cmd_runner.run(["sync"]).wait() if self.spl_dd: self._dd_file(spl_file, boot_device_or_file, self.spl_dd) @@ -1866,8 +1862,6 @@ class ArndaleOctaConfig(ArndaleConfig): "Copying spl '%s' to boot partition." % spl_file) cmd_runner.run(["cp", "-v", spl_file, boot_dir], as_root=True).wait() - # XXX: Is this really needed? - cmd_runner.run(["sync"]).wait() if self.spl_dd: self._dd_file(spl_file, boot_device_or_file, self.spl_dd) @@ -2214,8 +2208,6 @@ def install_omap_boot_loader(chroot_dir, boot_disk, cls): default = None mlo_file = cls.get_file('spl_file', default=default) cmd_runner.run(["cp", "-v", mlo_file, boot_disk], as_root=True).wait() - # XXX: Is this really needed? - cmd_runner.run(["sync"]).wait() def make_boot_ini(boot_script_path, boot_disk): diff --git a/linaro_image_tools/media_create/partitions.py b/linaro_image_tools/media_create/partitions.py index 0ee3a77..caa44a6 100644 --- a/linaro_image_tools/media_create/partitions.py +++ b/linaro_image_tools/media_create/partitions.py @@ -200,8 +200,7 @@ def partition_mounted(device, path, *args): """A context manager that mounts the given device and umounts when done. We use a try/finally to make sure the device is umounted even if there's - an uncaught exception in the with block. Also, before umounting we call - 'sync'. + an uncaught exception in the with block. :param *args: Extra arguments to the mount command. """ @@ -211,7 +210,6 @@ def partition_mounted(device, path, *args): try: yield finally: - cmd_runner.run(['sync']).wait() try: umount(path) except cmd_runner.SubcommandNonZeroReturnValue, e: @@ -603,8 +601,7 @@ def create_partitions(board_config, media, heads, sectors, cylinders=None, run_sfdisk_commands(sfdisk_cmd, heads, sectors, cylinders, media.path) - # Sync and sleep to wait for the partition to settle. - cmd_runner.run(['sync']).wait() + # sleep to wait for the partition to settle. wait_partition_to_settle(media, part_table) -- cgit v1.2.3