2006-08-31 13:53:50

by Pavel Machek

[permalink] [raw]
Subject: prevent swsusp with PAE

If HIGHMEM64G and swsusp are used at the same time, nasty random
crashes happen during resume. Cause is known; prevent that
combination.

I guess I'd like to see this one in 2.6.18...

Signed-off-by: Pavel Machek <[email protected]>

---
commit acb3b411ec93f827b25b8481d53670c5c9195d89
tree f52cd5518e34af16fe5ae28064717bcc95929f28
parent cd03e183c58e6e7073e054a7fe335cf50c61fe2f
author <[email protected]> Thu, 31 Aug 2006 15:52:34 +0200
committer <[email protected]> Thu, 31 Aug 2006 15:52:34 +0200

include/asm-i386/suspend.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
index 08be1e5..01cd812 100644
--- a/include/asm-i386/suspend.h
+++ b/include/asm-i386/suspend.h
@@ -16,6 +16,15 @@ arch_prepare_suspend(void)
printk(KERN_ERR "PSE is required for swsusp.\n");
return -EPERM;
}
+
+#ifdef CONFIG_X86_PAE
+ printk(KERN_ERR "swsusp is incompatible with PAE.\n");
+ /* This is actually instance of the same problem. We need
+ identity mapping self-contained in swsusp_pg_dir, and PAE
+ prevents that. Solution could be copied from x86_64. */
+ return -EPERM;
+#endif
+
return 0;
}


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


2006-08-31 17:43:16

by Andrew Morton

[permalink] [raw]
Subject: Re: prevent swsusp with PAE

On Thu, 31 Aug 2006 15:53:36 +0200
Pavel Machek <[email protected]> wrote:

> If HIGHMEM64G and swsusp are used at the same time, nasty random
> crashes happen during resume. Cause is known; prevent that
> combination.
>
> I guess I'd like to see this one in 2.6.18...
>
> Signed-off-by: Pavel Machek <[email protected]>
>
> ---
> commit acb3b411ec93f827b25b8481d53670c5c9195d89
> tree f52cd5518e34af16fe5ae28064717bcc95929f28
> parent cd03e183c58e6e7073e054a7fe335cf50c61fe2f
> author <[email protected]> Thu, 31 Aug 2006 15:52:34 +0200
> committer <[email protected]> Thu, 31 Aug 2006 15:52:34 +0200
>
> include/asm-i386/suspend.h | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
> index 08be1e5..01cd812 100644
> --- a/include/asm-i386/suspend.h
> +++ b/include/asm-i386/suspend.h
> @@ -16,6 +16,15 @@ arch_prepare_suspend(void)
> printk(KERN_ERR "PSE is required for swsusp.\n");
> return -EPERM;
> }
> +
> +#ifdef CONFIG_X86_PAE
> + printk(KERN_ERR "swsusp is incompatible with PAE.\n");
> + /* This is actually instance of the same problem. We need
> + identity mapping self-contained in swsusp_pg_dir, and PAE
> + prevents that. Solution could be copied from x86_64. */
> + return -EPERM;
> +#endif
> +
> return 0;
> }

Why not do this in Kconfig??

2006-08-31 22:35:36

by Pavel Machek

[permalink] [raw]
Subject: Re: prevent swsusp with PAE

Hi!

> Pavel Machek <[email protected]> wrote:
>
> > If HIGHMEM64G and swsusp are used at the same time, nasty random
> > crashes happen during resume. Cause is known; prevent that
> > combination.
> >
> > I guess I'd like to see this one in 2.6.18...
> >
> > Signed-off-by: Pavel Machek <[email protected]>
> >
> > ---
> > commit acb3b411ec93f827b25b8481d53670c5c9195d89
> > tree f52cd5518e34af16fe5ae28064717bcc95929f28
> > parent cd03e183c58e6e7073e054a7fe335cf50c61fe2f
> > author <[email protected]> Thu, 31 Aug 2006 15:52:34 +0200
> > committer <[email protected]> Thu, 31 Aug 2006 15:52:34 +0200
> >
> > include/asm-i386/suspend.h | 8 ++++++++
> > 1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
> > index 08be1e5..01cd812 100644
> > --- a/include/asm-i386/suspend.h
> > +++ b/include/asm-i386/suspend.h
> > @@ -16,6 +16,15 @@ arch_prepare_suspend(void)
> > printk(KERN_ERR "PSE is required for swsusp.\n");
> > return -EPERM;
> > }
> > +
> > +#ifdef CONFIG_X86_PAE
> > + printk(KERN_ERR "swsusp is incompatible with PAE.\n");
> > + /* This is actually instance of the same problem. We need
> > + identity mapping self-contained in swsusp_pg_dir, and PAE
> > + prevents that. Solution could be copied from x86_64. */
> > + return -EPERM;
> > +#endif
> > +
> > return 0;
> > }
>
> Why not do this in Kconfig??

