mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* prevent swsusp with PAE
@ 2006-08-31 13:53 Pavel Machek
  2006-08-31 17:43 ` Andrew Morton
  0 siblings, 1 reply; 11+ messages in thread
From: Pavel Machek @ 2006-08-31 13:53 UTC (permalink / raw)
  To: Andrew Morton, Rafael J. Wysocki, kernel list

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 <pavel@suse.cz>

---
commit acb3b411ec93f827b25b8481d53670c5c9195d89
tree f52cd5518e34af16fe5ae28064717bcc95929f28
parent cd03e183c58e6e7073e054a7fe335cf50c61fe2f
author <pavel@amd.ucw.cz> Thu, 31 Aug 2006 15:52:34 +0200
committer <pavel@amd.ucw.cz> 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

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

* Re: prevent swsusp with PAE
  2006-08-31 13:53 prevent swsusp with PAE Pavel Machek
@ 2006-08-31 17:43 ` Andrew Morton
  2006-08-31 22:35   ` Pavel Machek
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2006-08-31 17:43 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Rafael J. Wysocki, kernel list

On Thu, 31 Aug 2006 15:53:36 +0200
Pavel Machek <pavel@suse.cz> 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 <pavel@suse.cz>
> 
> ---
> commit acb3b411ec93f827b25b8481d53670c5c9195d89
> tree f52cd5518e34af16fe5ae28064717bcc95929f28
> parent cd03e183c58e6e7073e054a7fe335cf50c61fe2f
> author <pavel@amd.ucw.cz> Thu, 31 Aug 2006 15:52:34 +0200
> committer <pavel@amd.ucw.cz> 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??

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

* Re: prevent swsusp with PAE
  2006-08-31 17:43 ` Andrew Morton
@ 2006-08-31 22:35   ` Pavel Machek
  2006-08-31 22:48     ` Randy.Dunlap
  2006-08-31 22:48     ` Andrew Morton
  0 siblings, 2 replies; 11+ messages in thread
From: Pavel Machek @ 2006-08-31 22:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Rafael J. Wysocki, kernel list

Hi!

> Pavel Machek <pavel@suse.cz> 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 <pavel@suse.cz>
> > 
> > ---
> > commit acb3b411ec93f827b25b8481d53670c5c9195d89
> > tree f52cd5518e34af16fe5ae28064717bcc95929f28
> > parent cd03e183c58e6e7073e054a7fe335cf50c61fe2f
> > author <pavel@amd.ucw.cz> Thu, 31 Aug 2006 15:52:34 +0200
> > committer <pavel@amd.ucw.cz> 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

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

* Re: prevent swsusp with PAE
  2006-08-31 22:35   ` Pavel Machek
@ 2006-08-31 22:48     ` Randy.Dunlap
  2006-08-31 22:48     ` Andrew Morton
  1 sibling, 0 replies; 11+ messages in thread
From: Randy.Dunlap @ 2006-08-31 22:48 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Andrew Morton, Rafael J. Wysocki, kernel list

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

> Hi!
> 
> > Pavel Machek <pavel@suse.cz> 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 <pavel@suse.cz>
> > > 
> > > ---
> > > commit acb3b411ec93f827b25b8481d53670c5c9195d89
> > > tree f52cd5518e34af16fe5ae28064717bcc95929f28
> > > parent cd03e183c58e6e7073e054a7fe335cf50c61fe2f
> > > author <pavel@amd.ucw.cz> Thu, 31 Aug 2006 15:52:34 +0200
> > > committer <pavel@amd.ucw.cz> 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

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

* Re: prevent swsusp with PAE
  2006-08-31 22:35   ` Pavel Machek
  2006-08-31 22:48     ` Randy.Dunlap
@ 2006-08-31 22:48     ` Andrew Morton
  2006-08-31 22:52       ` Pavel Machek
  1 sibling, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2006-08-31 22:48 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Rafael J. Wysocki, kernel list

On Fri, 1 Sep 2006 00:35:21 +0200
Pavel Machek <pavel@ucw.cz> 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?".

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

* Re: prevent swsusp with PAE
  2006-08-31 22:48     ` Andrew Morton
@ 2006-08-31 22:52       ` Pavel Machek
  2006-08-31 23:05         ` Randy.Dunlap
  2006-09-01  7:22         ` Jan Engelhardt
  0 siblings, 2 replies; 11+ messages in thread
From: Pavel Machek @ 2006-08-31 22:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Rafael J. Wysocki, kernel list

On Thu 2006-08-31 15:48:28, Andrew Morton wrote:
> On Fri, 1 Sep 2006 00:35:21 +0200
> Pavel Machek <pavel@ucw.cz> 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

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

* Re: prevent swsusp with PAE
  2006-08-31 22:52       ` Pavel Machek
@ 2006-08-31 23:05         ` Randy.Dunlap
  2006-09-01  0:16           ` Andrew Morton
  2006-09-02 23:16           ` Pavel Machek
  2006-09-01  7:22         ` Jan Engelhardt
  1 sibling, 2 replies; 11+ messages in thread
From: Randy.Dunlap @ 2006-08-31 23:05 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Andrew Morton, Rafael J. Wysocki, kernel list

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 <pavel@ucw.cz> 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

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

* Re: prevent swsusp with PAE
  2006-08-31 23:05         ` Randy.Dunlap
@ 2006-09-01  0:16           ` Andrew Morton
  2006-09-01  0:44             ` Randy.Dunlap
  2006-09-02 23:16           ` Pavel Machek
  1 sibling, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2006-09-01  0:16 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Pavel Machek, Rafael J. Wysocki, kernel list

On Thu, 31 Aug 2006 16:05:46 -0700
"Randy.Dunlap" <rdunlap@xenotime.net> 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?

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

* Re: prevent swsusp with PAE
  2006-09-01  0:16           ` Andrew Morton
@ 2006-09-01  0:44             ` Randy.Dunlap
  0 siblings, 0 replies; 11+ messages in thread
From: Randy.Dunlap @ 2006-09-01  0:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Pavel Machek, Rafael J. Wysocki, kernel list

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

> On Thu, 31 Aug 2006 16:05:46 -0700
> "Randy.Dunlap" <rdunlap@xenotime.net> 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

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

* Re: prevent swsusp with PAE
  2006-08-31 22:52       ` Pavel Machek
  2006-08-31 23:05         ` Randy.Dunlap
@ 2006-09-01  7:22         ` Jan Engelhardt
  1 sibling, 0 replies; 11+ messages in thread
From: Jan Engelhardt @ 2006-09-01  7:22 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Andrew Morton, Rafael J. Wysocki, kernel list


>> 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
-- 

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

* prevent swsusp with PAE
  2006-08-31 23:05         ` Randy.Dunlap
  2006-09-01  0:16           ` Andrew Morton
@ 2006-09-02 23:16           ` Pavel Machek
  1 sibling, 0 replies; 11+ messages in thread
From: Pavel Machek @ 2006-09-02 23:16 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Andrew Morton, Rafael J. Wysocki, kernel list

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 <pavel@suse.cz>

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

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

end of thread, other threads:[~2006-09-02 23:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-31 13:53 prevent swsusp with PAE Pavel Machek
2006-08-31 17:43 ` Andrew Morton
2006-08-31 22:35   ` Pavel Machek
2006-08-31 22:48     ` Randy.Dunlap
2006-08-31 22:48     ` Andrew Morton
2006-08-31 22:52       ` Pavel Machek
2006-08-31 23:05         ` Randy.Dunlap
2006-09-01  0:16           ` Andrew Morton
2006-09-01  0:44             ` Randy.Dunlap
2006-09-02 23:16           ` Pavel Machek
2006-09-01  7:22         ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome