Messages in this thread | | | Date | Thu, 25 Nov 1999 18:18:44 +0100 (CET) | From | Andrea Arcangeli <> | Subject | Re: [Patch] shm bug introduced with pagecache in 2.3.11 |
| |
On Thu, 25 Nov 1999, Linus Torvalds wrote:
>In 2.3.x, we can use the same trivial approach to protect against threads.
For the allocation is trivial of course (I was just doing that in shm.c).
But I am not been trivially succesfully in fixing the shm swapin races with "read pte with spinlock acquired, release the spinlock, reacquire the spinlock and the check if the pte is changed". That's why I added the spinlock. The _main_ problem I had is that to swapout we have to grab the kernel lock and we'll sleep and so I would need to acquire the spinlocks in inverse order (deadlock prone). So I givenup and I took the _trivial_ mainstream way to use the semaphore to protect multiple thread accesses (also for shm.c using a semaphore is less interesting as shm.c can't do I/O in the nopage operation unless it's a swapin).
I hope I was missing something and that's simpler...
Andrea
- 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/
| |