Well, Kconfig does not provide natural place for comments, and
disappearing config option is sure to confuse people. But of course I
can do it.
Pavel

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

2006-08-31 22:44:54

by Randy Dunlap

[permalink] [raw]
Subject: Re: prevent swsusp with PAE

On Fri, 1 Sep 2006 00:35:21 +0200 Pavel Machek wrote:

> Hi!
>
> > Pavel Machek <[email protected]> wrote:
> >
> > > If HIGHMEM64G and swsusp are used at the same time, nasty random
> > > crashes happen during resume. Cause is known; prevent that
> > > combination.
> > >
> > > I guess I'd like to see this one in 2.6.18...
> > >
> > > Signed-off-by: Pavel Machek <[email protected]>
> > >
> > > ---
> > > commit acb3b411ec93f827b25b8481d53670c5c9195d89
> > > tree f52cd5518e34af16fe5ae28064717bcc95929f28
> > > parent cd03e183c58e6e7073e054a7fe335cf50c61fe2f
> > > author <[email protected]> Thu, 31 Aug 2006 15:52:34 +0200
> > > committer <[email protected]> Thu, 31 Aug 2006 15:52:34 +0200
> > >
> > > include/asm-i386/suspend.h | 8 ++++++++
> > > 1 files changed, 8 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
> > > index 08be1e5..01cd812 100644
> > > --- a/include/asm-i386/suspend.h
> > > +++ b/include/asm-i386/suspend.h
> > > @@ -16,6 +16,15 @@ arch_prepare_suspend(void)
> > > printk(KERN_ERR "PSE is required for swsusp.\n");
> > > return -EPERM;
> > > }
> > > +
> > > +#ifdef CONFIG_X86_PAE
> > > + printk(KERN_ERR "swsusp is incompatible with PAE.\n");
> > > + /* This is actually instance of the same problem. We need
> > > + identity mapping self-contained in swsusp_pg_dir, and PAE
> > > + prevents that. Solution could be copied from x86_64. */
> > > + return -EPERM;
> > > +#endif
> > > +
> > > return 0;
> > > }
> >
> > Why not do this in Kconfig??
>
> Well, Kconfig does not provide natural place for comments, and
> disappearing config option is sure to confuse people. But of course I
> can do it.

Documentation/kbuild/kconfig-language.txt includes a "comment" keyword.

USB-storage uses it to suggest that SCSI + SCSI disk support need
to be enabled for usb-storage.

---
~Randy

2006-08-31 22:48:38

by Andrew Morton

[permalink] [raw]
Subject: Re: prevent swsusp with PAE

On Fri, 1 Sep 2006 00:35:21 +0200
Pavel Machek <[email protected]> wrote:

> > > diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
> > > index 08be1e5..01cd812 100644
> > > --- a/include/asm-i386/suspend.h
> > > +++ b/include/asm-i386/suspend.h
> > > @@ -16,6 +16,15 @@ arch_prepare_suspend(void)
> > > printk(KERN_ERR "PSE is required for swsusp.\n");
> > > return -EPERM;
> > > }
> > > +
> > > +#ifdef CONFIG_X86_PAE
> > > + printk(KERN_ERR "swsusp is incompatible with PAE.\n");
> > > + /* This is actually instance of the same problem. We need
> > > + identity mapping self-contained in swsusp_pg_dir, and PAE
> > > + prevents that. Solution could be copied from x86_64. */
> > > + return -EPERM;
> > > +#endif
> > > +
> > > return 0;
> > > }
> >
> > Why not do this in Kconfig??
>
> Well, Kconfig does not provide natural place for comments, and
> disappearing config option is sure to confuse people. But of course I
> can do it.

