diff options
author | jhb <jhb@FreeBSD.org> | 2011-01-06 22:17:07 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2011-01-06 22:17:07 +0000 |
commit | 3a7fd5f8c7bf1c040291ae6d1a90a9a7c363a513 (patch) | |
tree | 9031a9c78e338599bd4d4d7341d28ed8ade3ee19 /sys | |
parent | a01b1931011406544d31f1736593d077f36df9bd (diff) | |
download | FreeBSD-src-3a7fd5f8c7bf1c040291ae6d1a90a9a7c363a513.zip FreeBSD-src-3a7fd5f8c7bf1c040291ae6d1a90a9a7c363a513.tar.gz |
- 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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_subr.c | 7 | ||||
-rw-r--r-- | sys/net/flowtable.c | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 92030fd..fc413a2 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -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); diff --git a/sys/net/flowtable.c b/sys/net/flowtable.c index 1ba07f9..198c4c3 100644 --- a/sys/net/flowtable.c +++ b/sys/net/flowtable.c @@ -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); |