Re: locking question: do_mmap(), do_munmap()

Stephen C. Tweedie
1999-10-11T15:43:13Z

Hi,

On Sun, 10 Oct 1999 19:12:58 +0200 (CEST), Andrea Arcangeli
<andrea@suse.de> said:

> The other option is to make the mmap semaphore recursive checking that GFP
> is not called in the middle of a vma change. I don't like this one it sound
> not robust as the spinlock way to me (see below).

Doesn't work, because you can still have a process which takes one mmap
semaphore and then attempts to take a different one inside the swapper
as the result of a memory allocation. As soon as you have two processes
doing that to each other's semaphores, you still have a deadlock.

--Stephen