Re: [RFC] On paging of kernel VM.

From: David Woodhouse (dwmw2@infradead.org)
Date: Mon Sep 09 2002 - 06:24:40 EST


sct@redhat.com said:
> The alternative is a kmap-style mechanism for temporarily mapping
> pages beyond physical memory on demand.

That's a possibility I'd considered, but in this case there are problems
with explicitly mapping and unmapping the pages. The locking of the chip is
a detail I was hoping to avoid exposing to the users of the device.

With mapping/unmapping done explicitly, not only does an active mapping
prevent all other users from writing to the same device, hence requiring a
'cond_temporarily_unmap()' kind of function, but you also get deadlock if a
user of the device tries to write while they have a mapping active. The
answer "don't do that then" is workable but not preferable.

Given that all the logic to mark pages present on read and then invalidate
them on write access is going to have to be there for userspace _anyway_,
being able to keep the API nice and simple by using that in kernelspace too
would be far better, if we can justify the change to the slow path of the
vmalloc fault case.

But yes, what you suggest is the current API for the flash stuff, sans the
'cond_temporarily_unmap_if_people_are_waiting()' bit. And that's why I've
avoided actually _using_ it, preferring to put up with the overhead of
reading into a RAM buffer until we can fix it.

--
dwmw2

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Sep 15 2002 - 22:00:16 EST