Skip to content

Commit caac7e6

Browse files
Stas Sergeevtorvalds
authored andcommitted
sh: get_user_pages_fast() must flush cache
This patch avoids fuse hangs on sh4 by flushing the cache on get_user_pages_fast(). This is not necessary a good thing to do, but get_user_pages() does this, so get_user_pages_fast() should too. Please note the patch for mips arch that addresses the similar problem: https://kernel.googlesource.com/pub/scm/linux/kernel/git/ralf/linux/+/linux-3.4.50%5E!/#F0 They basically simply disable get_user_pages_fast() at all, using a fall-back to get_user_pages(). But my fix is different, it adds an explicit cache flushes. Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net> Cc: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Kamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c680e41 commit caac7e6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎arch/sh/mm/gup.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ static noinline int gup_pte_range(pmd_t pmd, unsigned long addr,
105105
VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
106106
page = pte_page(pte);
107107
get_page(page);
108+
__flush_anon_page(page, addr);
109+
flush_dcache_page(page);
108110
pages[*nr] = page;
109111
(*nr)++;
110112

0 commit comments

Comments
 (0)