Mark Kettenis <[email protected]> wrote:

> > Isn't the vm_map_lock enough?
> 
> Could be.  The fast path is going to take that lock anyway.  This
> would require a bit of surgery to uvm_map_extract() to make sure we
> don't take the vm_map_lock twice.  Worth exploring I'd say.

I think the vm_map_lock can be dropped before it reaches that code,
because of 3 cases: (1) new kbind lock, (2) a repeated kbind lock and
return, or (3) violation and process termination.

So before doing the copyin() and updates, simply vm_map_unlock()

Will that work and isn't it simpler than David's proposal?

Reply via email to