public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* Potential problem with the page_mapping macro and flush_dcache_page()
@ 2006-03-19 17:15 James Bottomley
  2006-03-19 20:33 ` David S. Miller
  0 siblings, 1 reply; 16+ messages in thread
From: James Bottomley @ 2006-03-19 17:15 UTC (permalink / raw)
  To: linux-arch

This issue came up while investigating why fuse doesn't work on parisc.

The problem, essentially is that get_user_pages() doesn't return a
coherent view of anonymous pages to the kernel.  The reason is that
get_user_pages() uses flush_dcache_page() as its engine of coherence,
and a lot of flush_dcache_page() implementations use the page_mapping()
macros to get a list of user mappings of the page.  The page_mapping()
macro (include/linux/mm.h) returns NULL if the PAGE_MAPPING_ANON flag is
set, this means that flush_dcache_page() has no list of user mappings,
so nothing gets flushed in user space.

A lot of arch's don't have an incoherent view of user and kernel
mappings, so I think this problem perhaps affects only parisc and arm.

It seems to me that once get_user_pages() has executed, we should have a
guarantee that the kernel has a coherent view of all the pages so
returned, so either flush_dcache_page() should iterate over anonymous
page mappings (my preferred solution) or get_user_pages() should have
additional coherency for anonymous pages.

Although this problem first manifested with fuse, I think we would have
a similar issue doing SG_IO on memory obtained from brk, so we're lucky
it hasn't bitten us before.

James



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-03-23 14:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-19 17:15 Potential problem with the page_mapping macro and flush_dcache_page() James Bottomley
2006-03-19 20:33 ` David S. Miller
2006-03-19 20:53   ` James Bottomley
2006-03-19 21:00     ` David S. Miller
2006-03-19 21:04       ` James Bottomley
2006-03-19 21:23         ` James Bottomley
2006-03-19 21:26           ` David S. Miller
2006-03-19 23:50             ` James Bottomley
2006-03-20  1:15               ` James Bottomley
2006-03-19 21:25         ` David S. Miller
2006-03-19 21:29           ` James Bottomley
2006-03-19 22:01             ` David S. Miller
2006-03-19 23:39               ` James Bottomley
2006-03-19 23:42                 ` David S. Miller
2006-03-23  6:20             ` Andrew Morton
2006-03-23 14:13               ` James Bottomley

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