There is no way this can be cleanly done.
The problem occurs whenever you then try to map or unmap parts of the area
to something else:
p = mmap(fd, 4M)
munmap(p,4k)
which anything with this approach will just completely die off, even once
you removed the ugly special casing.
Basically, anything that wants to do "large page" mappings of a frame
buffer needs to use something that isn't standard mmap(). Whether that's a
special flag to mmap() or something else is immaterial, but it needs to be
done on a VMA basis, not on a page table basis. Because we need to
disallow partial unmaps etc.
Trying to do this with a standard mmap() and doing page table only tricks
is doomed. Don't even try.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/