Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 May 2020 08:05:02 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r360621 - head/sys/compat/linuxkpi/common/src
Message-ID:  <202005040805.0448523h090586@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon May  4 08:05:01 2020
New Revision: 360621
URL: https://svnweb.freebsd.org/changeset/base/360621

Log:
  Fix warning about sleeping with non-sleepable lock when allocating
  "current" from linux_cdev_pager_populate() in the LinuxKPI:
  
  Backtrace:
  witness_debugger()
  witness_warn()
  uma_zalloc_arg()
  malloc()
  linux_alloc_current()
  linux_cdev_pager_populate()
  vm_fault()
  vm_fault_trap()
  trap_pfault()
  trap()
  calltrap()
  
  Suggested by:	avg@
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_compat.c	Mon May  4 07:57:55 2020	(r360620)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c	Mon May  4 08:05:01 2020	(r360621)
@@ -525,14 +525,14 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde
 	struct vm_area_struct *vmap;
 	int err;
 
-	linux_set_current(curthread);
-
 	/* get VM area structure */
 	vmap = linux_cdev_handle_find(vm_obj->handle);
 	MPASS(vmap != NULL);
 	MPASS(vmap->vm_private_data == vm_obj->handle);
 
 	VM_OBJECT_WUNLOCK(vm_obj);
+
+	linux_set_current(curthread);
 
 	down_write(&vmap->vm_mm->mmap_sem);
 	if (unlikely(vmap->vm_ops == NULL)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005040805.0448523h090586>