It would be more conventional.

I think what this really points at is a weakness in the menuconfig/xconfig/etc
user interfaces. It should be possible to navigate to the presently-disabled
config option and ask it "why can't I turn you on?".

2006-08-31 22:52:48

by Pavel Machek

[permalink] [raw]
Subject: Re: prevent swsusp with PAE

On Thu 2006-08-31 15:48:28, Andrew Morton wrote:
> On Fri, 1 Sep 2006 00:35:21 +0200
> Pavel Machek <[email protected]> wrote:
>
> > > > diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
> > > > index 08be1e5..01cd812 100644
> > > > --- a/include/asm-i386/suspend.h
> > > > +++ b/include/asm-i386/suspend.h
> > > > @@ -16,6 +16,15 @@ arch_prepare_suspend(void)
> > > > printk(KERN_ERR "PSE is required for swsusp.\n");
> > > > return -EPERM;
> > > > }
> > > > +
> > > > +#ifdef CONFIG_X86_PAE
> > > > + printk(KERN_ERR "swsusp is incompatible with PAE.\n");
> > > > + /* This is actually instance of the same problem. We need
> > > > + identity mapping self-contained in swsusp_pg_dir, and PAE
> > > > + prevents that. Solution could be copied from x86_64. */
> > > > + return -EPERM;
> > > > +#endif
> > > > +
> > > > return 0;
> > > > }
> > >
> > > Why not do this in Kconfig??
> >
> > Well, Kconfig does not provide natural place for comments, and
> > disappearing config option is sure to confuse people. But of course I
> > can do it.
>
> It would be more conventional.

Well, I have very similar check few lines above, and this is both i386
specific, so I slightly prefer to do it in the code, but...

> I think what this really points at is a weakness in the menuconfig/xconfig/etc
> user interfaces. It should be possible to navigate to the presently-disabled
> config option and ask it "why can't I turn you on?".

Yes, but I'll still have users asking me "why I can't turn it on" ;-).
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2006-08-31 23:02:21

by Randy Dunlap

[permalink] [raw]
Subject: Re: prevent swsusp with PAE

On Fri, 1 Sep 2006 00:52:34 +0200 Pavel Machek wrote:

> On Thu 2006-08-31 15:48:28, Andrew Morton wrote:
> > On Fri, 1 Sep 2006 00:35:21 +0200
> > Pavel Machek <[email protected]> wrote:
> >
> > > > > diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
> > > > > index 08be1e5..01cd812 100644
> > > > > --- a/include/asm-i386/suspend.h
> > > > > +++ b/include/asm-i386/suspend.h
> > > > > @@ -16,6 +16,15 @@ arch_prepare_suspend(void)
> > > > > printk(KERN_ERR "PSE is required for swsusp.\n");
> > > > > return -EPERM;
> > > > > }
> > > > > +
> > > > > +#ifdef CONFIG_X86_PAE
> > > > > + printk(KERN_ERR "swsusp is incompatible with PAE.\n");
> > > > > + /* This is actually instance of the same problem. We need
> > > > > + identity mapping self-contained in swsusp_pg_dir, and PAE
> > > > > + prevents that. Solution could be copied from x86_64. */
> > > > > + return -EPERM;
> > > > > +#endif
> > > > > +
> > > > > return 0;
> > > > > }
> > > >
> > > > Why not do this in Kconfig??
> > >
> > > Well, Kconfig does not provide natural place for comments, and
> > > disappearing config option is sure to confuse people. But of course I
> > > can do it.
> >
> > It would be more conventional.
>
> Well, I have very similar check few lines above, and this is both i386
> specific, so I slightly prefer to do it in the code, but...

If we can prevent a non-working build in Kconfig, that's what
we should do.

> > I think what this really points at is a weakness in the menuconfig/xconfig/etc
> > user interfaces. It should be possible to navigate to the presently-disabled
> > config option and ask it "why can't I turn you on?".
>
> Yes, but I'll still have users asking me "why I can't turn it on" ;-).

menuconfig and xconfig both have Help and Search that can aid
with that, but I would still use the "comment" keyword also.

---
~Randy

2006-09-01 00:16:26

by Andrew Morton

[permalink] [raw]
Subject: Re: prevent swsusp with PAE

