public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@ucw.cz>
Cc: Linux PM <linux-pm@osdl.org>, Dave Jones <davej@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Nigel Cunningham <ncunningham@linuxmail.org>
Subject: Re: [RFC][PATCH -mm] Make swsusp work on i386 with PAE
Date: Mon, 23 Oct 2006 17:29:10 +0200	[thread overview]
Message-ID: <200610231729.10925.rjw@sisk.pl> (raw)
In-Reply-To: <20061023145033.GB31273@elf.ucw.cz>

Hi,

On Monday, 23 October 2006 16:50, Pavel Machek wrote:
> Hi!
> 
> > The purpose of the appended patch is to make swsusp work on i386 with PAE,
> > but it should also allow i386 systems without PSE to use swsusp.
> > 
> > The patch creates temporary page tables located in resume-safe page frames
> > during the resume and uses them for restoring the suspend image (the same
> > approach is used on x86-64).
> > 
> > It has been tested on an i386 system with PAE and survived several
> > suspend-resume cycles in a row, but I have no systems without PSE, so that
> > requires some testing.
> 
> Thanks, looks okay to me. I guess Andi Kleen would be right person to
> review it in detail?

Yes, I think so.

> Lack of assembly modifications is good.
> 
> I guess this should be now removed? (include/asm-i386/suspend.h)
> 
> arch_prepare_suspend(void)
> {
>         /* If you want to make non-PSE machine work, turn off paging
>            in swsusp_arch_suspend. swsusp_pg_dir should have identity mapping, so
>            it could work...  */
>         if (!cpu_has_pse) {
>                 printk(KERN_ERR "PSE is required for swsusp.\n");
>                 return -EPERM;
>         }

Yes, it should.  I though it went away when the Kconfig was changed ...

> > +/*
> > + * Create a middle page table on a resume-safe page and put a pointer to it in
> > + * the given global directory entry.  This only returns the gd entry
> > + * in non-PAE compilation mode, since the middle layer is folded.
> > + */
> > +static pmd_t *resume_one_md_table_init(pgd_t *pgd)
> > +{
> > +	pud_t *pud;
> > +	pmd_t *pmd_table;
> > +
> > +#ifdef CONFIG_X86_PAE
> > +	pmd_table = (pmd_t *)get_safe_page(GFP_ATOMIC);
> > +	if (!pmd_table)
> > +		return pmd_table;
> 
> I'd do plain old return NULL; here.

OK

> > +			/* Map with big pages if possible, otherwise create
> > +			 * normal page tables.
> > +			 * NOTE: We can mark everything as executable here
> > +			 */
> > +			if (cpu_has_pse) {
> > +				set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE_EXEC));
> > +				pfn += PTRS_PER_PTE;
> 
> Perhaps disabling PSE here can help getting some testing?

Well, I don't really want to make everyone test the !PSE scenario. ;-)

> Okay, I guess I should really test this one... Seems good enough for
> -mm to me, but it should preferably stay there for a _long_ time.

I think so too.

Greetings,
Rafael


-- 
You never change things by fighting the existing reality.
		R. Buckminster Fuller

  reply	other threads:[~2006-10-23 15:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-22 13:48 [RFC][PATCH -mm] Make swsusp work on i386 with PAE Rafael J. Wysocki
2006-10-23 14:50 ` Pavel Machek
2006-10-23 15:29   ` Rafael J. Wysocki [this message]
2006-10-25  8:05   ` Dave Jones
2006-11-02 10:31 ` Pavel Machek

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=200610231729.10925.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@osdl.org \
    --cc=ncunningham@linuxmail.org \
    --cc=pavel@ucw.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox