Re: [RFC] [PATCH] Power S3 Resume Optimization Patch. Request for Comment

Previous thread: [RFC, PATCH] workqueue: rework threads/hotplug management by Oleg Nesterov on Thursday, January 18, 2007 - 8:11 pm. (1 message)

Next thread: can someone explain "inline" once and for all? by Robert P. J. Day on Friday, January 19, 2007 - 4:56 am. (11 messages)
From: Seshadri, Harinarayanan
Date: Friday, January 19, 2007 - 1:08 am

[RFC][PATCH] Power S3 Resume optimisation=20
	Here is a simple patch for optimising the S3 resume. With this
patch the resume time is 0.85. Given the fact that device initialisation
on the resume takes almost 70% of time, By executing the whole
"device_resume()" function on a seperate kernel thread, the resume gets
completed( ie. the user can precieve) by ~0.85 sec.
	To avoid any possible race condition while processing the IO
request and to make sure all the io request are queued till the device
resume thread exits, the IO schedulars (patched cfq and as) checks a for
system_resume flag, which is set when the device resume thread starts,
if the flag is set, it doesnt put the request in the dispatch queue.
Once the flag is cleared i.e when the device resume thread is complete,
the IO-schedular behave as in normal situation.
 I did some validation of this patch on a  NAPA board ( Calistoga
chipset with Dothan Processor with and Without SMP)locally here and
havent noticed any issue so far.  Please review and let me know what
your comments. This patch is against 2.6.18 kernel
thanks
-hari
signed-off-by: hari < harinarayanan.seshadri@intel.com>
-----------------------------------
diff -ruN ../test/linux-vanilla/block/as-iosched.c
linux-2.6.18/block/as-iosched.c---
../test/linux-vanilla/block/as-iosched.c    2007-01-10
13:51:33.000000000 +0530
+++ linux-2.6.18/block/as-iosched.c     2007-01-18 13:37:01.000000000
+0530
@@ -1088,6 +1088,19 @@
        if (list_empty(&ad->fifo_list[adir]))
                return 0;

+       /*
+        * Check here for the System resume flag to be cleared, if flag
is
+       *  still set the resume thread hasnt completed yet, and hence
dont
+       *  takeout any new request from the FIFO
+       */
+       extern int system_resuming;
+       if (system_resuming !=3D 0)
+       {
+#ifdef DEBUG
+               printk("  system resuming still \n");
+#endif
+               return 0;
+       }
        arq =3D ...
From: Pavel Machek
Date: Friday, January 19, 2007 - 2:29 am

And you noticed that, so you fixed obvious problems on block devices.



Add mdelay(1 hour) here. Then try to use your wifi card and your tv

							Pavel

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

From: Seshadri, Harinarayanan
Date: Sunday, January 21, 2007 - 8:55 pm

My initial idea was to execute only block device resume on the separate
thread, as it take almost 80% of the total device resume time ( I did
detailed profile of each device resume through rdtsc() counter) and rest
of them takes less than 20% in total( each device ( including char and
net)on its own takes less than 0.03 seconds). I could still save some
good amount of resume time ( apprx 1.2 sec). However Given this ratio,
and the fact that block device resume happening way at the end of the
list, I tried this with only taking care of Block devices. 
	I am not sure if there is a case where any scenario where Char
devices would take more resume time than normally it would. If so I can
modify the patch to put only block devices in separate thread for resume
Thanks
-hari
-----Original Message-----
From: Pavel Machek [mailto:pavel@ucw.cz] 
Sent: Friday, January 19, 2007 3:00 PM
To: Seshadri, Harinarayanan
Cc: inux-pm@lists.osdl.org; linux-acpi@vger.kernel.org;
linux-kernel@vger.kernel.org
Subject: Re: [RFC] [PATCH] Power S3 Resume Optimization Patch. Request
for Comment



And you noticed that, so you fixed obvious problems on block devices.



Add mdelay(1 hour) here. Then try to use your wifi card and your tv

							Pavel

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

From: Pavel Machek
Date: Monday, January 22, 2007 - 5:51 am

If you do this in one block driver that is slow for you (sata?), then it is
probably acceptable. (Maintainer decides.) I'd encourage that option.

If you want to do it for _all_ block devices, you'll probably have to
audit all of them. _Lot_ of work.
							Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-

Previous thread: [RFC, PATCH] workqueue: rework threads/hotplug management by Oleg Nesterov on Thursday, January 18, 2007 - 8:11 pm. (1 message)

Next thread: can someone explain "inline" once and for all? by Robert P. J. Day on Friday, January 19, 2007 - 4:56 am. (11 messages)