mmap_lock: change trace and locking order