Re: fuse, get_user_pages, flush_anon_page, aliasing caches and all that again



From: Russell King <rmk+lkml@xxxxxxxxxxxxxxxx>
Date: Sun, 31 Dec 2006 09:23:18 +0000

We do this on ARM - if page_mapping() is NULL, we flush the kernel
alias unconditionally. However, we have no view where the user
mapping of that page is, which is where the problem is. Cache lines
remain allocated for the user mapping and data contained within is
not visible via the kernel mapping.

You can walk the RMAP list.

However, it's not only FUSE which is suffering - direct-IO also doesn't
work. If my analysis is correct, only _two_ users of get_user_pages()
with the current process actually does the right thing and that's ptrace
and ELF core dumping. All other users are buggy.

I do not argue that these cases need work, in fact I am aware
of the direct-IO bit.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: sharing memory map between processes (same parent)
    ... | 'warm the cache' by getting the inode into memory. ... It might make a difference if the memory remained mapped to some process ... How about we take a look at the approximate steps that mmap needs to ... So, whether the mapping is transferred to a second process, or the second ...
    (comp.unix.programmer)
  • Re: Can context switches be faster?
    ... But the bulk of the mapping ... lookups will actually occur in a cache of the virtual memory mappings ... with address space switches originate. ... Whether done by the MMU ...
    (Linux-Kernel)
  • Re: Can context switches be faster?
    ... But the bulk of the mapping ... lookups will actually occur in a cache of the virtual memory mappings ... called the translation lookaside buffer (TLB). ... with address space switches originate. ...
    (Linux-Kernel)
  • Re: fuse, get_user_pages, flush_anon_page, aliasing caches and all that again
    ... flush the cache as seen by A PARTICULAR virtual mapping. ... It's the aliasing between the _1_ valid user mapping and the kernel's ... the kernel for a cpu load/store. ...
    (Linux-Kernel)
  • Re: fuse, get_user_pages, flush_anon_page, aliasing caches and all that again
    ... I don't know) only about one single user mapping and one ... >> exactly the same - we have to flush the kernel mapping and the user ... There's a problem with defining cache coherency macros to that extent. ... mmap a general purpose dma region. ...
    (Linux-Kernel)