SuSE-9.2: suspend to disk errors (after you-update?)
Hi, I try (as usual) to suspend-to-disk with ACPI and powersave on SuSE-9.2. The messages from the system is appended below. Up to now this kind of suspend has worked pretty well, and I am really did not know what has happend. May be this is related to the last you-update I have done a few days ago? I have seen that a x11 update was included, may be this triggers the error? When I boot the system, and try a suspend to disk before any login, suspend/resume works. As soon as I login it failed. My swap-partition has 2GB and I have 768MB RAM. Anyway I had this before and it has worked. Best regards, Michael /var/log/message: Nov 14 19:29:02 wptnb8 kernel: Stopping tasks: ============================================================================================================================================================================| Nov 14 19:29:02 wptnb8 kernel: Freeing memory... done (17088 pages freed) Nov 14 19:29:02 wptnb8 kernel: PM: Attempting to suspend to disk. Nov 14 19:29:02 wptnb8 kernel: PM: snapshotting memory. Nov 14 19:29:02 wptnb8 kernel: swsusp: critical section: Nov 14 19:29:02 wptnb8 kernel: swsusp: Saving Highmem Nov 14 19:29:02 wptnb8 kernel: [nosave pfn 0x3be]<7>[nosave pfn 0x3bf]swsusp: Need to copy 131684 pages Nov 14 19:29:02 wptnb8 kernel: suspend: (pages needed: 131684 + 512 free: 64892) Nov 14 19:29:02 wptnb8 kernel: swsusp: Not enough free pages: Have 64892 Nov 14 19:29:02 wptnb8 kernel: swsusp: Restoring Highmem Nov 14 19:29:02 wptnb8 kernel: PCI: Setting latency timer of device 0000:00:1d.0 to 64 Nov 14 19:29:02 wptnb8 kernel: PCI: Setting latency timer of device 0000:00:1d.0 to 64 Nov 14 19:29:02 wptnb8 kernel: PCI: Setting latency timer of device 0000:00:1d.2 to 64 Nov 14 19:29:03 wptnb8 kernel: PCI: Setting latency timer of device 0000:00:1d.2 to 64 Nov 14 19:29:03 wptnb8 kernel: ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI 11 (level, low) -> IRQ 11 Nov 14 19:29:03 wptnb8 kernel: ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 7 (level, low) -> IRQ 7 Nov 14 19:29:03 wptnb8 kernel: PCI: Setting latency timer of device 0000:00:1f.5 to 64 Nov 14 19:29:03 wptnb8 kernel: ACPI: PCI interrupt 0000:02:01.2[A] -> GSI 11 (level, low) -> IRQ 11 Nov 14 19:29:03 wptnb8 kernel: Restarting tasks... done Nov 14 19:29:03 wptnb8 kernel: alps.c: E6 report: 20 00 64 Nov 14 19:29:04 wptnb8 kernel: alps.c: E6 report: 00 00 64 Nov 14 19:29:04 wptnb8 kernel: alps.c: E7 report: 22 02 14 Nov 14 19:29:04 wptnb8 kernel: alps.c: E6 report: 00 00 64 Nov 14 19:29:04 wptnb8 kernel: alps.c: E7 report: 22 02 14 Nov 14 19:29:04 wptnb8 kernel: alps.c: Status: 10 00 64 Nov 14 19:29:04 wptnb8 kernel: ALPS Touchpad (Dualpoint) detected Nov 14 19:29:04 wptnb8 kernel: Disabling hardware tapping Nov 14 19:29:04 wptnb8 kernel: alps.c: Status: 10 00 64 Nov 14 19:29:04 wptnb8 kernel: evdev_connect: evdev efeb9880 handle efeb989c name event3 Nov 14 19:29:04 wptnb8 kernel: input: AlpsPS/2 ALPS TouchPad on isa0060/serio1 Nov 14 19:32:17 wptnb8 smartd[4729]: Device: /dev/hda, SMART Prefailure Attribute: 3 Spin_Up_Time changed from 250 to 222 Nov 14 19:32:17 wptnb8 smartd[4729]: Device: /dev/hda, SMART Usage Attribute: 194 Temperature_Celsius changed from 112 to 119 and in /var/log/suspend2disk.log suspend2disk initiated: 2004-11-14 19:28:53 Loaded modules: Module Size Used by appletalk 34356 2 ax25 58604 2 ipx 27308 2 soundcore 9056 0 snd_page_alloc 10248 0 cpufreq_userspace 5208 2 speedstep_ich 5004 0 speedstep_lib 4228 1 speedstep_ich freq_table 4356 1 speedstep_ich thermal 17928 0 processor 25640 1 thermal fan 5380 0 button 8464 0 battery 11396 0 ac 6404 0 usbserial 26856 0 parport_pc 37824 1 lp 10536 0 parport 37960 2 parport_pc,lp ipv6 237312 15 edd 10012 0 af_packet 20872 4 3c59x 37544 0 joydev 9664 0 sg 35872 0 st 37404 0 sd_mod 16912 0 sr_mod 16292 0 scsi_mod 111308 4 sg,st,sd_mod,sr_mod ide_cd 38176 0 cdrom 36508 2 sr_mod,ide_cd usbhid 40132 0 ohci1394 31748 0 ieee1394 106168 1 ohci1394 intel_agp 21024 1 agpgart 32168 1 intel_agp yenta_socket 19840 0 pcmcia_core 66100 1 yenta_socket uhci_hcd 29712 0 subfs 7552 1 evdev 8960 0 dm_mod 54524 0 usbcore 106724 5 usbserial,usbhid,uhci_hcd ext3 115688 6 jbd 61348 1 ext3 Memory info: total used free shared buffers cached Mem: 775632 569264 206368 0 3336 72180 -/+ buffers/cache: 493748 281884 Swap: 2104472 447204 1657268 ------------------------------------------------------------------------------ ========we are going to sleep, preparing.======== Stopping services: (ÂŽalsasoundÂŽ configured) none running. ------------------------------------------------------------------------------ Unloading modules: (ÂŽstir4200 ipw2100 ipw2200 prism54 ath_pciÂŽ configured) trying stir4200 trying ipw2100 trying ipw2200 trying prism54 trying ath_pci ------------------------------------------------------------------------------ prepare_sleep finished for suspend2disk ------------------------------------------------------------------------------ ========we are back from suspend, cleaning up.======== Restoring system clock. From: 11/14/04_19:29:09, To: 11/14/04_19:29:11 Resuming: --------- Reloading modules: Restarting services: -- michael@karbach.org www.karbach.org
On Sun, Nov 14, 2004 at 07:44:38PM +0100, Michael Karbach wrote:
Hi,
I try (as usual) to suspend-to-disk with ACPI and powersave on SuSE-9.2. The messages from the system is appended below. Up to now this kind of suspend has worked pretty well, and I am really did not know what has happend. May be this is related to the last you-update I have done a few days ago?
probably not.
/var/log/message:
Nov 14 19:29:02 wptnb8 kernel: Freeing memory... done (17088 pages freed) Nov 14 19:29:02 wptnb8 kernel: PM: Attempting to suspend to disk. Nov 14 19:29:02 wptnb8 kernel: PM: snapshotting memory. Nov 14 19:29:02 wptnb8 kernel: swsusp: critical section: Nov 14 19:29:02 wptnb8 kernel: swsusp: Saving Highmem Nov 14 19:29:02 wptnb8 kernel: [nosave pfn 0x3be]<7>[nosave pfn 0x3bf]swsusp: Need to copy 131684 pages Nov 14 19:29:02 wptnb8 kernel: suspend: (pages needed: 131684 + 512 free: 64892) Nov 14 19:29:02 wptnb8 kernel: swsusp: Not enough free pages: Have 64892
There is not enough memory free to do the atomic copy. The machine needs 131684 pages but it has only 64892...
Nov 14 19:29:02 wptnb8 kernel: swsusp: Restoring Highmem [...] Nov 14 19:29:03 wptnb8 kernel: Restarting tasks... done
...so it resumes immediately. What is strange is the demand for so much memory for suspend. Do you have some very memory-intensive applications running? Note that there is a second error that can happen at suspend: there is enough free memory, but the routine needs an high order allocation (consecutive memory pages) and sometimes memory is fragmented and this allocation (and with it the whole suspend) fails. In this case you get a "page allocation failure" followed by a call backtrace in the logs. Right now there is not much you can do about this but there is work going on to avoid this allocation failures or at least work aroung them. -- Stefan Seyfried
Hi Stefan! On Friday, 19. November 2004 02:21, Stefan Seyfried wrote:
On Sun, Nov 14, 2004 at 07:44:38PM +0100, Michael Karbach wrote:
Hi,
I try (as usual) to suspend-to-disk with ACPI and powersave on SuSE-9.2. The messages from the system is appended below. Up to now this kind of suspend has worked pretty well, and I am really did not know what has happend. May be this is related to the last you-update I have done a few days ago?
probably not.
Right! I have found at least a personal workaround, see below;-)
/var/log/message:
Nov 14 19:29:02 wptnb8 kernel: Freeing memory... done (17088 pages freed) Nov 14 19:29:02 wptnb8 kernel: PM: Attempting to suspend to disk. Nov 14 19:29:02 wptnb8 kernel: PM: snapshotting memory. Nov 14 19:29:02 wptnb8 kernel: swsusp: critical section: Nov 14 19:29:02 wptnb8 kernel: swsusp: Saving Highmem Nov 14 19:29:02 wptnb8 kernel: [nosave pfn 0x3be]<7>[nosave pfn 0x3bf]swsusp: Need to copy 131684 pages Nov 14 19:29:02 wptnb8 kernel: suspend: (pages needed: 131684 + 512 free: 64892) Nov 14 19:29:02 wptnb8 kernel: swsusp: Not enough free pages: Have 64892
There is not enough memory free to do the atomic copy. The machine needs 131684 pages but it has only 64892...
Nov 14 19:29:02 wptnb8 kernel: swsusp: Restoring Highmem
[...]
Nov 14 19:29:03 wptnb8 kernel: Restarting tasks... done
...so it resumes immediately. What is strange is the demand for so much memory for suspend. Do you have some very memory-intensive applications running?
No! Not more than a few days ago, when everything has worked pretty well. Of course I have very many applications running on my 10 virtuell desktops. But this was the same situation as days before.
Note that there is a second error that can happen at suspend: there is enough free memory, but the routine needs an high order allocation (consecutive memory pages) and sometimes memory is fragmented and this allocation (and with it the whole suspend) fails.
Is it not sufficient to have 2GB swap for 768RAM? Or is the problem that I have more than 512MB RAM?
In this case you get a "page allocation failure" followed by a call backtrace in the logs. Right now there is not much you can do about this but there is work going on to avoid this allocation failures or at least work aroung them.
Below you see all my suspend/resume cycles. As you can see till Nov 12 everything has worked pretty well. At this date I have made the you-update, and have followed your advice to remove the second swap-partition. From that next reboot the problem emerged. Up to 17 Nov when I haved added the second swap-partition. From that day on everything works again:-) There are some suspend/resume cycles in between (recognizable by the small numer of needed pages) where the system has suspend well, but in all those occasions there was no one logged in KDE. Best regards, Michael Oct 30 10:18:16 wptnb8 kernel: Need to copy 12371 pages Oct 30 11:48:30 wptnb8 kernel: Need to copy 23529 pages Oct 30 21:21:19 wptnb8 kernel: Need to copy 21714 pages Oct 31 16:53:04 wptnb8 kernel: Need to copy 24670 pages Oct 31 19:44:46 wptnb8 kernel: Need to copy 35168 pages Oct 31 19:51:26 wptnb8 kernel: Need to copy 14550 pages Oct 31 19:59:23 wptnb8 kernel: Need to copy 19484 pages Nov 1 20:37:12 wptnb8 kernel: Need to copy 28779 pages Nov 2 07:28:33 wptnb8 kernel: Need to copy 31191 pages Nov 2 12:34:32 wptnb8 kernel: Need to copy 23718 pages Nov 2 15:39:15 wptnb8 kernel: Need to copy 26984 pages Nov 2 21:17:55 wptnb8 kernel: Need to copy 27618 pages Nov 3 08:29:49 wptnb8 kernel: Need to copy 14803 pages Nov 3 16:45:43 wptnb8 kernel: Need to copy 30395 pages Nov 3 22:16:29 wptnb8 kernel: Need to copy 31487 pages Nov 4 11:09:21 wptnb8 kernel: Need to copy 18131 pages Nov 4 16:37:02 wptnb8 kernel: Need to copy 28242 pages Nov 4 21:30:59 wptnb8 kernel: Need to copy 34134 pages Nov 5 21:15:38 wptnb8 kernel: Need to copy 36417 pages Nov 5 21:39:29 wptnb8 kernel: Need to copy 19842 pages Nov 6 21:26:00 wptnb8 kernel: Need to copy 33096 pages Nov 6 21:31:55 wptnb8 kernel: Need to copy 14773 pages Nov 7 08:41:09 wptnb8 kernel: Need to copy 33680 pages Nov 7 20:42:53 wptnb8 kernel: Need to copy 33339 pages Nov 7 21:10:52 wptnb8 kernel: Need to copy 18196 pages Nov 8 12:42:49 wptnb8 kernel: Need to copy 32474 pages Nov 8 12:47:30 wptnb8 kernel: Need to copy 18039 pages Nov 8 16:56:27 wptnb8 kernel: Need to copy 14975 pages Nov 8 21:16:50 wptnb8 kernel: Need to copy 33602 pages Nov 9 10:30:47 wptnb8 kernel: Need to copy 34851 pages Nov 9 10:39:10 wptnb8 kernel: Need to copy 17907 pages Nov 9 11:00:06 wptnb8 kernel: Need to copy 27107 pages Nov 9 20:52:56 wptnb8 kernel: Need to copy 19605 pages Nov 10 08:21:50 wptnb8 kernel: Need to copy 22570 pages Nov 10 08:42:45 wptnb8 kernel: Need to copy 17281 pages Nov 10 15:40:48 wptnb8 kernel: Need to copy 17177 pages Nov 10 21:25:55 wptnb8 kernel: Need to copy 19270 pages Nov 11 07:31:55 wptnb8 kernel: Need to copy 21397 pages Nov 11 07:47:52 wptnb8 kernel: Need to copy 18353 pages Nov 11 17:48:14 wptnb8 kernel: Need to copy 19332 pages Nov 11 21:05:01 wptnb8 kernel: Need to copy 20666 pages Nov 12 21:44:42 wptnb8 kernel: Need to copy 170878 pages Nov 12 21:49:19 wptnb8 kernel: Need to copy 161254 pages Nov 12 21:49:57 wptnb8 kernel: Need to copy 160928 pages Nov 12 21:50:57 wptnb8 kernel: Need to copy 161755 pages Nov 12 21:51:41 wptnb8 kernel: Need to copy 161005 pages Nov 13 12:24:04 wptnb8 kernel: Need to copy 145906 pages Nov 13 12:24:43 wptnb8 kernel: Need to copy 145686 pages Nov 13 22:08:20 wptnb8 kernel: Need to copy 148349 pages Nov 13 22:10:06 wptnb8 kernel: Need to copy 148233 pages Nov 13 22:11:00 wptnb8 kernel: Need to copy 147958 pages Nov 13 22:11:41 wptnb8 kernel: Need to copy 148896 pages Nov 13 22:14:26 wptnb8 kernel: Need to copy 149065 pages Nov 13 23:31:15 wptnb8 kernel: Need to copy 42050 pages Nov 14 08:38:15 wptnb8 kernel: Need to copy 146226 pages Nov 14 08:38:53 wptnb8 kernel: Need to copy 146493 pages Nov 14 18:34:24 wptnb8 kernel: Need to copy 27855 pages Nov 14 19:08:45 wptnb8 kernel: Need to copy 27818 pages Nov 14 19:24:22 wptnb8 kernel: Need to copy 131239 pages Nov 14 19:26:27 wptnb8 kernel: Need to copy 131604 pages Nov 14 19:29:02 wptnb8 kernel: Need to copy 131684 pages Nov 14 19:47:13 wptnb8 kernel: Need to copy 140097 pages Nov 14 19:56:27 wptnb8 kernel: Need to copy 121729 pages Nov 14 19:58:14 wptnb8 kernel: Need to copy 122419 pages Nov 14 20:35:52 wptnb8 kernel: Need to copy 122782 pages Nov 14 21:49:14 wptnb8 kernel: Need to copy 38783 pages Nov 14 20:41:40 wptnb8 kernel: Need to copy 51067 pages Nov 14 20:46:42 wptnb8 kernel: Need to copy 120917 pages Nov 14 20:48:24 wptnb8 kernel: Need to copy 121097 pages Nov 14 20:49:04 wptnb8 kernel: Need to copy 121233 pages Nov 14 20:50:16 wptnb8 kernel: Need to copy 121169 pages Nov 14 20:50:54 wptnb8 kernel: Need to copy 121202 pages Nov 14 21:06:51 wptnb8 kernel: Need to copy 38683 pages Nov 14 21:10:35 wptnb8 kernel: Need to copy 123069 pages Nov 14 21:18:11 wptnb8 kernel: Need to copy 111189 pages Nov 14 21:23:30 wptnb8 kernel: Need to copy 112072 pages Nov 14 21:27:02 wptnb8 kernel: Need to copy 105722 pages Nov 14 21:28:36 wptnb8 kernel: Need to copy 104933 pages Nov 14 21:32:40 wptnb8 kernel: Need to copy 86330 pages Nov 15 11:46:57 wptnb8 kernel: Need to copy 141656 pages Nov 15 21:50:28 wptnb8 kernel: Need to copy 142392 pages Nov 16 20:44:49 wptnb8 kernel: Need to copy 161256 pages Nov 16 21:48:03 wptnb8 kernel: Need to copy 158536 pages Nov 17 08:32:00 wptnb8 kernel: Need to copy 43310 pages Nov 17 08:56:13 wptnb8 kernel: Need to copy 23716 pages Nov 17 16:33:33 wptnb8 kernel: Need to copy 42589 pages Nov 17 21:33:22 wptnb8 kernel: Need to copy 24823 pages Nov 18 07:28:50 wptnb8 kernel: Need to copy 17285 pages Nov 18 14:25:22 wptnb8 kernel: Need to copy 26994 pages Nov 18 21:04:48 wptnb8 kernel: Need to copy 25490 pages
Stefan Seyfried
-- michael@karbach.org www.karbach.org
Hi Michael, i'm taking Pavel Machek into Cc: as he is one of the main developers of swsusp. He is not on this list so remember to CC him as well. I think he might be interested in this particular problem. BTW: if this gets longer, we might take it off-list to not annoy everyone with voluminous logs and technical details :-) On Fri, Nov 19, 2004 at 12:41:10PM +0100, Michael Karbach wrote:
Is it not sufficient to have 2GB swap for 768RAM? Or is the problem that I have more than 512MB RAM?
The problem is almost always not "not enough swap" but "not enough free memory". I'll take a ride into theory... :-) To suspend, we do the following (this is a bit simplified). 1 Free as much memory as possible by pushing applications into swap 2 stop all processes 3 stop all device drivers, to prevent us from ongoing DMA transfers etc. now the machine is totally calm, nothing is running except the swsusp routine. 4 make an atomic copy of the used memory. 5 restart device drivers 6 write the copy to disk. The "original" may be modified e.g. by DMA transfers etc, this changes get lost. You'll notice this in the syslog or on the console during resume where some of the messages during suspend are not logged - these are the messages displayed _after_ the atomic copy was made. As you can easily see, at point 4), we have to have half of the physical RAM free or we cannot make the atomic copy. -> this is what happened to you.
Below you see all my suspend/resume cycles. As you can see till Nov 12 everything has worked pretty well. At this date I have made the you-update, and have followed your advice to remove the second swap-partition. From that next reboot the problem emerged. Up to 17 Nov when I haved added the second swap-partition. From that day on everything works again:-)
And this is where it gets very interesting. Can you also grep through your logs for the number of pages that were freed ("Freeing memory... XXX pages freed") at each of these occasions? I _think_ that your machine fails to free enough pages to suspend successfully if it only has one partition and although i have no idea why, this list would confirm at least my theory. Short summary for Pavel (Michael correct me if i am wrong :-): Michael has 768MB RAM and 2GB swap. Originally he had 3GB swap (2+1) and i told him this was probably a bad idea and he should drop one of the swap partition. Since then, suspend often fails with not enough free memory, the original case was: : Freeing memory... done (17088 pages freed) : PM: Attempting to suspend to disk. : PM: snapshotting memory. : swsusp: critical section: : swsusp: Saving Highmem : [nosave pfn 0x3be]<7>[nosave pfn 0x3bf]swsusp: Need to copy 131684 pages : suspend: (pages needed: 131684 + 512 free: 64892) : swsusp: Not enough free pages: Have 64892 : swsusp: Restoring Highmem after readding the second swap partition, it works better again. The question is: what bad consequences may arise from the second swap partition? Is the "you shall have only one swap partition!"-dogma still true? Does it work by accident or is this safe now?
There are some suspend/resume cycles in between (recognizable by the small numer of needed pages) where the system has suspend well, but in all those occasions there was no one logged in KDE.
Best regards,
Michael
Oct 30 10:18:16 wptnb8 kernel: Need to copy 12371 pages Oct 30 11:48:30 wptnb8 kernel: Need to copy 23529 pages Oct 30 21:21:19 wptnb8 kernel: Need to copy 21714 pages Oct 31 16:53:04 wptnb8 kernel: Need to copy 24670 pages Oct 31 19:44:46 wptnb8 kernel: Need to copy 35168 pages Oct 31 19:51:26 wptnb8 kernel: Need to copy 14550 pages Oct 31 19:59:23 wptnb8 kernel: Need to copy 19484 pages Nov 1 20:37:12 wptnb8 kernel: Need to copy 28779 pages Nov 2 07:28:33 wptnb8 kernel: Need to copy 31191 pages Nov 2 12:34:32 wptnb8 kernel: Need to copy 23718 pages Nov 2 15:39:15 wptnb8 kernel: Need to copy 26984 pages Nov 2 21:17:55 wptnb8 kernel: Need to copy 27618 pages Nov 3 08:29:49 wptnb8 kernel: Need to copy 14803 pages Nov 3 16:45:43 wptnb8 kernel: Need to copy 30395 pages Nov 3 22:16:29 wptnb8 kernel: Need to copy 31487 pages Nov 4 11:09:21 wptnb8 kernel: Need to copy 18131 pages Nov 4 16:37:02 wptnb8 kernel: Need to copy 28242 pages Nov 4 21:30:59 wptnb8 kernel: Need to copy 34134 pages Nov 5 21:15:38 wptnb8 kernel: Need to copy 36417 pages Nov 5 21:39:29 wptnb8 kernel: Need to copy 19842 pages Nov 6 21:26:00 wptnb8 kernel: Need to copy 33096 pages Nov 6 21:31:55 wptnb8 kernel: Need to copy 14773 pages Nov 7 08:41:09 wptnb8 kernel: Need to copy 33680 pages Nov 7 20:42:53 wptnb8 kernel: Need to copy 33339 pages Nov 7 21:10:52 wptnb8 kernel: Need to copy 18196 pages Nov 8 12:42:49 wptnb8 kernel: Need to copy 32474 pages Nov 8 12:47:30 wptnb8 kernel: Need to copy 18039 pages Nov 8 16:56:27 wptnb8 kernel: Need to copy 14975 pages Nov 8 21:16:50 wptnb8 kernel: Need to copy 33602 pages Nov 9 10:30:47 wptnb8 kernel: Need to copy 34851 pages Nov 9 10:39:10 wptnb8 kernel: Need to copy 17907 pages Nov 9 11:00:06 wptnb8 kernel: Need to copy 27107 pages Nov 9 20:52:56 wptnb8 kernel: Need to copy 19605 pages Nov 10 08:21:50 wptnb8 kernel: Need to copy 22570 pages Nov 10 08:42:45 wptnb8 kernel: Need to copy 17281 pages Nov 10 15:40:48 wptnb8 kernel: Need to copy 17177 pages Nov 10 21:25:55 wptnb8 kernel: Need to copy 19270 pages Nov 11 07:31:55 wptnb8 kernel: Need to copy 21397 pages Nov 11 07:47:52 wptnb8 kernel: Need to copy 18353 pages Nov 11 17:48:14 wptnb8 kernel: Need to copy 19332 pages Nov 11 21:05:01 wptnb8 kernel: Need to copy 20666 pages Nov 12 21:44:42 wptnb8 kernel: Need to copy 170878 pages Nov 12 21:49:19 wptnb8 kernel: Need to copy 161254 pages Nov 12 21:49:57 wptnb8 kernel: Need to copy 160928 pages Nov 12 21:50:57 wptnb8 kernel: Need to copy 161755 pages Nov 12 21:51:41 wptnb8 kernel: Need to copy 161005 pages Nov 13 12:24:04 wptnb8 kernel: Need to copy 145906 pages Nov 13 12:24:43 wptnb8 kernel: Need to copy 145686 pages Nov 13 22:08:20 wptnb8 kernel: Need to copy 148349 pages Nov 13 22:10:06 wptnb8 kernel: Need to copy 148233 pages Nov 13 22:11:00 wptnb8 kernel: Need to copy 147958 pages Nov 13 22:11:41 wptnb8 kernel: Need to copy 148896 pages Nov 13 22:14:26 wptnb8 kernel: Need to copy 149065 pages Nov 13 23:31:15 wptnb8 kernel: Need to copy 42050 pages Nov 14 08:38:15 wptnb8 kernel: Need to copy 146226 pages Nov 14 08:38:53 wptnb8 kernel: Need to copy 146493 pages Nov 14 18:34:24 wptnb8 kernel: Need to copy 27855 pages Nov 14 19:08:45 wptnb8 kernel: Need to copy 27818 pages Nov 14 19:24:22 wptnb8 kernel: Need to copy 131239 pages Nov 14 19:26:27 wptnb8 kernel: Need to copy 131604 pages Nov 14 19:29:02 wptnb8 kernel: Need to copy 131684 pages Nov 14 19:47:13 wptnb8 kernel: Need to copy 140097 pages Nov 14 19:56:27 wptnb8 kernel: Need to copy 121729 pages Nov 14 19:58:14 wptnb8 kernel: Need to copy 122419 pages Nov 14 20:35:52 wptnb8 kernel: Need to copy 122782 pages Nov 14 21:49:14 wptnb8 kernel: Need to copy 38783 pages Nov 14 20:41:40 wptnb8 kernel: Need to copy 51067 pages Nov 14 20:46:42 wptnb8 kernel: Need to copy 120917 pages Nov 14 20:48:24 wptnb8 kernel: Need to copy 121097 pages Nov 14 20:49:04 wptnb8 kernel: Need to copy 121233 pages Nov 14 20:50:16 wptnb8 kernel: Need to copy 121169 pages Nov 14 20:50:54 wptnb8 kernel: Need to copy 121202 pages Nov 14 21:06:51 wptnb8 kernel: Need to copy 38683 pages Nov 14 21:10:35 wptnb8 kernel: Need to copy 123069 pages Nov 14 21:18:11 wptnb8 kernel: Need to copy 111189 pages Nov 14 21:23:30 wptnb8 kernel: Need to copy 112072 pages Nov 14 21:27:02 wptnb8 kernel: Need to copy 105722 pages Nov 14 21:28:36 wptnb8 kernel: Need to copy 104933 pages Nov 14 21:32:40 wptnb8 kernel: Need to copy 86330 pages Nov 15 11:46:57 wptnb8 kernel: Need to copy 141656 pages Nov 15 21:50:28 wptnb8 kernel: Need to copy 142392 pages Nov 16 20:44:49 wptnb8 kernel: Need to copy 161256 pages Nov 16 21:48:03 wptnb8 kernel: Need to copy 158536 pages Nov 17 08:32:00 wptnb8 kernel: Need to copy 43310 pages Nov 17 08:56:13 wptnb8 kernel: Need to copy 23716 pages Nov 17 16:33:33 wptnb8 kernel: Need to copy 42589 pages Nov 17 21:33:22 wptnb8 kernel: Need to copy 24823 pages Nov 18 07:28:50 wptnb8 kernel: Need to copy 17285 pages Nov 18 14:25:22 wptnb8 kernel: Need to copy 26994 pages Nov 18 21:04:48 wptnb8 kernel: Need to copy 25490 pages
just as a reference, here are the values from my machine (a thinkpad T40p, 512MB RAM, 1G swap, freshly installed on monday, so not too many suspend cycles yet): seife@susi:~> awk -F "done " '/Freeing memory/ {print $2}' /var/log/messages (101260 pages freed) (42729 pages freed) (18916 pages freed) (18731 pages freed) (108703 pages freed) (79709 pages freed) (25728 pages freed) (98369 pages freed) (96047 pages freed) (91920 pages freed) seife@susi:~> awk -F swsusp: '/Need to copy/ {print $2}' /var/log/messages Need to copy 13699 pages Need to copy 13808 pages Need to copy 11292 pages Need to copy 12307 pages Need to copy 13956 pages Need to copy 16682 pages Need to copy 14834 pages Need to copy 14256 pages Need to copy 12727 pages Need to copy 17815 pages Need to copy 37693 pages so you see that my numbers are clearly different from yours, much more freed and less to copy although i am almost always logged into KDE when suspending (although not too many applications are running). A last question Michael: did you do any "VM tuning" or are you running some database-server software (they are known for sometimes doing this in their start scripts)? This would be one way to explain the behaviour. -- Stefan Seyfried
Hi Stefan! On Friday, 19. November 2004 17:54, Stefan Seyfried wrote:
Hi Michael,
i'm taking Pavel Machek into Cc: as he is one of the main developers of swsusp. He is not on this list so remember to CC him as well. I think he might be interested in this particular problem. BTW: if this gets longer, we might take it off-list to not annoy everyone with voluminous logs and technical details :-)
Ok, its up to you to decide whether it is too long!
On Fri, Nov 19, 2004 at 12:41:10PM +0100, Michael Karbach wrote:
Is it not sufficient to have 2GB swap for 768RAM? Or is the problem that I have more than 512MB RAM?
The problem is almost always not "not enough swap" but "not enough free memory". I'll take a ride into theory... :-) To suspend, we do the following (this is a bit simplified). 1 Free as much memory as possible by pushing applications into swap 2 stop all processes 3 stop all device drivers, to prevent us from ongoing DMA transfers etc. now the machine is totally calm, nothing is running except the swsusp routine. 4 make an atomic copy of the used memory. 5 restart device drivers 6 write the copy to disk. The "original" may be modified e.g. by DMA transfers etc, this changes get lost. You'll notice this in the syslog or on the console during resume where some of the messages during suspend are not logged - these are the messages displayed _after_ the atomic copy was made.
As you can easily see, at point 4), we have to have half of the physical RAM free or we cannot make the atomic copy. -> this is what happened to you.
OK, I understand.
Below you see all my suspend/resume cycles. As you can see till Nov 12 everything has worked pretty well. At this date I have made the you-update, and have followed your advice to remove the second swap-partition. From that next reboot the problem emerged. Up to 17 Nov when I haved added the second swap-partition. From that day on everything works again:-)
And this is where it gets very interesting. Can you also grep through your logs for the number of pages that were freed ("Freeing memory... XXX pages freed") at each of these occasions? I _think_ that your machine fails to free enough pages to suspend successfully if it only has one partition and although i have no idea why, this list would confirm at least my theory.
Here my data, unfortunately the number of needed and freed messages are not the same. I have used your awk commands. I have tried to adjust at least the most important dates from the point on activating the second swap Need to copy 12371 pages (53229 pages freed) Need to copy 23529 pages (78981 pages freed) Need to copy 21714 pages (69031 pages freed) Need to copy 24670 pages (66804 pages freed) Need to copy 35168 pages (79715 pages freed) Need to copy 14550 pages (107169 pages freed) Need to copy 19484 pages (27911 pages freed) Need to copy 28779 pages (75107 pages freed) Need to copy 31191 pages (69838 pages freed) Need to copy 23718 pages (109292 pages freed) Need to copy 26984 pages (116909 pages freed) Need to copy 27618 pages (104286 pages freed) Need to copy 14803 pages (99320 pages freed) Need to copy 30395 pages (103553 pages freed) Need to copy 31487 pages (78260 pages freed) Need to copy 18131 pages (82152 pages freed) Need to copy 28242 pages (17187 pages freed) Need to copy 34134 pages (20931 pages freed) Need to copy 36417 pages (16490 pages freed) Need to copy 19842 pages (18832 pages freed) Need to copy 33096 pages (17274 pages freed) Need to copy 14773 pages (43732 pages freed) Need to copy 33680 pages (11124 pages freed) Need to copy 33339 pages (43723 pages freed) Need to copy 18196 pages (11326 pages freed) Need to copy 32474 pages (11232 pages freed) Need to copy 18039 pages (9662 pages freed) Need to copy 14975 pages (14694 pages freed) Need to copy 33602 pages (17057 pages freed) Need to copy 34851 pages (38602 pages freed) Need to copy 17907 pages (9282 pages freed) Need to copy 27107 pages (40987 pages freed) Need to copy 19605 pages (1808 pages freed) Need to copy 22570 pages (42426 pages freed) Need to copy 17281 pages (34637 pages freed) Need to copy 17177 pages (37085 pages freed) Need to copy 19270 pages (37290 pages freed) Need to copy 21397 pages (22128 pages freed) Need to copy 18353 pages (3939 pages freed) Need to copy 19332 pages (58706 pages freed) Need to copy 20666 pages (16343 pages freed) Need to copy 170878 pages (17088 pages freed) Need to copy 161254 pages (30334 pages freed) Need to copy 160928 pages (30958 pages freed) Need to copy 161755 pages (10749 pages freed) Need to copy 161005 pages (21040 pages freed) Need to copy 145906 pages (11960 pages freed) Need to copy 145686 pages (23744 pages freed) Need to copy 148349 pages (39153 pages freed) Need to copy 148233 pages (13831 pages freed) Need to copy 147958 pages (8152 pages freed) Need to copy 148896 pages (9901 pages freed) Need to copy 149065 pages (10361 pages freed) Need to copy 42050 pages (43638 pages freed) Need to copy 146226 pages (37352 pages freed) Need to copy 146493 pages (47487 pages freed) Need to copy 27855 pages (16389 pages freed) Need to copy 27818 pages (14896 pages freed) Need to copy 131239 pages (15644 pages freed) Need to copy 131604 pages (16668 pages freed) Need to copy 131684 pages Need to copy 140097 pages Need to copy 121729 pages Need to copy 122419 pages Need to copy 122782 pages Need to copy 38783 pages Need to copy 51067 pages Need to copy 120917 pages Need to copy 121097 pages Need to copy 121233 pages Need to copy 121169 pages Need to copy 121202 pages Need to copy 38683 pages Need to copy 123069 pages Need to copy 111189 pages Need to copy 112072 pages Need to copy 105722 pages Need to copy 104933 pages Need to copy 86330 pages Need to copy 141656 pages Need to copy 142392 pages Need to copy 161256 pages Need to copy 158536 pages Need to copy 43310 pages (50957 pages freed) <- reboot with 2 swap Need to copy 23716 pages (51644 pages freed) Need to copy 42589 pages (31211 pages freed) Need to copy 24823 pages (30662 pages freed) Need to copy 17285 pages (46614 pages freed) Need to copy 26994 pages (30551 pages freed) Need to copy 25490 pages It should be noted that a reboot was necessary. Because before I have had not the information that the amount of swap was not the most important data. So i have tried while it has not worked to swapon/off any combination of my two swap-partitions without success. Only after rebooting it has worked. If you like I can now swapoff now one of the swaps.
Short summary for Pavel (Michael correct me if i am wrong :-): Michael has 768MB RAM and 2GB swap. Originally he had 3GB swap (2+1)
Yes, correct here the details: /dev/hda1 swap swap pri=42 0 0 /dev/hda9 swap swap pri=42 0 0 as a shnapshot from now: su-wptnb8 /var/log: free total used free shared buffers cached Mem: 775632 757228 18404 0 34452 235860 -/+ buffers/cache: 486916 288716 Swap: 3156688 524624 2632064
and i told him this was probably a bad idea and he should drop one of the swap partition. Since then, suspend often fails with not enough free memory, the
original case was: : Freeing memory... done (17088 pages freed) : PM: Attempting to suspend to disk. : PM: snapshotting memory. : swsusp: critical section: : swsusp: Saving Highmem : [nosave pfn 0x3be]<7>[nosave pfn 0x3bf]swsusp: Need to copy 131684 pages : suspend: (pages needed: 131684 + 512 free: 64892) : swsusp: Not enough free pages: Have 64892 : swsusp: Restoring Highmem
after readding the second swap partition, it works better again. The question is: what bad consequences may arise from the second swap partition? Is the "you shall have only one swap partition!"-dogma still true? Does it work by accident or is this safe now?
just as a reference, here are the values from my machine (a thinkpad T40p, 512MB RAM, 1G swap, freshly installed on monday, so not too many suspend cycles yet): seife@susi:~> awk -F "done " '/Freeing memory/ {print $2}' /var/log/messages (101260 pages freed) (42729 pages freed) (18916 pages freed) (18731 pages freed) (108703 pages freed)
(79709 pages freed) (25728 pages freed) (98369 pages freed) (96047 pages freed) (91920 pages freed) seife@susi:~> awk -F swsusp: '/Need to copy/ {print $2}' /var/log/messages Need to copy 13699 pages Need to copy 13808 pages Need to copy 11292 pages Need to copy 12307 pages Need to copy 13956 pages Need to copy 16682 pages Need to copy 14834 pages Need to copy 14256 pages Need to copy 12727 pages Need to copy 17815 pages Need to copy 37693 pages
so you see that my numbers are clearly different from yours, much more freed and less to copy although i am almost always logged into KDE when suspending (although not too many applications are running).
A last question Michael: did you do any "VM tuning" or are you running some database-server software (they are known for sometimes doing this in their start scripts)? This would be one way to explain the behaviour.
No, I do not have anything tuned, nor do I have a running database, at least none of which I am aware. But as a typically scenario I have very many running processes: xemacs kontact 5-10 konsole 2-5 konqueror with different profiles 4-10 kpdf,kdvi,kghostview 1-3 OO several kicker applets sometimes xmaple (but not very often) Michael -- michael@karbach.org www.karbach.org
participants (2)
-
Michael Karbach
-
Stefan Seyfried