Skip to content

Commit 65db404

Browse files
move linux_set_current after WUNLOCK
To avoid alloc with non-sleepable lock
1 parent ca308d8 commit 65db404

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
@@ -694,7 +694,6 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type,
694694
struct lcdev_handle *hndl;
695695
int rc, err;
696696

697-
linux_set_current();
698697

699698
hndl = vm_obj->handle;
700699
vmf.virtual_address = (void *)(pidx << PAGE_SHIFT);
@@ -712,6 +711,9 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type,
712711
cvma.vm_obj = vm_obj;
713712

714713
VM_OBJECT_WUNLOCK(vm_obj);
714+
715+
linux_set_current();
716+
715717
err = hndl->vma_ops->fault(&cvma, &vmf);
716718
while (cvma.vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) {
717719
kern_yield(0);

0 commit comments

Comments
 (0)