Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2011 22:17:07 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217076 - in head/sys: kern net
Message-ID:  <201101062217.p06MH7ff030118@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Jan  6 22:17:07 2011
New Revision: 217076
URL: http://svn.freebsd.org/changeset/base/217076

Log:
  - Restore dropping the priority of syncer down to PPAUSE when it is idle.
    This was lost when it was converted to using a condition variable instead
    of lbolt.
  - Drop the priority of flowtable down to PPAUSE when it is idle as well
    since it is a similar background task.
  
  MFC after:	2 weeks

Modified:
  head/sys/kern/vfs_subr.c
  head/sys/net/flowtable.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Thu Jan  6 22:09:37 2011	(r217075)
+++ head/sys/kern/vfs_subr.c	Thu Jan  6 22:17:07 2011	(r217076)
@@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/namei.h>
 #include <sys/priv.h>
 #include <sys/reboot.h>
+#include <sys/sched.h>
 #include <sys/sleepqueue.h>
 #include <sys/stat.h>
 #include <sys/sysctl.h>
@@ -1880,6 +1881,12 @@ sched_sync(void)
 		 * matter as we are just trying to generally pace the
 		 * filesystem activity.
 		 */
+		if (syncer_state != SYNCER_RUNNING ||
+		    time_uptime == starttime) {
+			thread_lock(td);
+			sched_prio(td, PPAUSE);
+			thread_unlock(td);
+		}
 		if (syncer_state != SYNCER_RUNNING)
 			cv_timedwait(&sync_wakeup, &sync_mtx,
 			    hz / SYNCER_SHUTDOWN_SPEEDUP);

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Thu Jan  6 22:09:37 2011	(r217075)
+++ head/sys/net/flowtable.c	Thu Jan  6 22:17:07 2011	(r217076)
@@ -1549,9 +1549,11 @@ static void
 flowtable_cleaner(void)
 {
 	VNET_ITERATOR_DECL(vnet_iter);
+	struct thread *td;
 
 	if (bootverbose)
 		log(LOG_INFO, "flowtable cleaner started\n");
+	td = curthread;
 	while (1) {
 		VNET_LIST_RLOCK();
 		VNET_FOREACH(vnet_iter) {
@@ -1566,6 +1568,9 @@ flowtable_cleaner(void)
 		 * is arbitrary
 		 */
 		mtx_lock(&flowclean_lock);
+		thread_lock(td);
+		sched_prio(td, PPAUSE);
+		thread_unlock(td);
 		flowclean_cycles++;
 		cv_broadcast(&flowclean_f_cv);
 		cv_timedwait(&flowclean_c_cv, &flowclean_lock, flowclean_freq);



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