On Thu, 31 Aug 2006 16:05:46 -0700
"Randy.Dunlap" <[email protected]> wrote:

> > > I think what this really points at is a weakness in the menuconfig/xconfig/etc
> > > user interfaces. It should be possible to navigate to the presently-disabled
> > > config option and ask it "why can't I turn you on?".
> >
> > Yes, but I'll still have users asking me "why I can't turn it on" ;-).
>
> menuconfig and xconfig both have Help and Search that can aid
> with that, but I would still use the "comment" keyword also.

Help and Search options aren't much use if you cannot see the option and if
you do not know that it exists.

A better UI design would be to show the unselectable option in some
dimmed-out fashion and then provide an interface which permits the user to

a) query the item to find out why it's not selectable and

b) turn on the depends-on option(s) at the present site, thus making the
present item selectable (ie: not dimmed any more).

I dont't think any of that would require any Kconfig changes - it's purely
a UI thing?

2006-09-01 00:40:43

by Randy Dunlap

[permalink] [raw]
Subject: Re: prevent swsusp with PAE

On Thu, 31 Aug 2006 17:16:15 -0700 Andrew Morton wrote:

> On Thu, 31 Aug 2006 16:05:46 -0700
> "Randy.Dunlap" <[email protected]> wrote:
>
> > > > I think what this really points at is a weakness in the menuconfig/xconfig/etc
> > > > user interfaces. It should be possible to navigate to the presently-disabled
> > > > config option and ask it "why can't I turn you on?".
> > >
> > > Yes, but I'll still have users asking me "why I can't turn it on" ;-).
> >
> > menuconfig and xconfig both have Help and Search that can aid
> > with that, but I would still use the "comment" keyword also.
>
> Help and Search options aren't much use if you cannot see the option and if
> you do not know that it exists.
>
> A better UI design would be to show the unselectable option in some
> dimmed-out fashion and then provide an interface which permits the user to
>
> a) query the item to find out why it's not selectable and
>
> b) turn on the depends-on option(s) at the present site, thus making the
> present item selectable (ie: not dimmed any more).
>
> I dont't think any of that would require any Kconfig changes - it's purely
> a UI thing?

Probably. xconfig already has this ability/feature.
I enable/use it all the time. menuconfig could probably be
taught how to do it also. (and gconfig seems to be orphaned)

---
~Randy

2006-09-01 07:24:47

by Jan Engelhardt

[permalink] [raw]
Subject: Re: prevent swsusp with PAE


>> I think what this really points at is a weakness in the menuconfig/xconfig/etc
>> user interfaces. It should be possible to navigate to the presently-disabled
>> config option and ask it "why can't I turn you on?".
>
>Yes, but I'll still have users asking me "why I can't turn it on" ;-).

That would probably be handy, just as http://lkml.org/lkml/2006/8/25/25



Jan Engelhardt
--

2006-09-02 23:17:14

by Pavel Machek

[permalink] [raw]
Subject: prevent swsusp with PAE

Next version of prevent-swsusp-with-PAE, this time I disable it in
Kconfig.

PAE + swsusp results in hard-to-debug crash about 50% of time during
resume. Cause is known, fix needs to be ported from x86-64 (but we
can't make it to 2.6.18, and I'd like this to be worked around in
2.6.18).

Signed-off-by: Pavel Machek <[email protected]>

diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index ae44a70..619ecab 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -56,7 +56,7 @@ config PM_TRACE

config SOFTWARE_SUSPEND
bool "Software Suspend"
- depends on PM && SWAP && (X86 && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP)
+ depends on PM && SWAP && ((X86 && (!SMP || SUSPEND_SMP) && !X86_PAE) || ((FRV || PPC32) && !SMP))
---help---
Enable the possibility of suspending the machine.
It doesn't need ACPI or APM.
@@ -78,6 +78,10 @@ config SOFTWARE_SUSPEND

For more information take a look at <file:Documentation/power/swsusp.txt>.

+ (For now, swsusp is incompatible with PAE aka HIGHMEM_64G on i386.
+ we need identity mapping for resume to work, and that is trivial
+ to get with 4MB pages, but less than trivial on PAE).
+
config PM_STD_PARTITION
string "Default resume partition"
depends on SOFTWARE_SUSPEND

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

--
VGER BF report: U 0.489608