All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix complile warnings in suspend.c, 2.5.28
@ 2002-07-25 12:40 Craig Kulesa
  2002-07-25 21:53 ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: Craig Kulesa @ 2002-07-25 12:40 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel



This fixes some compile time warnings in suspend.c.  Look sensible? 
It's tested, even with full rmap and slab-on-LRU patches.  Even worked 
when suspending from X!

--- linux-2.5.28-rmap-slablru/kernel/suspend.c~	Wed Jul 24 20:56:59 2002
+++ linux-2.5.28-rmap-slablru/kernel/suspend.c	Wed Jul 24 21:05:21 2002
@@ -66,6 +66,7 @@
 #include <linux/swapops.h>
 
 extern void signal_wake_up(struct task_struct *t);
+asmlinkage void sys_sync(void);	/* it's really int */
 
 unsigned char software_suspend_enabled = 0;
 
@@ -1004,8 +1005,9 @@
 
 static int bdev_write_page(struct block_device *bdev, long pos, void *buf)
 {
-	struct buffer_head *bh;
 #if 0
+	struct buffer_head *bh;
+
 	BUG_ON (pos%PAGE_SIZE);
 	bh = __bread(bdev, pos/PAGE_SIZE, PAGE_SIZE);
 	if (!bh || (!bh->b_data)) {


Craig Kulesa
Steward Obs.
Univ. of Arizona


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix complile warnings in suspend.c, 2.5.28
  2002-07-25 12:40 [PATCH] Fix complile warnings in suspend.c, 2.5.28 Craig Kulesa
@ 2002-07-25 21:53 ` Pavel Machek
  2002-07-25 22:49   ` [PATCH] Fix compile " Craig Kulesa
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2002-07-25 21:53 UTC (permalink / raw)
  To: Craig Kulesa; +Cc: Pavel Machek, linux-kernel

Hi!

> This fixes some compile time warnings in suspend.c.  Look sensible? 
> It's tested, even with full rmap and slab-on-LRU patches.  Even worked 
> when suspending from X!

Does it work for you? I get reboot after S4 on 2.5.28. Can you mail me
diff between clean and your tree?
								Pavel
-- 
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix compile warnings in suspend.c, 2.5.28
  2002-07-25 21:53 ` Pavel Machek
@ 2002-07-25 22:49   ` Craig Kulesa
  2002-07-26  9:57     ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: Craig Kulesa @ 2002-07-25 22:49 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel


On Thu, 25 Jul 2002, Pavel Machek wrote:

> Does it work for you? I get reboot after S4 on 2.5.28. Can you mail me
> diff between clean and your tree?

Isn't the 'reboot after S4' due to #define TEST_SWSUSP 1?   I set it 
to 0 and it shuts down properly for me.  I'm not sure why rebooting should 
be the default behavior, actually -- it seems a bit strange.

My laptop's at home, but I applied the following patches from:
	http://loke.as.arizona.edu/~ckulesa/kernel/rmap-vm/2.5.28/

I applied the 2 rmap-related patches in order, then the remaining patches 
(which are trivial cleanups and compile-fixes) in no special order.  
2.5.28-swsusp is the patch in this thread.  This won't change the "reboot 
after S4" behavior without the additional change to TEST_SWSUSP, above. 

Side note:
The only change to suspend.c that I made which isn't covered by 
the patch in this thread, is the try_to_free_pages() line -- 
but this is specific to the "full rmap-VM for 2.5".  The big rmap patch 
(2.5.28-rmap-1-rmap13b) makes this single alteration.

Second side note:
For the vanilla 2.5 classzone VM, I don't honestly understand why we're 
only looking at &contig_page_data.node_zones[ZONE_HIGHMEM] in
try_to_free_pages().  On the other hand, I don't see how it would break
swsusp.

And a note of appreciation: :)
This was the very first time I tried ACPI and swsusp! I had been using 
APM before, but had no hibernation capability (my BIOS only worked 
properly with suspend to RAM in Linux).  This is really a nice feature!

But now I have to figure out how to teach acpid to do useful stuff, like 
throttle the CPU and try to S4 on lid close and such. :)

