Messages in this thread | | | Date | Wed, 18 Oct 2000 15:40:39 +0100 | From | Stephen Tweedie <> | Subject | Re: mapping user space buffer to kernel address space |
| |
Hi,
On Wed, Oct 18, 2000 at 03:23:17PM +0200, Andrea Arcangeli wrote:
> This change makes sense and I agree it would cover the problem. However I > prefer to clarify that doing it for the swap cache as described is not nearly > enough to cover the mm corruption (everything that gets written via a memory > balancing mechanism should do the same). > > Said that I think it would be possible to do it for SHM and shared mappings too.
shm already does it: shm_swap_core returns RETRY unless page count is 1. file maps are close: file swapping already uses the address space a_ops, but currently uses that at the wrong time: unmap time rather than last-release. Rik?
> However this still makes me wonder why should we unmap the pte of a page that > we can't free until we unmap_kiobuf? That's not as bad as having a > nopage+swapout dummy operations in the sound driver DMA page case, because > usually user-kiobufs are temporary just for the time of the DMA I/O, though.
It's no different from mlock(): if you've got some reason why one specific mapping can't be unmapped (either it's locked or it is inherently non-swappable like a kiobuf), then there's no reason to make that per-mapping information visible at the per-page level.
We allow multiple processes to mlock() the same page, after all.
Cheers, Stephen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
| |