Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Nov 2015 01:16:35 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291379 - head/sys/kern
Message-ID:  <201511270116.tAR1GZi9024258@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Nov 27 01:16:35 2015
New Revision: 291379
URL: https://svnweb.freebsd.org/changeset/base/291379

Log:
  Move the comment about resident pages preventing vnode from leaving
  active list, into the header comment for vdrop(), which is the
  function that decides whether to leave the vnode on the list.  Note
  that dirty page write-out in vinactive() is asynchronous.
  
  Discussed with:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Fri Nov 27 01:03:43 2015	(r291378)
+++ head/sys/kern/vfs_subr.c	Fri Nov 27 01:16:35 2015	(r291379)
@@ -2618,6 +2618,10 @@ _vhold(struct vnode *vp, bool locked)
  * Drop the hold count of the vnode.  If this is the last reference to
  * the vnode we place it on the free list unless it has been vgone'd
  * (marked VI_DOOMED) in which case we will free it.
+ *
+ * Because the vnode vm object keeps a hold reference on the vnode if
+ * there is at least one resident non-cached page, the vnode cannot
+ * leave the active list without the page cleanup done.
  */
 void
 _vdrop(struct vnode *vp, bool locked)
@@ -2744,11 +2748,13 @@ vinactive(struct vnode *vp, struct threa
 	VI_UNLOCK(vp);
 	/*
 	 * Before moving off the active list, we must be sure that any
-	 * modified pages are on the vnode's dirty list since these will
-	 * no longer be checked once the vnode is on the inactive list.
-	 * Because the vnode vm object keeps a hold reference on the vnode
-	 * if there is at least one resident non-cached page, the vnode
-	 * cannot leave the active list without the page cleanup done.
+	 * modified pages are converted into the vnode's dirty
+	 * buffers, since these will no longer be checked once the
+	 * vnode is on the inactive list.
+	 *
+	 * The write-out of the dirty pages is asynchronous.  At the
+	 * point that VOP_INACTIVE() is called, there could still be
+	 * pending I/O and dirty pages in the object.
 	 */
 	obj = vp->v_object;
 	if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) {



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