3rd version of R/W mmap_sem patch available
Quoted 4 lines
Besides, the fair semaphores would potentially slow things down, while this potentially speeds things up. So.. It looks obvious enough.
Rik, did you check that {pte,pmd}_alloc are thread safe? At least in 2.4.2 they aren't (include/asm-i386/pgalloc.h), and your patch doesn't touch pgalloc.
{pte,pmd}_alloc are called from handle_mm_fault, and that function is now running with down_read().
--
Manfred
Quoted 4 lines · Manfred Spraul
Rik, did you check that {pte,pmd}_alloc are thread safe? At least in 2.4.2 they aren't (
include/asm-i386/pgalloc.h), and your patch doesn't touch pgalloc.
Excellent point. We used to do all the looping and re-trying, but it got ripped out a long time ago (and in any case, it historically didn't do SMP, so the old code doesn't really work).
Linus
Quoted 4 lines · Linus Torvalds
Excellent point. We used to do all the looping and re-trying, but it got ripped out a long time ago (and in any case, it historically didn't do SMP, so the old code doesn't really work).
Actually, funnily enough, I see that the old thread-safe stuff is still there in get_pte_kernel_slow(). The only thing that breaks it is that we don't hold any locks, so it's only UP-safe, not SMP-safe.
However, it definitely looks like we should just un-inline that thing completely, and make a lot of it architecture-independent anyway.
Linus
Quoted 6 lines · Linus Torvalds
Quoted 4 lines · Linus Torvalds
Excellent point. We used to do all the looping and re-trying, but it got ripped out a long time ago (and in any case, it historically didn't do SMP, so the old code doesn't really work).
Quoted 6 lines
Actually, funnily enough, I see that the old thread-safe stuff is still there in
get_pte_kernel_slow(). The only thing that breaks it is that we don't hold any locks, so it's only UP-safe, not SMP-safe.However, it definitely looks like we should just un-inline that thing completely, and make a lot of it architecture-independent anyway.
Also, because lots of architectures seem to have exactly the same code, we might as well remove the duplicates and put them in the same place...
regards,
Rik
--
Linux MM bugzilla: http://linux-mm.org/bugzilla.shtml
Virtual memory is like a game you can't win; However, without VM there's truly nothing to lose...
http://www.surriel.com/
Quoted 7 lines · Manfred Spraul
Quoted 3 lines
Besides, the fair semaphores would potentially slow things down, while this potentially speeds things up. So.. It looks obvious enough.
Rik, did you check that {pte,pmd}_alloc are thread safe? At least in 2.4.2 they aren't (
include/asm-i386/pgalloc.h), and your patch doesn't touch pgalloc.
I checked and they're not. This still needs to be fixed...
(ie the patch really isn't ready yet to be included in the main kernel ... OTOH, the changes needed to make it ready are all trivial and tedious ;))
regards,
Rik
--
Linux MM bugzilla: http://linux-mm.org/bugzilla.shtml
Virtual memory is like a game you can't win; However, without VM there's truly nothing to lose...
http://www.surriel.com/
Quoted 4 lines · Rik van Riel
(ie the patch really isn't ready yet to be included in the main kernel ... OTOH, the changes needed to make it ready are all trivial and tedious ;))
They are trivial and tedious only if done wrong - which will also add tons of new places where we lock and unlock only to lock again.
My -pre5 has the non-trivial "fix the calling convention and require that pmd/pgd_alloc() be called with the lock held" version of the patch.
Linus