Index: linux-2.6/include/asm-alpha/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-alpha/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-alpha/cacheflush.h 2007-06-25 06:42:15.000000000 -0700 @@ -10,6 +10,7 @@ #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) #define flush_dcache_page(page) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_cache_vmap(start, end) do { } while (0) Index: linux-2.6/include/asm-arm/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-arm/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-arm/cacheflush.h 2007-06-25 06:43:37.000000000 -0700 @@ -400,6 +400,8 @@ */ extern void flush_dcache_page(struct page *); +#define flush_dcache_range(start, end) do { } while (0) + extern void __flush_dcache_page(struct address_space *mapping, struct page *page); #define ARCH_HAS_FLUSH_ANON_PAGE Index: linux-2.6/include/asm-arm26/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-arm26/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-arm26/cacheflush.h 2007-06-25 06:42:24.000000000 -0700 @@ -25,6 +25,7 @@ #define flush_cache_dup_mm(mm) do { } while (0) #define flush_cache_range(vma,start,end) do { } while (0) #define flush_cache_page(vma,vmaddr,pfn) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_cache_vmap(start, end) do { } while (0) #define flush_cache_vunmap(start, end) do { } while (0) Index: linux-2.6/include/asm-avr32/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-avr32/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-avr32/cacheflush.h 2007-06-25 06:44:03.000000000 -0700 @@ -108,6 +108,7 @@ * configurations exist at this time. */ #define flush_dcache_page(page) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_dcache_mmap_lock(page) do { } while (0) #define flush_dcache_mmap_unlock(page) do { } while (0) Index: linux-2.6/include/asm-cris/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-cris/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-cris/cacheflush.h 2007-06-25 06:45:24.000000000 -0700 @@ -13,6 +13,7 @@ #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) #define flush_dcache_page(page) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_icache_range(start, end) do { } while (0) Index: linux-2.6/include/asm-frv/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-frv/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-frv/cacheflush.h 2007-06-25 06:46:48.000000000 -0700 @@ -49,12 +49,18 @@ /* dcache/icache coherency... */ #ifdef CONFIG_MMU extern void flush_dcache_page(struct page *page); +extern void flush_dcache_range(unsigned long start, unsigned long end); #else static inline void flush_dcache_page(struct page *page) { unsigned long addr = page_to_phys(page); frv_dcache_writeback(addr, addr + PAGE_SIZE); } + +static inline void flush_dcache_range(unsigned long start, unsigned long end) +{ + frv_dcache_writeback(addr, end); +} #endif static inline void flush_page_to_ram(struct page *page) Index: linux-2.6/include/asm-h8300/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-h8300/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-h8300/cacheflush.h 2007-06-25 06:47:15.000000000 -0700 @@ -16,6 +16,7 @@ #define flush_cache_range(vma,a,b) #define flush_cache_page(vma,p,pfn) #define flush_dcache_page(page) +#define flush_dcache_range(start, end) #define flush_dcache_mmap_lock(mapping) #define flush_dcache_mmap_unlock(mapping) #define flush_icache() Index: linux-2.6/include/asm-i386/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-i386/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-i386/cacheflush.h 2007-06-25 06:47:32.000000000 -0700 @@ -11,6 +11,7 @@ #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) #define flush_dcache_page(page) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_icache_range(start, end) do { } while (0) Index: linux-2.6/include/asm-ia64/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-ia64/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-ia64/cacheflush.h 2007-06-25 06:47:59.000000000 -0700 @@ -21,6 +21,7 @@ #define flush_cache_dup_mm(mm) do { } while (0) #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_icache_page(vma,page) do { } while (0) #define flush_cache_vmap(start, end) do { } while (0) #define flush_cache_vunmap(start, end) do { } while (0) Index: linux-2.6/include/asm-m32r/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-m32r/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-m32r/cacheflush.h 2007-06-25 06:48:16.000000000 -0700 @@ -13,6 +13,7 @@ #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) #define flush_dcache_page(page) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) #ifndef CONFIG_SMP Index: linux-2.6/include/asm-m68k/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-m68k/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-m68k/cacheflush.h 2007-06-25 06:52:07.000000000 -0700 @@ -129,6 +129,15 @@ } #define flush_dcache_page(page) __flush_page_to_ram(page_address(page)) + +static inline void flush_dcache_range(unsigned long start, unsigned lonhg end) +{ + int pfn; + + for (pfn = page_to_pfn(start); pfn <= page_to_pfn(end); pfn++) + __flush_page_to_ram(pfn_to_page(pfn)); +} + #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page)) Index: linux-2.6/include/asm-m68knommu/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-m68knommu/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-m68knommu/cacheflush.h 2007-06-25 06:52:51.000000000 -0700 @@ -13,6 +13,7 @@ #define flush_cache_page(vma, vmaddr) do { } while (0) #define flush_dcache_range(start,len) __flush_cache_all() #define flush_dcache_page(page) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_icache_range(start,len) __flush_cache_all() Index: linux-2.6/include/asm-mips/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-mips/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-mips/cacheflush.h 2007-06-25 06:53:39.000000000 -0700 @@ -45,6 +45,8 @@ } +extern void flush_dcache_range(unsigned long start, unsigned long end); + #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) Index: linux-2.6/include/asm-parisc/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-parisc/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-parisc/cacheflush.h 2007-06-25 06:54:29.000000000 -0700 @@ -30,6 +30,8 @@ void flush_user_dcache_range(unsigned long, unsigned long); void flush_user_icache_range(unsigned long, unsigned long); +#define flush_dcache_range flush_kernel_dcache_range_asm + /* Cache flush operations */ void flush_cache_all_local(void); Index: linux-2.6/include/asm-s390/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-s390/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-s390/cacheflush.h 2007-06-25 06:55:20.000000000 -0700 @@ -11,6 +11,7 @@ #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) #define flush_dcache_page(page) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_icache_range(start, end) do { } while (0) Index: linux-2.6/include/asm-sh64/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-sh64/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-sh64/cacheflush.h 2007-06-25 06:55:52.000000000 -0700 @@ -17,6 +17,7 @@ extern void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn); extern void flush_dcache_page(struct page *pg); extern void flush_icache_range(unsigned long start, unsigned long end); +extern void flush_dcache_range(unsigned long start, unsigned long end); extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, unsigned long addr, int len); Index: linux-2.6/include/asm-sparc/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-sparc/cacheflush.h 2007-06-25 06:41:43.000000000 -0700 +++ linux-2.6/include/asm-sparc/cacheflush.h 2007-06-25 06:56:59.000000000 -0700 @@ -76,6 +76,7 @@ extern void sparc_flush_page_to_ram(struct page *page); #define flush_dcache_page(page) sparc_flush_page_to_ram(page) +#define flush_dcache_range(start, end) sparc_flush_page_to_ram(page) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) Index: linux-2.6/include/asm-sparc64/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-sparc64/cacheflush.h 2007-06-25 06:41:42.000000000 -0700 +++ linux-2.6/include/asm-sparc64/cacheflush.h 2007-06-25 06:56:39.000000000 -0700 @@ -39,6 +39,8 @@ extern void __flush_dcache_range(unsigned long start, unsigned long end); extern void flush_dcache_page(struct page *page); +#define flush_dcache_range __flush_dcache_range + #define flush_icache_page(vma, pg) do { } while(0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) Index: linux-2.6/include/asm-v850/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-v850/cacheflush.h 2007-06-25 06:41:43.000000000 -0700 +++ linux-2.6/include/asm-v850/cacheflush.h 2007-06-25 06:57:33.000000000 -0700 @@ -28,6 +28,7 @@ #define flush_cache_range(vma, start, end) ((void)0) #define flush_cache_page(vma, vmaddr, pfn) ((void)0) #define flush_dcache_page(page) ((void)0) +#define flush_dcache_range(start, end) ((void)0) #define flush_dcache_mmap_lock(mapping) ((void)0) #define flush_dcache_mmap_unlock(mapping) ((void)0) #define flush_cache_vmap(start, end) ((void)0) Index: linux-2.6/include/asm-x86_64/cacheflush.h =================================================================== --- linux-2.6.orig/include/asm-x86_64/cacheflush.h 2007-06-25 06:41:43.000000000 -0700 +++ linux-2.6/include/asm-x86_64/cacheflush.h 2007-06-25 07:01:44.000000000 -0700 @@ -11,6 +11,7 @@ #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) #define flush_dcache_page(page) do { } while (0) +#define flush_dcache_range(start, end) do { } while (0) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_icache_range(start, end) do { } while (0) Index: linux-2.6/include/linux/mm.h =================================================================== --- linux-2.6.orig/include/linux/mm.h 2007-06-25 06:39:50.000000000 -0700 +++ linux-2.6/include/linux/mm.h 2007-06-25 06:40:18.000000000 -0700 @@ -601,12 +601,9 @@ { struct address_space *mapping = page->mapping; + WARN_ON_ONCE(PageSlab(page)); if (unlikely(PageSwapCache(page))) mapping = &swapper_space; -#ifdef CONFIG_SLUB - else if (unlikely(PageSlab(page))) - mapping = NULL; -#endif else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) mapping = NULL; return mapping;