Linus Torvalds wrote: > > If the choice is between a hack to do strange and incomprehensible things > for a special case, and just making the semaphores do the same thing > rw-spinlocks do and make the problem go away naturally, Ill take #2 any > day. The patches already exist, after all. > I've attached a recursive semaphore patch against 2.4.10-pre11 - but it makes mmap io unusable: Testcase: * file, mmaped, 300 MB, 128 MB Ram * 2 threads: touch random pages * third thread: calls mprotect(0xFFFF00000,0x1000, PAGE_READ) Result: mprotect hangs forever (minutes) with recursive semaphores. With fair semaphores, mprotect returns after ~80 milliseconds with 5 worker threads, after ~380 milliseconds with 20 worker threads (slow IDE disk). One alternative to David's patch would be moving the locking into the coredump handlers - would you prefer that? -- Manfred