All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] clerar user page test
@ 2004-12-07 14:12 Joel Soete
  2004-12-09  7:42 ` Grant Grundler
  2004-12-09 17:32 ` Grant Grundler
  0 siblings, 2 replies; 4+ messages in thread
From: Joel Soete @ 2004-12-07 14:12 UTC (permalink / raw)
  To: parisc-linux

[-- Attachment #1: Type: text/plain, Size: 829 bytes --]

Hello all,

here are the results of some clup test:
(run on b2k running  2.6.10-rc3-pa2 64bit)
time ./clup0; time ./clup1 ; time ./clup2

real    0m0.498s
user    0m0.440s
sys     0m0.014s

real    0m0.277s
user    0m0.229s
sys     0m0.010s

real    0m0.272s
user    0m0.227s
sys     0m0.013s

(the corresponding src are attached.
Compile with (for remind:):
ggc -o clup0 clup0.c
gcc -mach=2.0 -o clup1 clup1.c
gcc -mach=2.0 -o clup2 clup2.c)

so real benefit to use double word insn on 64bit (clup0 verusu clup1)

but not reducing the number of loop (clup1 versus clup2)

hth,
    Joel


---------------------------------------------------------------------------
Tiscali vous offre 3 mois d'ADSL et 3 mois de DVD gratuits...profitez-en...
http://reg.tiscali.be/adsl/default.asp?lg=FR





[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: clup2.c --]
[-- Type: text/x-csrc, Size: 1584 bytes --]


#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

#define LP64	1 

void __clear_user_page_asm(unsigned long vaddr)
{

asm volatile ("ldi	64,%%r1\n"
#ifdef LP64
"1:	std	%%r0,0(%0)\n"		
"	std	%%r0,8(%0)\n"		
"	std	%%r0,16(%0)\n"	
"	std	%%r0,24(%0)\n"
"	std	%%r0,32(%0)\n"
"	std	%%r0,40(%0)\n"
"	std	%%r0,48(%0)\n"	
"	std	%%r0,56(%0)\n"
"	std	%%r0,64(%0)\n"		
"	std	%%r0,72(%0)\n"		
"	std	%%r0,80(%0)\n"	
"	std	%%r0,88(%0)\n"
"	std	%%r0,96(%0)\n"
"	std	%%r0,104(%0)\n"
"	std	%%r0,112(%0)\n"	
"	std	%%r0,120(%0)\n"
"	addib,>  -2,%%r1,1b\n"
"	ldo	128(%0),%0"
#else
"1:	stw	%%r0,0(%0)\n"
"	stw	%%r0,4(%0)\n"
"	stw	%%r0,8(%0)\n"
"	stw	%%r0,12(%0)\n"
"	stw	%%r0,16(%0)\n"
"	stw	%%r0,20(%0)\n"
"	stw	%%r0,24(%0)\n"
"	stw	%%r0,28(%0)\n"
"	stw	%%r0,32(%0)\n"
"	stw	%%r0,36(%0)\n"	
"	stw	%%r0,40(%0)\n"
"	stw	%%r0,44(%0)\n"
"	stw	%%r0,48(%0)\n"	
"	stw	%%r0,52(%0)\n"
"	stw	%%r0,56(%0)\n"
"	stw	%%r0,60(%0)\n"
"	addib,>  -1,%%r1,1b\n"
"	ldo	64(%0),%0"
#endif
	:		
	: "r"(vaddr) );
}

/* 
#define	INIT	1
#define	DEBUG	1
 */

int main(int argc, char * * argv, char * * env)
{
	char APage[4096];
	int i, j, k;

#if INIT
	for (i=0; i<4096; i++) {
		j = i % 26;
#if DEBUG
		printf("%d, %d\n", i, j);
#endif
		APage[i] = (char)(j+65);
#if DEBUG
		printf("APage[%d] = %d\n", i, APage[i]);
#endif
	};
	APage[4096] = '\0';
#if DEBUG
	printf("APage: %s.\n", APage);
#endif
#endif	/* INIT */
	for (i=0; i<40*4096; i++) {
		__clear_user_page_asm((unsigned long)APage);
	}

#if DEBUG
	for (i=0; i<4096; i++) {
		printf("APage[%d] = %d\n", i, APage[i]);
	}
#endif
    return 0;
}


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: clup1.c --]
[-- Type: text/x-csrc, Size: 1324 bytes --]


#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

#define LP64	1 

