当我使用 mmap_lock 跟踪点时,发生了一些奇怪的事情。我发现内核中的 rwsem 由读者持有,而它由作家持有。那可能吗?
跟踪点输出如下所示: 跟踪点输出
a.out-3240 ( 3230) [002] .... 2202.590031: mmap_lock_start_locking: mm=000000001570189f write=true ip=__vm_munmap+0xef/0x120
a.out-3240 ( 3230) [002] .... 2202.590032: mmap_lock_acquire_returned: mm=000000001570189f write=true ip=__vm_munmap+0xdd/0x120 success=true
a.out-3240 ( 3230) [002] .... 2202.590033: mmap_lock_acquire_returned: mm=000000001570189f write=false ip=__do_munmap+0x4a6/0x510 success=true
a.out-3232 ( 3230) [001] .... 2202.590041: mmap_lock_start_locking: mm=000000001570189f write=false ip=do_user_addr_fault+0x26d/0x4d0
a.out-3232 ( 3230) [001] .... 2202.590041: mmap_lock_acquire_returned: mm=000000001570189f write=false ip=do_user_addr_fault+0x25a/0x4d0 success=false
a.out-3232 ( 3230) [001] .... 2202.590042: mmap_lock_start_locking: mm=000000001570189f write=false ip=do_user_addr_fault+0x3e4/0x4d0
a.out-3237 ( 3230) [000] .... 2202.590042: mmap_lock_start_locking: mm=000000001570189f write=false ip=do_user_addr_fault+0x26d/0x4d0
a.out-3232 ( 3230) [001] .... 2202.590042: mmap_lock_acquire_returned: mm=000000001570189f write=false ip=do_user_addr_fault+0x4bd/0x4d0 success=true
a.out-3237 ( 3230) [000] .... 2202.590042: mmap_lock_acquire_returned: mm=000000001570189f write=false ip=do_user_addr_fault+0x25a/0x4d0 success=false
a.out-3237 ( 3230) [000] .... 2202.590043: mmap_lock_start_locking: mm=000000001570189f write=false ip=do_user_addr_fault+0x3e4/0x4d0
a.out-3237 ( 3230) [000] .... 2202.590043: mmap_lock_acquire_returned: mm=000000001570189f write=false ip=do_user_addr_fault+0x4bd/0x4d0 success=true
a.out-3232 ( 3230) [001] .... 2202.590045: mmap_lock_released: mm=000000001570189f write=false ip=fault_dirty_shared_page+0xe7/0xf0
a.out-3232 ( 3230) [001] .... 2202.590045: mmap_lock_start_locking: mm=000000001570189f write=false ip=do_user_addr_fault+0x3e4/0x4d0
a.out-3232 ( 3230) [001] .... 2202.590046: mmap_lock_acquire_returned: mm=000000001570189f write=false ip=do_user_addr_fault+0x4bd/0x4d0 success=true
a.out-3232 ( 3230) [001] .... 2202.590046: mmap_lock_released: mm=000000001570189f write=false ip=do_user_addr_fault+0x2e9/0x4d0
node-643 ( 643) [005] .... 2202.590052: mmap_lock_start_locking: mm=00000000cfc52fe9 write=false ip=do_user_addr_fault+0x26d/0x4d0
node-643 ( 643) [005] .... 2202.590052: mmap_lock_acquire_returned: mm=00000000cfc52fe9 write=false ip=do_user_addr_fault+0x25a/0x4d0 success=true
node-643 ( 643) [005] .... 2202.590061: mmap_lock_released: mm=00000000cfc52fe9 write=false ip=do_user_addr_fault+0x2e9/0x4d0
node-728 ( 728) [003] .... 2202.590074: mmap_lock_start_locking: mm=000000000bb644df write=false ip=do_user_addr_fault+0x26d/0x4d0
node-728 ( 728) [003] .... 2202.590074: mmap_lock_acquire_returned: mm=000000000bb644df write=false ip=do_user_addr_fault+0x25a/0x4d0 success=true
node-728 ( 728) [003] .... 2202.590076: mmap_lock_released: mm=000000000bb644df write=false ip=do_user_addr_fault+0x2e9/0x4d0
a.out-3240 ( 3230) [002] .... 2202.590077: mmap_lock_released: mm=000000001570189f write=false ip=__vm_munmap+0x10f/0x120