Hello Here is an easy way to speed up the image writing. It simply tell the kernel to immediatly start writing the data to disk asynchronously and not to do the traditional buffering.
Mesurement: System: pentium D820, Harddisk ~58Mo/s, image size 500Mo Time of suspend to disk, average of 3 run. Compression enabled: Without patch: 35 sec. With patch: 27 sec. Speedup: 22% Compression disabled: Without patch: 17 sec. With patch: 14 sec. Speedup: 18% Philippe. --- diff -p -u -r1.82 suspend.c --- suspend.c 29 Jul 2007 12:48:10 -0000 1.82 +++ suspend.c 10 Aug 2007 21:50:28 -0000 @@ -10,6 +10,7 @@ */ #define _LARGEFILE64_SOURCE +#define _GNU_SOURCE #include <sys/types.h> #include <sys/stat.h> @@ -238,6 +239,8 @@ static int write_area(int fd, void *buf, if (offset) { if (lseek64(fd, offset, SEEK_SET) == offset) cnt = write(fd, buf, size); + /* Ask kernel to immediatly start writing the data */ + sync_file_range(fd, offset, size, SYNC_FILE_RANGE_WRITE); if (cnt == size) res = 0; else ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel