public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: get_user_pages_fast() must flush cache the way
@ 2014-08-28  8:56 Stas Sergeev
  0 siblings, 0 replies; only message in thread
From: Stas Sergeev @ 2014-08-28  8:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux kernel

Hi Andrew, could you please apply?


-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-
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>
---
 arch/sh/mm/gup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/sh/mm/gup.c b/arch/sh/mm/gup.c
index bf8daf9..37458f3 100644
--- a/arch/sh/mm/gup.c
+++ b/arch/sh/mm/gup.c
@@ -105,6 +105,8 @@ static noinline int gup_pte_range(pmd_t pmd,
unsigned long addr,
         VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
         page = pte_page(pte);
         get_page(page);
+        __flush_anon_page(page, addr);
+        flush_dcache_page(page);
         pages[*nr] = page;
         (*nr)++;
 
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-28  8:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28  8:56 [PATCH] sh: get_user_pages_fast() must flush cache the way Stas Sergeev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox