Commit 08b0b005 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle)
Browse files

mm: Add flush_dcache_folio()



This is a default implementation which calls flush_dcache_page() on
each page in the folio.  If architectures can do better, they should
implement their own version of it.

Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
parent 64601000
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -326,6 +326,12 @@ maps this page at its virtual address.
			dirty.  Again, see sparc64 for examples of how
			to deal with this.

  ``void flush_dcache_folio(struct folio *folio)``
	This function is called under the same circumstances as
	flush_dcache_page().  It allows the architecture to
	optimise for flushing the entire folio of pages instead
	of flushing one page at a time.

  ``void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
  unsigned long user_vaddr, void *dst, void *src, int len)``
  ``void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ void __flush_dcache_page(phys_addr_t paddr, unsigned long vaddr);
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1

void flush_dcache_page(struct page *page);
void flush_dcache_folio(struct folio *folio);

void dma_cache_wback_inv(phys_addr_t start, unsigned long sz);
void dma_cache_inv(phys_addr_t start, unsigned long sz);
+1 −0
Original line number Diff line number Diff line
@@ -290,6 +290,7 @@ extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr
 */
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
extern void flush_dcache_page(struct page *);
void flush_dcache_folio(struct folio *folio);

#define ARCH_IMPLEMENTS_FLUSH_KERNEL_VMAP_RANGE 1
static inline void flush_kernel_vmap_range(void *addr, int size)
+1 −0
Original line number Diff line number Diff line
@@ -250,6 +250,7 @@ static inline void __flush_page_to_ram(void *vaddr)

#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
#define flush_dcache_page(page)		__flush_page_to_ram(page_address(page))
void flush_dcache_folio(struct folio *folio);
#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))
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ static inline void flush_dcache_page(struct page *page)
		SetPageDcacheDirty(page);
}

void flush_dcache_folio(struct folio *folio);

#define flush_dcache_mmap_lock(mapping)		do { } while (0)
#define flush_dcache_mmap_unlock(mapping)	do { } while (0)

Loading