Re: pte-highmem-5

Benjamin LaHaise
2002-01-16T19:31:16Z

On Wed, Jan 16, 2002 at 10:19:56AM -0800, Linus Torvalds wrote:
> - please don't do that "pte_offset_atomic_irq()" have special support in
> the header files: it is _not_ a generic operation, and it is only used
> by the x86 page fault logic. For that reason, I would suggest moving
> all that logic out of the header files, and into i386/mm/fault.c,
> something along the lines of
>
> pte = pte_offset_nokmap(..)
> addr = kmap_atomic(pte, KM_VMFAULT);
>
> instead of having special magic logic in the header files.

Ah, here's where I come in and say that kmap_atomic stinks and needs to be
replaced. ;-) If you take a look at code in various places making use of
atomic kmaps, some of the more interesting cases (like bio) have to disable
irqs during memory copies in order to avoid races on reuse of an atomic
kmap. I think that's a sign of an interface that needs redesign. My
proposal: make kmap_atomic more like kmap in that it allocates from a pool,
but make the pool per cpu with ~4 entries reserved per context. The only
concern I have is that we might not be restricting the depth of irq entry
currently, but I'm not familiar with that code. Time to code up a patch...

> Other than that it looks fairly straightforward, I think.

Agreed.

-ben