]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[PATCH] update to the kernel kmap/kunmap API
authorJames Bottomley <James.Bottomley@SteelEye.com>
Tue, 26 Sep 2006 06:30:55 +0000 (23:30 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 26 Sep 2006 15:48:44 +0000 (08:48 -0700)
commita6ca1b99ed434f3fb41bbed647ed36c0420501e5
tree59bb799e202f912ced4230e6b4c194c9c0097758
parent3998b9301d3d55be8373add22b6bc5e11c1d9b71
[PATCH] update to the kernel kmap/kunmap API

Give non-highmem architectures access to the kmap API for the purposes of
overriding (this is what the attached patch does).

The proposal is that we should now require all architectures with coherence
issues to manage data coherence via the kmap/kunmap API.  Thus driver
writers never have to write code like

    kmap(page)
    modify data in page
    flush_kernel_dcache_page(page)
    kunmap(page)

instead, kmap/kunmap will manage the coherence and driver (and filesystem)
writers don't need to worry about how to flush between kmap and kunmap.

For most architectures, the page only needs to be flushed if it was
actually written to *and* there are user mappings of it, so the best
implementation looks to be: clear the page dirty pte bit in the kernel page
tables on kmap and on kunmap, check page->mappings for user maps, and then
the dirty bit, and only flush if it both has user mappings and is dirty.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/highmem.h