Re: [RFT] [PATCH] kanoj-mm1-2.2.5 ia32 big memory patch

Stephen C. Tweedie (sct@redhat.com)
Tue, 11 May 1999 01:16:08 +0100 (BST)


Hi,

On Mon, 10 May 1999 17:10:14 -0700 (PDT), kanoj@google.engr.sgi.com
(Kanoj Sarcar) said:

> Btw, is mmap_sem really needed for find_extend_vma, since we are already
> holding lock_kernel (which mmap/munmap also gets)?

Yes: find_extend_vma modifies the vma, so you have to make sure that you
aren't doing this while somebody else already has the mm semaphore. You
don't want to modify the vma while another process is doing the page
fault, so you still need to serialise.

The mmap code allocates new vmas, which calls kmalloc, and that can
block if you run out of memory. It really isn't safe to extend the vma
while another thread is blocked like that.

--Stephen

-
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/