linux/arch/powerpc
Anton Blanchard 63e6c5b810 powerpc: Pair loads and stores in copy_4k_page
A number of our chips like loads and stores to be paired. A small kernel
module testcase shows the improvement of pairing loads and stores in
copy_4k_page:

POWER6: +9%
POWER7: +1.5%

#include <linux/module.h>
#include <linux/mm.h>

#define ITERATIONS 10000000

static int __init copypage_init(void)
{
	struct timespec before, after;
	unsigned long i;
	struct page *destpage, *srcpage;
	char *dest, *src;

	destpage = alloc_page(GFP_KERNEL);
	srcpage = alloc_page(GFP_KERNEL);

	dest = page_address(destpage);
	src = page_address(srcpage);

	getnstimeofday(&before);

	for (i = 0; i < ITERATIONS; i++)
		copy_4K_page(dest, src);

	getnstimeofday(&after);

	free_page((unsigned long)dest);
	free_page((unsigned long)src);

	printk(KERN_DEBUG "copy_4K_page loop took %lu ns\n",
		(after.tv_sec - before.tv_sec) * NSEC_PER_SEC +
		(after.tv_nsec - before.tv_nsec));

	return 0;
}

static void __exit copypage_exit(void)
{
}

module_init(copypage_init)
module_exit(copypage_exit)
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Anton Blanchard");

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-02-17 14:03:16 +11:00
..
boot zlib: Fix build of powerpc boot wrapper 2010-01-13 16:13:39 -08:00
configs powerpc: Reduce differences between pseries and ppc64 defconfigs 2010-02-09 13:56:06 +11:00
include/asm powerpc: Use lwsync for acquire barrier if CPU supports it 2010-02-17 14:03:16 +11:00
kernel powerpc: Convert global "BAD" interrupt to per cpu spurious 2010-02-17 14:02:49 +11:00
kvm KVM: powerpc: Show timing option only on embedded 2010-01-25 12:26:36 -02:00
lib powerpc: Pair loads and stores in copy_4k_page 2010-02-17 14:03:16 +11:00
math-emu powerpc/math-emu: Fix efp dependence 2009-03-11 06:00:08 -05:00
mm powerpc: Convert open coded native hashtable bit lock 2010-02-17 14:03:15 +11:00
oprofile tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
platforms powerpc: Remove whitespace in irq chip name fields 2010-02-17 14:02:48 +11:00
sysdev powerpc: Remove whitespace in irq chip name fields 2010-02-17 14:02:48 +11:00
xmon powerpc: Mark some variables in the page fault path __read_mostly 2010-02-03 17:39:48 +11:00
Kconfig powerpc: Increase NR_IRQS Kconfig maximum to 32768 2010-02-03 17:39:50 +11:00
Kconfig.debug Merge branch 'next' of git://git.secretlab.ca/git/linux-2.6 2009-12-16 13:26:53 -08:00
Makefile powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00
relocs_check.pl powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00