Craig Kulesa
Steward Obs.
Univ. of Arizona


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix compile warnings in suspend.c, 2.5.28
  2002-07-25 22:49   ` [PATCH] Fix compile " Craig Kulesa
@ 2002-07-26  9:57     ` Pavel Machek
  2002-07-26 10:31       ` Craig Kulesa
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2002-07-26  9:57 UTC (permalink / raw)
  To: Craig Kulesa; +Cc: linux-kernel

Hi!

> > Does it work for you? I get reboot after S4 on 2.5.28. Can you mail me
> > diff between clean and your tree?
> 
> Isn't the 'reboot after S4' due to #define TEST_SWSUSP 1?   I set it 
> to 0 and it shuts down properly for me.  I'm not sure why rebooting should 
> be the default behavior, actually -- it seems a bit strange.

Actually, I get two reboots. One expected after suspend and one
unexpected after resume.

TEST_SWSUSP is one so I can test it properly. I want to be Linus's
swsusp same as mine for 2.5. TEST_SWSUSP is going to be 0 at 2.6.

> My laptop's at home, but I applied the following patches from:
> 	http://loke.as.arizona.edu/~ckulesa/kernel/rmap-vm/2.5.28/
> 
> I applied the 2 rmap-related patches in order, then the remaining patches 
> (which are trivial cleanups and compile-fixes) in no special order.  
> 2.5.28-swsusp is the patch in this thread.  This won't change the "reboot 
> after S4" behavior without the additional change to TEST_SWSUSP,
> above. 

Can you do multiple S4 enters/leaves? Good test is to make bzImage
while doing while true; do echo 4 > /proc/acpi/sleep; sleep 30; done.

> Side note:
> The only change to suspend.c that I made which isn't covered by 
> the patch in this thread, is the try_to_free_pages() line -- 
> but this is specific to the "full rmap-VM for 2.5".  The big rmap patch 
> (2.5.28-rmap-1-rmap13b) makes this single alteration.

Okay.

> Second side note:
> For the vanilla 2.5 classzone VM, I don't honestly understand why we're 
> only looking at &contig_page_data.node_zones[ZONE_HIGHMEM] in
> try_to_free_pages().  On the other hand, I don't see how it would break
> swsusp.

I don't understand that line, either. Andrea told me to write it like
that, IIRC ;-).

> And a note of appreciation: :)
> This was the very first time I tried ACPI and swsusp! I had been using 
> APM before, but had no hibernation capability (my BIOS only worked 
> properly with suspend to RAM in Linux).  This is really a nice feature!
> 
> But now I have to figure out how to teach acpid to do useful stuff, like 
> throttle the CPU and try to S4 on lid close and such. :)

Throttling the CPU should be pretty easy [see
/proc/acpi/processor/0/*], and it should already enter sleep modes for
you.

								Pavel
-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix compile warnings in suspend.c, 2.5.28
  2002-07-26  9:57     ` Pavel Machek
@ 2002-07-26 10:31       ` Craig Kulesa
  0 siblings, 0 replies; 5+ messages in thread
From: Craig Kulesa @ 2002-07-26 10:31 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel


On Fri, 26 Jul 2002, Pavel Machek wrote:

> Actually, I get two reboots. One expected after suspend and one
> unexpected after resume.

I see.  I'm only getting the single, expected, reboot.  I have found that 
if I mess with the contents of /proc/acpi after resuming, the system 
freezes solid within a few seconds.  I see a patch in Linus' BK tree that 
looks like a possible fix for ACPI.  I'll test that in 2.5.29.  In the 
meantime, I can suspend to disk just fine however.

> TEST_SWSUSP is one so I can test it properly. I want to be Linus's
> swsusp same as mine for 2.5. TEST_SWSUSP is going to be 0 at 2.6.

Sounds fair.  At least I can change it for my own use. :)

> Can you do multiple S4 enters/leaves? Good test is to make bzImage
> while doing while true; do echo 4 > /proc/acpi/sleep; sleep 30; done.

Yes.  Once memory fills up, I can't get enough free pages, but running a
userspace "eatmem" program in the script before suspending fixes that just
fine.  That also speeds up the suspnd/resume time.  The calls to
try_to_free_pages() don't go nearly far enough since the rmap VM stops
freeing memory once *it thinks* there are enough free pages. Being able to
tell it to ignore it's internal watermarks would fix this.

> Throttling the CPU should be pretty easy [see
> /proc/acpi/processor/0/*], and it should already enter sleep modes for
> you.

Neat, thanks! 

Regards,

Craig Kulesa
Steward Obs.
Univ. of Arizona


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-07-26 10:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-25 12:40 [PATCH] Fix complile warnings in suspend.c, 2.5.28 Craig Kulesa
2002-07-25 21:53 ` Pavel Machek
2002-07-25 22:49   ` [PATCH] Fix compile " Craig Kulesa
2002-07-26  9:57     ` Pavel Machek
2002-07-26 10:31       ` Craig Kulesa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.