Skip to contentSkip to conversation

Calculating kernel logical address ..

DISCUSSION Manfred Spraul 2 participants 3 messages Sep 9, 2002 – Sep 10, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Andrew Morton

Nobody seems to have come forth to implement a thought-out scatter/gather, map-user-pages library infrastructure so I'd be a bit reluctant to break stuff without offering a replacement.

We'd need one.

get_user_pages() is broken if a kernel module access the virtual address of the page and the cpu caches are not coherent:
Most of the flush functions need the vma pointer, but it's impossible to guarantee that it still exists when the get_user_pages() user calls page_cache_release().

--
Manfred

#1 lore raw
Quoted 11 lines · Manfred Spraul
Quoted 4 lines · Andrew Morton

Nobody seems to have come forth to implement a thought-out scatter/gather, map-user-pages library infrastructure so I'd be a bit reluctant to break stuff without offering a replacement.

We'd need one.

get_user_pages() is broken if a kernel module access the virtual address of the page and the cpu caches are not coherent:

OK. Most users seem to just want to put the pages under DMA though.

Quoted 3 lines

Most of the flush functions need the vma pointer, but it's impossible to guarantee that it still exists when the get_user_pages() user calls page_cache_release().

Well presumably, if the driver is altering user memory by hand, it is synchronous and they can hang onto mmap_sem while doing it?

#2 lore raw
Quoted 18 lines · Andrew Morton
Quoted 11 lines · Manfred Spraul
Quoted 4 lines · Andrew Morton

Nobody seems to have come forth to implement a thought-out scatter/gather, map-user-pages library infrastructure so I'd be a bit reluctant to break stuff without offering a replacement.

We'd need one.

get_user_pages() is broken if a kernel module access the virtual address of the page and the cpu caches are not coherent:

OK. Most users seem to just want to put the pages under DMA though.

Quoted 8 lines
Quoted 3 lines

Most of the flush functions need the vma pointer, but it's impossible to guarantee that it still exists when the get_user_pages() user calls page_cache_release().

Well presumably, if the driver is altering user memory by hand, it is synchronous and they can hang onto mmap_sem while doing it?

That's how it's done right now, and it works, but IMHO it's ugly.
You switch from RAID-1 to RAID-5, and suddenly you might get unexplainable data corruptions with O_DIRECT.

--
Manfred