summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2004-07-15 04:29:48 +0000
committeralfred <alfred@FreeBSD.org>2004-07-15 04:29:48 +0000
commit0389c188dede7411146ec973b6345a8fffff458a (patch)
tree66aee63a1ed45729a78b9e66fdab01ae6b42c4c6
parent3bb346143c6b1767730fa93779a0991ec0fef0b1 (diff)
downloadFreeBSD-src-0389c188dede7411146ec973b6345a8fffff458a.zip
FreeBSD-src-0389c188dede7411146ec973b6345a8fffff458a.tar.gz
Tidy up system shutdown.
-rw-r--r--sys/kern/kern_shutdown.c18
-rw-r--r--sys/kern/vfs_subr.c12
2 files changed, 24 insertions, 6 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index d94ecd2..a73a155 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -245,6 +245,9 @@ doadump(void)
static void
boot(int howto)
{
+ int first_buf_printf;
+
+ first_buf_printf = 1;
/* collect extra flags that shutdown_nice might have set */
howto |= shutdown_howto;
@@ -272,7 +275,6 @@ boot(int howto)
#endif
waittime = 0;
- printf("syncing disks, buffers remaining... ");
sync(&thread0, NULL);
@@ -295,6 +297,10 @@ boot(int howto)
}
if (nbusy == 0)
break;
+ if (first_buf_printf) {
+ printf("syncing disks, buffers remaining... ");
+ first_buf_printf = 0;
+ }
printf("%d ", nbusy);
if (nbusy < pbusy)
iter = 0;
@@ -576,20 +582,22 @@ void
kproc_shutdown(void *arg, int howto)
{
struct proc *p;
+ char procname[MAXCOMLEN + 1];
int error;
if (panicstr)
return;
p = (struct proc *)arg;
- printf("Waiting (max %d seconds) for system process `%s' to stop...",
- kproc_shutdown_wait, p->p_comm);
+ strlcpy(procname, p->p_comm, sizeof(procname));
+ printf("Waiting (max %d seconds) for system process `%s' to stop...\n",
+ kproc_shutdown_wait, procname);
error = kthread_suspend(p, kproc_shutdown_wait * hz);
if (error == EWOULDBLOCK)
- printf("timed out\n");
+ printf("Stop of '%s' timed out\n", procname);
else
- printf("stopped\n");
+ printf("Process '%s' stopped\n", procname);
}
/* Registration of dumpers */
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 53403db..8add412 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1546,10 +1546,12 @@ sched_sync(void)
int last_work_seen;
int net_worklist_len;
int syncer_final_iter;
+ int first_printf;
mtx_lock(&Giant);
last_work_seen = 0;
syncer_final_iter = 0;
+ first_printf = 1;
syncer_state = SYNCER_RUNNING;
starttime = time_second;
@@ -1561,12 +1563,20 @@ sched_sync(void)
if (syncer_state == SYNCER_FINAL_DELAY &&
syncer_final_iter == 0) {
mtx_unlock(&sync_mtx);
+ printf("done.\n");
kthread_suspend_check(td->td_proc);
mtx_lock(&sync_mtx);
}
net_worklist_len = syncer_worklist_len - sync_vnode_count;
- if (syncer_state != SYNCER_RUNNING && starttime != time_second)
+ if (syncer_state != SYNCER_RUNNING &&
+ starttime != time_second) {
+ if (first_printf) {
+ printf("Syncer syncing disks, "
+ "buffers remaining... ");
+ first_printf = 0;
+ }
printf("%d ", net_worklist_len);
+ }
starttime = time_second;
/*
OpenPOWER on IntegriCloud