Skip to content

Commit 32675cc

Browse files
move linux_set_current after WUNLOCK
To avoid alloc with non-sleepable lock
1 parent 9577ef9 commit 32675cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sys/compat/linuxkpi/common/src/linux_compat.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type,
672672
struct lcdev_handle *hndl;
673673
int rc, err;
674674

675-
linux_set_current(curthread);
676675

677676
hndl = vm_obj->handle;
678677
vmf.virtual_address = (void *)(pidx << PAGE_SHIFT);
@@ -690,6 +689,9 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type,
690689
cvma.vm_obj = vm_obj;
691690

692691
VM_OBJECT_WUNLOCK(vm_obj);
692+
693+
linux_set_current(curthread);
694+
693695
err = hndl->vma_ops->fault(&cvma, &vmf);
694696
while (cvma.vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) {
695697
kern_yield(0);

0 commit comments

Comments
 (0)