* Re: [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled
[not found] <20050306030852.23eb59db.akpm@osdl.org>
@ 2005-03-06 22:57 ` Pavel Machek
2005-03-07 3:59 ` Andrew Morton
0 siblings, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2005-03-06 22:57 UTC (permalink / raw)
To: Andrew Morton, kernel list; +Cc: barryn
Hi!
> Problem Description:
> swsusp normally works, but if I enable CONFIG_DEBUG_PAGEALLOC, it breaks --
> after "PM: snapshotting memory", swsusp never gets to the "critical section" and
> it kind of bounces back from the suspend attempt, for lack of a better way for
> me to describe the effect.
Okay, that is because low-level assembly requires PSE (4mb pages for
kernel) and DEBUG_PAGEALLOC disables that capability.
If you feel like rewriting assembly code to turn off paging (and thus
working with PSE), go ahead, but I do not think it is worth the
trouble.
OTOH we should at least tell people what went wrong, some people seen
same problem on VIA cpus... Please apply,
Signed-off-by: Pavel Machek <pavel@suse.cz>
Pavel
--- clean/include/asm-i386/suspend.h 2004-12-25 13:35:02.000000000 +0100
+++ linux/include/asm-i386/suspend.h 2005-03-02 01:05:33.000000000 +0100
@@ -10,10 +10,12 @@
arch_prepare_suspend(void)
{
/* If you want to make non-PSE machine work, turn off paging
- in do_magic. swsusp_pg_dir should have identity mapping, so
+ in swsusp_arch_suspend. swsusp_pg_dir should have identity mapping, so
it could work... */
- if (!cpu_has_pse)
+ if (!cpu_has_pse) {
+ printk(KERN_ERR "PSE is required for swsusp.\n");
return -EPERM;
+ }
return 0;
}
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled
2005-03-06 22:57 ` [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled Pavel Machek
@ 2005-03-07 3:59 ` Andrew Morton
2005-03-07 5:12 ` [PATCH] kconfig: DEBUG_PAGEALLOC and SOFTWARE_SUSPEND are incompatible on i386 Barry K. Nathan
2005-03-07 8:01 ` [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled Stefan Seyfried
0 siblings, 2 replies; 9+ messages in thread
From: Andrew Morton @ 2005-03-07 3:59 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-kernel, barryn
Pavel Machek <pavel@ucw.cz> wrote:
>
> Hi!
>
> > Problem Description:
> > swsusp normally works, but if I enable CONFIG_DEBUG_PAGEALLOC, it breaks --
> > after "PM: snapshotting memory", swsusp never gets to the "critical section" and
> > it kind of bounces back from the suspend attempt, for lack of a better way for
> > me to describe the effect.
>
> Okay, that is because low-level assembly requires PSE (4mb pages for
> kernel) and DEBUG_PAGEALLOC disables that capability.
>
> If you feel like rewriting assembly code to turn off paging (and thus
> working with PSE), go ahead, but I do not think it is worth the
> trouble.
>
> OTOH we should at least tell people what went wrong, some people seen
> same problem on VIA cpus... Please apply,
>
Isn't some Kconfig solution appropriate here?
>
> --- clean/include/asm-i386/suspend.h 2004-12-25 13:35:02.000000000 +0100
> +++ linux/include/asm-i386/suspend.h 2005-03-02 01:05:33.000000000 +0100
> @@ -10,10 +10,12 @@
> arch_prepare_suspend(void)
> {
> /* If you want to make non-PSE machine work, turn off paging
> - in do_magic. swsusp_pg_dir should have identity mapping, so
> + in swsusp_arch_suspend. swsusp_pg_dir should have identity mapping, so
> it could work... */
> - if (!cpu_has_pse)
> + if (!cpu_has_pse) {
> + printk(KERN_ERR "PSE is required for swsusp.\n");
> return -EPERM;
> + }
> return 0;
> }
>
> --
> People were complaining that M$ turns users into beta-testers...
> ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] kconfig: DEBUG_PAGEALLOC and SOFTWARE_SUSPEND are incompatible on i386
2005-03-07 3:59 ` Andrew Morton
@ 2005-03-07 5:12 ` Barry K. Nathan
2005-03-07 9:14 ` Pavel Machek
2005-03-07 8:01 ` [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled Stefan Seyfried
1 sibling, 1 reply; 9+ messages in thread
From: Barry K. Nathan @ 2005-03-07 5:12 UTC (permalink / raw)
To: Andrew Morton; +Cc: Pavel Machek, linux-kernel, barryn
On i386, SOFTWARE_SUSPEND requires the CPU to have PSE support, but
DEBUG_PAGEALLOC disables PSE. Thus, allowing both options to be enabled
simultaneously makes no sense. This patch disables DEBUG_PAGEALLOC if
SOFTWARE_SUSPEND is enabled; it also displays a comment to briefly
explain why DEBUG_PAGEALLOC is missing in that case.
I have tested this patch against oldconfig and menuconfig on 2.6.11-bk2.
Signed-off-by: Barry K. Nathan <barryn@pobox.com>
--- linux-2.6.11-bk2/arch/i386/Kconfig.debug 2004-12-24 13:34:45.000000000 -0800
+++ linux-2.6.11-bk2-bkn2/arch/i386/Kconfig.debug 2005-03-06 20:59:07.000000000 -0800
@@ -38,9 +38,12 @@
This option will slow down process creation somewhat.
+comment "Page alloc debug is incompatible with Software Suspend on i386"
+ depends on DEBUG_KERNEL && SOFTWARE_SUSPEND
+
config DEBUG_PAGEALLOC
bool "Page alloc debugging"
- depends on DEBUG_KERNEL
+ depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND
help
Unmap pages from the kernel linear mapping after free_pages().
This results in a large slowdown, but helps to find certain types
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled
2005-03-07 3:59 ` Andrew Morton
2005-03-07 5:12 ` [PATCH] kconfig: DEBUG_PAGEALLOC and SOFTWARE_SUSPEND are incompatible on i386 Barry K. Nathan
@ 2005-03-07 8:01 ` Stefan Seyfried
2005-03-07 8:41 ` Nigel Cunningham
2005-03-07 9:22 ` Barry K. Nathan
1 sibling, 2 replies; 9+ messages in thread
From: Stefan Seyfried @ 2005-03-07 8:01 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, barryn, Pavel Machek
Andrew Morton wrote:
> Pavel Machek <pavel@ucw.cz> wrote:
>> Okay, that is because low-level assembly requires PSE (4mb pages for
>> kernel) and DEBUG_PAGEALLOC disables that capability.
>>
>> If you feel like rewriting assembly code to turn off paging (and thus
>> working with PSE), go ahead, but I do not think it is worth the
>> trouble.
>>
>> OTOH we should at least tell people what went wrong, some people seen
>> same problem on VIA cpus... Please apply,
>>
>
> Isn't some Kconfig solution appropriate here?
Yes, but only for the CONFIG_DEBUG_PAGEALLOC case, it does not solve the
"cpu has no PSE" case for VIA CPUs. So the Kconfig solution is an extra
bonus.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled
2005-03-07 8:01 ` [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled Stefan Seyfried
@ 2005-03-07 8:41 ` Nigel Cunningham
2005-03-07 9:22 ` Barry K. Nathan
1 sibling, 0 replies; 9+ messages in thread
From: Nigel Cunningham @ 2005-03-07 8:41 UTC (permalink / raw)
To: Stefan Seyfried
Cc: Andrew Morton, Linux Kernel Mailing List, barryn, Pavel Machek
Hi,
On Mon, 2005-03-07 at 19:01, Stefan Seyfried wrote:
> Andrew Morton wrote:
> > Pavel Machek <pavel@ucw.cz> wrote:
>
> >> Okay, that is because low-level assembly requires PSE (4mb pages for
> >> kernel) and DEBUG_PAGEALLOC disables that capability.
> >>
> >> If you feel like rewriting assembly code to turn off paging (and thus
> >> working with PSE), go ahead, but I do not think it is worth the
> >> trouble.
> >>
> >> OTOH we should at least tell people what went wrong, some people seen
> >> same problem on VIA cpus... Please apply,
> >>
> >
> > Isn't some Kconfig solution appropriate here?
>
> Yes, but only for the CONFIG_DEBUG_PAGEALLOC case, it does not solve the
> "cpu has no PSE" case for VIA CPUs. So the Kconfig solution is an extra
> bonus.
Yeah - separate issues. Suspend2 has worked with CONFIG_DEBUG_PAGEALLOC.
You just have to map in all the pages before doing the atomic copies.
Regards,
Nigel
--
Nigel Cunningham
Software Engineer, Canberra, Australia
http://www.cyclades.com
Bus: +61 (2) 6291 9554; Hme: +61 (2) 6292 8028; Mob: +61 (417) 100 574
Maintainer of Suspend2 Kernel Patches http://softwaresuspend.berlios.de
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] kconfig: DEBUG_PAGEALLOC and SOFTWARE_SUSPEND are incompatible on i386
2005-03-07 5:12 ` [PATCH] kconfig: DEBUG_PAGEALLOC and SOFTWARE_SUSPEND are incompatible on i386 Barry K. Nathan
@ 2005-03-07 9:14 ` Pavel Machek
0 siblings, 0 replies; 9+ messages in thread
From: Pavel Machek @ 2005-03-07 9:14 UTC (permalink / raw)
To: Barry K. Nathan; +Cc: Andrew Morton, linux-kernel
On Ne 06-03-05 21:12:41, Barry K. Nathan wrote:
> On i386, SOFTWARE_SUSPEND requires the CPU to have PSE support, but
> DEBUG_PAGEALLOC disables PSE. Thus, allowing both options to be enabled
> simultaneously makes no sense. This patch disables DEBUG_PAGEALLOC if
> SOFTWARE_SUSPEND is enabled; it also displays a comment to briefly
> explain why DEBUG_PAGEALLOC is missing in that case.
ACK.
Pavel
> --- linux-2.6.11-bk2/arch/i386/Kconfig.debug 2004-12-24 13:34:45.000000000 -0800
> +++ linux-2.6.11-bk2-bkn2/arch/i386/Kconfig.debug 2005-03-06 20:59:07.000000000 -0800
> @@ -38,9 +38,12 @@
>
> This option will slow down process creation somewhat.
>
> +comment "Page alloc debug is incompatible with Software Suspend on i386"
> + depends on DEBUG_KERNEL && SOFTWARE_SUSPEND
> +
> config DEBUG_PAGEALLOC
> bool "Page alloc debugging"
> - depends on DEBUG_KERNEL
> + depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND
> help
> Unmap pages from the kernel linear mapping after free_pages().
> This results in a large slowdown, but helps to find certain types
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled
2005-03-07 8:01 ` [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled Stefan Seyfried
2005-03-07 8:41 ` Nigel Cunningham
@ 2005-03-07 9:22 ` Barry K. Nathan
2005-03-07 9:35 ` Pavel Machek
1 sibling, 1 reply; 9+ messages in thread
From: Barry K. Nathan @ 2005-03-07 9:22 UTC (permalink / raw)
To: Stefan Seyfried; +Cc: Andrew Morton, linux-kernel, barryn, Pavel Machek
On Mon, Mar 07, 2005 at 09:01:47AM +0100, Stefan Seyfried wrote:
> Andrew Morton wrote:
[snip]
> > Isn't some Kconfig solution appropriate here?
>
> Yes, but only for the CONFIG_DEBUG_PAGEALLOC case, it does not solve the
> "cpu has no PSE" case for VIA CPUs. So the Kconfig solution is an extra
> bonus.
Note that I've posted a Kconfig solution here:
http://marc.theaimsgroup.com/?l=linux-kernel&m=111017249931972&w=2
Regarding Pavel's patch, it seems to me that it might be better to print
the message at boot time, instead of (or in addition to?) his patch.
Maybe we should be disabling swsusp altogether at boot in that case, if
that's not unreasonably hard to implement.
-Barry K. Nathan <barryn@pobox.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled
2005-03-07 9:22 ` Barry K. Nathan
@ 2005-03-07 9:35 ` Pavel Machek
2005-03-07 17:58 ` Barry K. Nathan
0 siblings, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2005-03-07 9:35 UTC (permalink / raw)
To: Barry K. Nathan; +Cc: Stefan Seyfried, Andrew Morton, linux-kernel
Hi!
> > > Isn't some Kconfig solution appropriate here?
> >
> > Yes, but only for the CONFIG_DEBUG_PAGEALLOC case, it does not solve the
> > "cpu has no PSE" case for VIA CPUs. So the Kconfig solution is an extra
> > bonus.
>
> Note that I've posted a Kconfig solution here:
> http://marc.theaimsgroup.com/?l=linux-kernel&m=111017249931972&w=2
>
> Regarding Pavel's patch, it seems to me that it might be better to print
> the message at boot time, instead of (or in addition to?) his patch.
> Maybe we should be disabling swsusp altogether at boot in that case, if
> that's not unreasonably hard to implement.
Hmm, yes, that would certainly be better. It would need new
per-architecture hook... Feel free to implement it.
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled
2005-03-07 9:35 ` Pavel Machek
@ 2005-03-07 17:58 ` Barry K. Nathan
0 siblings, 0 replies; 9+ messages in thread
From: Barry K. Nathan @ 2005-03-07 17:58 UTC (permalink / raw)
To: Pavel Machek
Cc: Barry K. Nathan, Stefan Seyfried, Andrew Morton, linux-kernel
On Mon, Mar 07, 2005 at 10:35:12AM +0100, Pavel Machek wrote:
> > Regarding Pavel's patch, it seems to me that it might be better to print
> > the message at boot time, instead of (or in addition to?) his patch.
> > Maybe we should be disabling swsusp altogether at boot in that case, if
> > that's not unreasonably hard to implement.
>
> Hmm, yes, that would certainly be better. It would need new
> per-architecture hook... Feel free to implement it.
It looks like it's going to be more difficult than I was hoping for.
I would recommend accepting Pavel's patch. It's a definite improvement
over the existing code, and it could be a long while until I have a
boot-time message patch that is both functional and clean enough to be
incorporated into mainline.
-Barry K. Nathan <barryn@pobox.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-03-07 17:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20050306030852.23eb59db.akpm@osdl.org>
2005-03-06 22:57 ` [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled Pavel Machek
2005-03-07 3:59 ` Andrew Morton
2005-03-07 5:12 ` [PATCH] kconfig: DEBUG_PAGEALLOC and SOFTWARE_SUSPEND are incompatible on i386 Barry K. Nathan
2005-03-07 9:14 ` Pavel Machek
2005-03-07 8:01 ` [Bug 4298] swsusp fails to suspend if CONFIG_DEBUG_PAGEALLOC is also enabled Stefan Seyfried
2005-03-07 8:41 ` Nigel Cunningham
2005-03-07 9:22 ` Barry K. Nathan
2005-03-07 9:35 ` Pavel Machek
2005-03-07 17:58 ` Barry K. Nathan
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.