void __clear_user_page_asm(unsigned long vaddr)
{

asm volatile ("ldi	64,%%r1\n"
#ifdef LP64
"1:	std	%%r0,0(%0)\n"		
"	std	%%r0,8(%0)\n"		
"	std	%%r0,16(%0)\n"	
"	std	%%r0,24(%0)\n"
"	std	%%r0,32(%0)\n"
"	std	%%r0,40(%0)\n"
"	std	%%r0,48(%0)\n"	
"	std	%%r0,56(%0)\n"
#else
"1:	stw	%%r0,0(%0)\n"
"	stw	%%r0,4(%0)\n"
"	stw	%%r0,8(%0)\n"
"	stw	%%r0,12(%0)\n"
"	stw	%%r0,16(%0)\n"
"	stw	%%r0,20(%0)\n"
"	stw	%%r0,24(%0)\n"
"	stw	%%r0,28(%0)\n"
"	stw	%%r0,32(%0)\n"
"	stw	%%r0,36(%0)\n"	
"	stw	%%r0,40(%0)\n"
"	stw	%%r0,44(%0)\n"
"	stw	%%r0,48(%0)\n"	
"	stw	%%r0,52(%0)\n"
"	stw	%%r0,56(%0)\n"
"	stw	%%r0,60(%0)\n"
#endif
"	addib,>  -1,%%r1,1b\n"
"	ldo	64(%0),%0"
	:		
	: "r"(vaddr) );
}

int main(int argc, char * * argv, char * * env)
{
	char APage[4096];
	int i, j, k;

#if INIT
	for (i=0; i<4096; i++) {
		j = i % 26;
#if DEBUG
		printf("%d, %d\n", i, j);
#endif
		APage[i] = (char)(j+65);
#if DEBUG
		printf("APage[%d] = %d\n", i, APage[i]);
#endif
	};
	APage[4096] = '\0';
#if DEBUG
	printf("APage: %s.\n", APage);
#endif
#endif	/* INIT */
	for (i=0; i<40*4096; i++) {
		__clear_user_page_asm((unsigned long)APage);
	}

#if DEBUG
	for (i=0; i<4096; i++) {
		printf("APage[%d] = %d\n", i, APage[i]);
	}
#endif
    return 0;
}


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: clup0.c --]
[-- Type: text/x-csrc, Size: 1330 bytes --]


#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

/* #define LP64	1  */

void __clear_user_page_asm(unsigned long vaddr)
{

asm volatile ("ldi	64,%%r1\n"
#ifdef LP64
"1:	std	%%r0,0(%0)\n"		
"	std	%%r0,8(%0)\n"		
"	std	%%r0,16(%0)\n"	
"	std	%%r0,24(%0)\n"
"	std	%%r0,32(%0)\n"
"	std	%%r0,40(%0)\n"
"	std	%%r0,48(%0)\n"	
"	std	%%r0,56(%0)\n"
#else
"1:	stw	%%r0,0(%0)\n"
"	stw	%%r0,4(%0)\n"
"	stw	%%r0,8(%0)\n"
"	stw	%%r0,12(%0)\n"
"	stw	%%r0,16(%0)\n"
"	stw	%%r0,20(%0)\n"
"	stw	%%r0,24(%0)\n"
"	stw	%%r0,28(%0)\n"
"	stw	%%r0,32(%0)\n"
"	stw	%%r0,36(%0)\n"	
"	stw	%%r0,40(%0)\n"
"	stw	%%r0,44(%0)\n"
"	stw	%%r0,48(%0)\n"	
"	stw	%%r0,52(%0)\n"
"	stw	%%r0,56(%0)\n"
"	stw	%%r0,60(%0)\n"
#endif
"	addib,>  -1,%%r1,1b\n"
"	ldo	64(%0),%0"
	:		
	: "r"(vaddr) );
}

int main(int argc, char * * argv, char * * env)
{
	char APage[4096];
	int i, j, k;

#if INIT
	for (i=0; i<4096; i++) {
		j = i % 26;
#if DEBUG
		printf("%d, %d\n", i, j);
#endif
		APage[i] = (char)(j+65);
#if DEBUG
		printf("APage[%d] = %d\n", i, APage[i]);
#endif
	};
	APage[4096] = '\0';
#if DEBUG
	printf("APage: %s.\n", APage);
#endif
#endif	/* INIT */
	for (i=0; i<40*4096; i++) {
		__clear_user_page_asm((unsigned long)APage);
	}

#if DEBUG
	for (i=0; i<4096; i++) {
		printf("APage[%d] = %d\n", i, APage[i]);
	}
#endif
    return 0;
}


[-- Attachment #5: Type: text/plain, Size: 169 bytes --]

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-12-09 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-07 14:12 [parisc-linux] clerar user page test Joel Soete
2004-12-09  7:42 ` Grant Grundler
2004-12-09 17:32 ` Grant Grundler
2004-12-09 18:31   ` Joel Soete

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.