mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: Andi Kleen <ak@suse.de>, Andrew Morton <akpm@osdl.org>,
	hugang@soulinfo.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][RFC] swsusp: speed up image restoring on x86-64
Date: Thu, 20 Jan 2005 23:58:53 +0100	[thread overview]
Message-ID: <200501202358.53918.rjw@sisk.pl> (raw)
In-Reply-To: <20050120220630.GB22201@elf.ucw.cz>

Hi,

On Thursday, 20 of January 2005 23:06, Pavel Machek wrote:
> 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.
> > > 
> > > Can you really measure the speedup?
> > 
> > In terms of time?  Probably I can, but I prefer to measure it in terms of the numbers of
> > operations to be performed.
> > 
> > With this patch, at least 8 times less memory accesses are required to restore an image
> > than without it, and in the original code cr3 is reloaded after copying each _byte_,
> > let alone the SIB arithmetics.  I'd expect it to be 10 times faster
> > or so.
> 
> Well, 8 times less cr3 reloads may be significant... for the copy
> loop. Speeding up copy loop that takes  ... 100msec?... of whole
> resume (30 seconds) does not seem too important to me.
> 
> > The readability of code is also important, IMHO.
> 
> It did not seem too much better to me.

Well, the beauty is in the eye of the beholder. :-)

Still, it shrinks the code (22 lines vs 37 lines), it uses less GPRs (5 vs 7), it uses less
SIB arithmetics (0 vs 4 times), it uses a well known scheme for copying data pages.
As far as the result is concerned, it is equivalent to the existing code, but it's simpler
(and faster).  IMO, simpler code is always easier to understand.


> > > If you want cheap way to speed it up, kill cr3 manipulation.
> > 
> > Sure, but I think it's there for a reason.
> 
> Reason is "to crash it early if we have wrong pagetables".
> 
> > > Anyway, this is likely to clash with hugang's work; I'd prefer this not to be applied.
> > 
> > I am aware of that, but you are not going to merge the hugang's patches soon, are you?
> > If necessary, I can change the patch to work with his code (hugang, what do you think?).
> 
> I think it is just not worth the effort.

Why?  It won't take much time.  I've spent more time for writing the messages
in this thread ... ;-)

Greets,
RJW


-- 
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"

  reply	other threads:[~2005-01-20 22:58 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 [this message]
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
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=200501202358.53918.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=hugang@soulinfo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.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

Powered by JetHome