mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hugang@soulinfo.com
To: Lukas Hejtmanek <xhejtman@mail.muni.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PATCH swsusp: page rellocation speed up
Date: Wed, 12 Jan 2005 21:01:10 +0800	[thread overview]
Message-ID: <20050112130110.GA28919@hugang.soulinfo.com> (raw)
In-Reply-To: <20050112124948.GA15687@hugang.soulinfo.com>

On Wed, Jan 12, 2005 at 08:49:49PM +0800, hugang@soulinfo.com wrote:
> On Tue, Jan 11, 2005 at 02:01:23AM +0100, Lukas Hejtmanek wrote:
> > Hello,
> > 
> > attached patch should speed up page rellocation at time of resume. Please test.
> > The diff is against 2.6.10-bk8
> > 
> ....
> 
> really cool, Passed in my x86 and ppc.
> 
> Here is a patch to make pagedir using non-continuity page, 
>  2.6.10 -> mm1 -> this patch -> my patch
> 

support for PowerPc.
  2.6.10 -> mm1 -> Lukas Hejtmanek's patch -> agx's patch -> pbe core ->
   this patch

  agx swsusp patch from http://honk.physik.uni-konstanz.de/~agx/linux-ppc/kernel/

--- 2.6.10-mm1-axg-swap_mem/arch/ppc/kernel/swsusp.S~old	2005-01-12 20:55:31.000000000 +0800
+++ 2.6.10-mm1-axg-swap_mem/arch/ppc/kernel/swsusp.S	2005-01-12 20:57:59.000000000 +0800
@@ -159,43 +159,57 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 	sync
 	isync
 
-	/* Load ptr the list of pages to copy in r3 */
-	lis	r11,(pagedir_nosave - KERNELBASE)@h
-	ori	r11,r11,pagedir_nosave@l
-	lwz	r10,0(r11)
-	tophys(r3,r10)
-
-	/* Load the count of pages to copy in r4 */
-	lis	r11,(nr_copy_pages - KERNELBASE)@h
-	ori	r11,r11,nr_copy_pages@l
-	lwz	r4,0(r11)
+	/* Load ptr the list of pages to copy in r11 */
+	lis     r9,pagedir_nosave@ha
+	addi    r9,r9,pagedir_nosave@l
 
+	tophys(r9,r9)
+	lwz     r9, 0(r9)
+#if 0
+	twi     31,r0,0 /* triger trap */
+#endif
+	cmpwi   r9, 0
+	beq copy_loop_end
 
-	/* Copy the pages. This is a very basic implementation, to
-	 * be replaced by something more cache efficient */
-1:
-	li	r0,256
-	mtctr	r0
-	lwz	r11,0(r3)	/* source */
-	tophys(r5,r11)
-	lwz	r10,4(r3)	/* destination */
-	tophys(r6,r10)
-2:
-	lwz	r8,0(r5)
-	lwz	r9,4(r5)
-	lwz	r10,8(r5)
-	lwz	r11,12(r5)
-	addi	r5,r5,16
-	stw	r8,0(r6)
-	stw	r9,4(r6)
-	stw	r10,8(r6)
-	stw	r11,12(r6)
-	addi	r6,r6,16
-	bdnz	2b
-	addi	r3,r3,16
-	subi	r4,r4,1
-	cmpwi	0,r4,0
-	bne	1b
+copy_loop:
+	tophys(r9,r9)
+	lwz    r6, 12(r9)
+	li     r10, 0
+
+copy_one_pgdir:
+	lwz    r11, 4(r9)
+	addi   r8,r10,1
+	cmpwi  r11, 0
+	addi   r7,r9,16
+	beq copy_loop_end
+	li     r0, 256
+	mtctr  r0
+	lwz    r9,0(r9)
+#if 0
+	twi    31,r0,0 /* triger trap */
+#endif
+	tophys(r10,r11)
+	tophys(r11,r9)
+
+copy_one_page:
+	lwz    r0, 0(r11)
+	stw    r0, 0(r10)
+	lwz    r9, 4(r11)
+	stw    r9, 4(r10)
+	lwz    r0, 8(r11)
+	stw    r0, 8(r10)
+	lwz    r9, 12(r11)
+	addi   r11,r11,16
+	stw    r9, 12(r10)
+	addi   r10,r10,16
+	bdnz copy_one_page
+	mr     r10, r8
+	cmplwi r10, 255
+	mr     r9, r7
+	ble copy_one_pgdir
+	mr     r9, r6
+	bne copy_loop
+copy_loop_end:
 
 	/* Do a very simple cache flush/inval of the L1 to ensure
 	 * coherency of the icache

-- 
Hu Gang       .-.
              /v\
             // \\ 
Linux User  /(   )\  [204016]
GPG Key ID   ^^-^^   http://soulinfo.com/~hugang/hugang.asc

  reply	other threads:[~2005-01-12 13:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-11  1:01 Lukas Hejtmanek
2005-01-12 12:49 ` hugang
2005-01-12 13:01   ` hugang [this message]
2005-01-12 13:46   ` hugang
2005-01-12 15:14   ` hugang

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=20050112130110.GA28919@hugang.soulinfo.com \
    --to=hugang@soulinfo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xhejtman@mail.muni.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