mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Andi Kleen <ak@suse.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, Andrew Morton <akpm@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][RFC] swsusp: speed up image restoring on x86-64
Date: Sat, 22 Jan 2005 10:54:33 +0100	[thread overview]
Message-ID: <20050122095432.GA2366@elf.ucw.cz> (raw)
In-Reply-To: <20050122025019.GC27060@wotan.suse.de>

Hi!

> > The following patch speeds up the restoring of swsusp images on x86-64
> > and makes the assembly code more readable (tested and works on AMD64).  It's
> > against 2.6.11-rc1-mm1, but applies to 2.6.11-rc1-mm2.  Please consifer for applying.
> > 
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> 
> Thanks. I applied it with some small changes to not hardcode any 
> C fields. 
> 
> BTW Pavel, while reading the code I noticed some dubious things
> in the code:
> 
> - The TLB flush doesn't flush global pages (turn of PGE and turn it
> on again). Since that handles kernel pages which are marked global
> this is surely wrong. 
> 
> - Also is it really needed to flush the TLB after each page and wouldn't
> INVLPG be better here? Or do you want to flush other pages than the
> just copied one there too? INVLPG would also take care of the global
> pages at least on x86-64 (iirc there are some bugs in this regard on some
> older i386 cpus) 
> 
> - There is a comment that says the code shouldn't use stack, but 
> it definitely uses the stack for some things. Either the comment
> or the code is wrong. Which is?

This should address it... I attempted to put answers into the
comments, because probably everyone is interested in those....
									Pavel

--- clean/arch/x86_64/kernel/suspend_asm.S	2004-10-19 14:16:28.000000000 +0200
+++ linux/arch/x86_64/kernel/suspend_asm.S	2005-01-22 10:51:28.000000000 +0100
@@ -1,10 +1,16 @@
-/* Originally gcc generated, modified by hand
+/* Copyright 2004,2005 Pavel Machek <pavel@suse.cz>, Andi Kleen <ak@suse.de>, Rafael J. Wysocki <rjw@sisk.pl>
  *
- * This may not use any stack, nor any variable that is not "NoSave":
+ * Distribute under GPLv2.
+ * 
+ * swsusp_arch_resume may not use any stack, nor any variable that is
+ * not "NoSave" during copying pages:
  *
  * Its rewriting one kernel image with another. What is stack in "old"
  * image could very well be data page in "new" image, and overwriting
  * your own stack under you is bad idea.
+ *
+ * TLB flush is purely and debugging attempt to make it fail fast if we
+ * do something wrong. TLB is properly flushed in swsusp_restore.
  */
 	
 	.text



-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

  reply	other threads:[~2005-01-22  9:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-20 19:32 Rafael J. Wysocki
2005-01-20 20:59 ` Pavel Machek
2005-01-20 21:46   ` Rafael J. Wysocki
2005-01-20 22:06     ` Pavel Machek
2005-01-20 22:58       ` Rafael J. Wysocki
2005-01-20 23:06         ` Pavel Machek
2005-01-21  0:14           ` Rafael J. Wysocki
2005-01-21 10:06             ` Pavel Machek
2005-01-21 12:43               ` Rafael J. Wysocki
2005-01-21  2:23     ` hugang
2005-01-21 10:04       ` Pavel Machek
2005-01-21 10:19         ` Andi Kleen
2005-01-21 10:30       ` Pavel Machek
2005-01-21 13:42         ` Rafael J. Wysocki
2005-01-21 14:31           ` hugang
2005-01-21 17:48           ` Pavel Machek
2005-01-21 12:32       ` Rafael J. Wysocki
2005-01-21 19:09         ` Rafael J. Wysocki
2005-01-22  2:03     ` Andi Kleen
2005-01-20 21:04 ` Rafael J. Wysocki
2005-01-22  2:50 ` Andi Kleen
2005-01-22  9:54   ` Pavel Machek [this message]
2005-01-22 11:26     ` Andi Kleen
2005-01-22 11:30       ` Pavel Machek
2005-01-22 11:44         ` Andi Kleen

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=20050122095432.GA2366@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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

Powered by JetHome