Hi!

> When I use the compression with uswsusp, the suspend step take longer than 
> without. This is in fact because uswsusp write the data synchronously to the 
> disk. So while it take time to compress the data the disk is idle, and while 
> it take time to write to disk the processor wait ...
> 
> I've hacked a quick'n dirty AIO patch for uswsusp. This is based on glibc 
> aio, 
> without any special care, you have been warned. The speedup is about 10 
> seconds ( witout 36 sec, with 24-26 sec ) on my PC (1Gb ram, pentium D 820, 
> 58Mo/s sustained harddisk bandwidth). 
> 
> I suspect I have done it wrong because I don't know if a process can allocate 
> memory or spawn new threads (glibc may does this behind my back) while 
> suspending. But it works here, maybe I'm lucky.

I'd prefer not to do allocations/new threads, but I can't prove it
will crash anything.

> I'm still not entirely happy about this implementation because:
> - glibc hide us a lot of works
> - the code is not really clean
> - The harddisk led is not "always on", so we don't write at maximum speed
> - We no more detect write error
> 
> So maybe someone more experimented can improve it ! 

Or perhaps some easier method/clever trick exists?

Actually IIRC mingo had an idea how to do this properly. One thread
compresses. Second threads writes out compressed data, if available,
or uncompressed data, if not. That way, you get maximum speed no
matter how fast or slow your disk is.
                                                                        Pavel


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to