[parisc-linux] [PATCH] flush our cache through tmpalias space
Joel Soete
soete.joel at scarlet.be
Thu Jun 22 06:26:58 MDT 2006
Hello James,
> One of the current disadvantages parisc has is that we have to walk the
> inode mapping list to do a flush_dcache_page(), which means we get
> entangled in locking. The reason we do this is because a VIPT cache
> can't be flushed without a mapping, so we have to find one to use
>
> The intent of this patch is to instead flush through the tmpalias space
> on the correct congruence boundary which would dispense with the need
> for finding a mapping at all. However, in the current incarnation we
> still walk the mappings to check that all the usermappings are, indeed,
> on the correct congruence boundary. Unfortunately, as you'll see if you
> try it out, not all are ... which is a bit of a problem.
>
I would so but:
make -f /usr/src/linux-2.6.17-pa3/scripts/Makefile.build obj=arch/parisc/kernel
gcc -Wp,-MD,arch/parisc/kernel/.cache.o.d -nostdinc -isystem
/usr/lib/gcc/hppa-linux-gnu/4.0.4/include -D__KERNEL__ -Iinclude -Iinclude2
-I/usr/src/linux-2.6.17-pa3/include -include include/linux/autoconf.h
-I/usr/src/linux-2.6.17-pa3/arch/parisc/kernel -Iarch/parisc/kernel -Wall
-Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-O2 -fomit-frame-pointer -pipe -mno-space-regs -mfast-indirect-calls
-mdisable-fpregs -ffunction-sections -march=1.1 -mschedule=7200
-Wdeclaration-after-statement -Wno-pointer-sign -D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(cache)" -D"KBUILD_MODNAME=KBUILD_STR(cache)" -c
-o arch/parisc/kernel/cache.o /usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c: In function
'flush_dcache_page':
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:305: warning: implicit
declaration of function 'flush_dcache_tmpalias_page'
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:307: warning: implicit
declaration of function 'flush_icache_tmpalias_page'
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c: At top level:
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:373: warning: conflicting
types for 'flush_dcache_tmpalias_page'
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:305: warning: previous
implicit declaration of 'flush_dcache_tmpalias_page' was here
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:387: warning: conflicting
types for 'flush_icache_tmpalias_page'
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:307: warning: previous
implicit declaration of 'flush_icache_tmpalias_page' was here
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:400:29: error: macro
"flush_icache_page" passed 3 arguments, but takes just 2
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:401: error: syntax error
before '{' token
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:404: error:
'flush_icache_page' undeclared here (not in a function)
/usr/src/linux-2.6.17-pa3/arch/parisc/kernel/cache.c:404: warning: type
defaults to 'int' in declaration of 'flush_icache_page'
make[2]: *** [arch/parisc/kernel/cache.o] Error 1
I suppose that warning could be easily avoid by puting those funxtion
declaration in some header like include/asm-parisc/cacheflush.h:
[snip]
extern void flush_dcache_tmpalias_page(unsigned long vaddr, unsigned long paddr);
extern void flush_icache_tmpalias_page(unsigned long vaddr, unsigned long paddr);
[snip]
> James
>
> ? arch/parisc/kernel/test.c
> ? arch/parisc/kernel/test.o.nonvolatile
> Index: arch/parisc/kernel/cache.c
> ===================================================================
> RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/cache.c,v
> retrieving revision 1.28
> diff -u -r1.28 cache.c
> --- arch/parisc/kernel/cache.c 17 Dec 2005 17:21:16 -0000 1.28
> +++ arch/parisc/kernel/cache.c 1 Jan 2006 17:26:25 -0000
[snip
> +
> +void flush_icache_page(struct vm_area_struct *vma, struct page *page,
> + unsigned long vaddr)
> +{
> + flush_alias_i_page(page_to_pfn(page)<<PAGE_SHIFT, vaddr);
> +}
> +EXPORT_SYMBOL(flush_icache_page);
> +
[snip]
but the actual error came from the fact that this same
include/asm-parisc/cacheflush.h already define a macro of the same name:
[snip]
#define flush_icache_page(vma,page) do { flush_kernel_dcache_page(page);
flush_kernel_icache_page(page_address(page)); } while (0)
[snip]
TIA,
Joel
----------
Club Scarlet : Tout le monde gagne! Si vous devenez aujourd'hui Scarlet One grace a un client existant de Scarlet, vous recevez tous les deux un cadeau d'une valeur de 50 euros! Surfez vite sur http://www.clubscarlet.be
More information about the parisc-linux
mailing list