svn commit: r211762 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Tue Aug 24 17:48:22 UTC 2010


Author: avg
Date: Tue Aug 24 17:48:22 2010
New Revision: 211762
URL: http://svn.freebsd.org/changeset/base/211762

Log:
  zfs arc_reclaim_thread: no need to call arc_reclaim_needed when
  resetting needfree
  
  needfree is checked at the very start of arc_reclaim_needed.
  This change makes code easier to follow and maintain in face of
  potential changed in arc_reclaim_needed.
  
  Also, put the whole sub-block under _KERNEL because needfree can be set
  only in kernel code.
  
  To do: rename needfree to something else to aovid confusion with
  OpenSolaris global variable of the same name which is used in the same
  code, but has different meaning (page deficit).
  
  Note: I have an impression that locking around accesses to this variable
  as well as mutual notifications between arc_reclaim_thread and
  arc_lowmem are not proper.
  
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Aug 24 17:47:52 2010	(r211761)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Aug 24 17:48:22 2010	(r211762)
@@ -2317,12 +2317,12 @@ arc_reclaim_thread(void *dummy __unused)
 		if (arc_eviction_list != NULL)
 			arc_do_user_evicts();
 
-		if (arc_reclaim_needed()) {
-			needfree = 0;
 #ifdef _KERNEL
+		if (needfree) {
+			needfree = 0;
 			wakeup(&needfree);
-#endif
 		}
+#endif
 
 		/* block until needed, or one second, whichever is shorter */
 		CALLB_CPR_SAFE_BEGIN(&cpr);


More information about the svn-src-head mailing list