lkml.org 
[lkml]   [2018]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 2/2] arm64: compat: cacheflush syscall: process only pages that are in the memory
On Fri, Jan 26, 2018 at 12:14:41PM +0100, Marek Szyprowski wrote:
> @@ -32,23 +33,36 @@
> static long
> __do_compat_cache_op(unsigned long start, unsigned long end)
[...]
> + if (follow_page(vma, start, 0)) {
> + ret = __flush_cache_user_range(start, start + chunk);
> + if (ret)
> + goto done;
> + }

This looks pretty expensive for pages already in memory. Could we do
some tricks with the AT instruction in __flush_cache_user_range() so
that we skip the flushing if the page isn't there? We know that when a
page is mapped, the cache will get cleaned/invalidated via set_pte_at()
+ sync_icache_dcache(), so the only problem of a race is flushing the
caches twice for a page. If a page gets unmapped after AT, we may bring
it back through the cache ops.

--
Catalin

\
 
 \ /
  Last update: 2018-01-26 18:42    [W:0.059 / U:2.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site