All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Patrick Mochel <mochel@digitalimplant.org>,
	Rusty trivial patch monkey Russell  <trivial@rustcorp.com.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Nigel Cunningham <ncunningham@users.sourceforge.net>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: swsusp vs  pgdir
Date: Fri, 23 Jan 2004 18:04:46 +0100	[thread overview]
Message-ID: <20040123170446.GA726@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.50.0401230839420.11276-100000@monsoon.he.net>

Hi!

> > Wait... wait... If the whole linear mapping isn't mapped by this flat
> > pgdir, then we have a problem, since the MMU will have to go down the
> > kernel pagetables to actually access the pages data when copying them
> > around... but at this point, we are overriding the boot kernel page
> > tables with the loader ones, so ...
> 
> A new pgdir is allocated on resume that does not overlap with any pages
> being restored. See relocate_pagedir() in the code..

Perhaps this should serve as a warning to people trying to understand
swsusp.c?

								Pavel

--- tmp/linux/kernel/power/swsusp.c	2004-01-23 17:59:36.000000000 +0100
+++ linux/kernel/power/swsusp.c	2004-01-23 17:58:58.000000000 +0100
@@ -107,6 +107,10 @@
    time of suspend, that must be freed. Second is "pagedir_nosave", 
    allocated at time of resume, that travels through memory not to
    collide with anything.
+
+   Warning: this is even more evil than it seems. Pagedirs this files
+   talks about are completely different from page directories used by
+   MMU hardware.
  */
 suspend_pagedir_t *pagedir_nosave __nosavedata = NULL;
 static suspend_pagedir_t *pagedir_save;

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

  parent reply	other threads:[~2004-01-23 17:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-23  4:58 swsusp vs pgdir Benjamin Herrenschmidt
2004-01-23  7:34 ` Pavel Machek
2004-01-23  7:43   ` Benjamin Herrenschmidt
2004-01-23  7:54     ` Pavel Machek
2004-01-23  8:21       ` Benjamin Herrenschmidt
2004-01-23 16:03       ` Patrick Mochel
2004-01-23 16:10         ` Benjamin Herrenschmidt
2004-01-23 16:45           ` Patrick Mochel
2004-01-23 16:53             ` Pavel Machek
2004-01-23 17:04             ` Pavel Machek [this message]
2004-01-24  1:03             ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040123170446.GA726@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.org \
    --cc=ncunningham@users.sourceforge.net \
    --cc=trivial@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.