svn commit: r244255 - projects/calloutng/sys/kern
Alexander Motin
mav at FreeBSD.org
Sat Dec 15 12:19:24 UTC 2012
Author: mav
Date: Sat Dec 15 12:19:24 2012
New Revision: 244255
URL: http://svnweb.freebsd.org/changeset/base/244255
Log:
Specify that syslog doesn't need exactly 5 wakeups per second.
Modified:
projects/calloutng/sys/kern/subr_log.c
Modified: projects/calloutng/sys/kern/subr_log.c
==============================================================================
--- projects/calloutng/sys/kern/subr_log.c Sat Dec 15 11:49:32 2012 (r244254)
+++ projects/calloutng/sys/kern/subr_log.c Sat Dec 15 12:19:24 2012 (r244255)
@@ -117,8 +117,8 @@ logopen(struct cdev *dev, int flags, int
return (EBUSY);
}
log_open = 1;
- callout_reset(&logsoftc.sc_callout, hz / log_wakeups_per_second,
- logtimeout, NULL);
+ callout_reset_flags(&logsoftc.sc_callout, hz / log_wakeups_per_second,
+ logtimeout, NULL, C_PRELSET(1));
mtx_unlock(&msgbuf_lock);
fsetown(td->td_proc->p_pid, &logsoftc.sc_sigio); /* signal process only */
@@ -233,22 +233,21 @@ logtimeout(void *arg)
if (!log_open)
return;
- if (log_wakeups_per_second < 1) {
- printf("syslog wakeup is less than one. Adjusting to 1.\n");
- log_wakeups_per_second = 1;
- }
- if (msgbuftrigger == 0) {
- callout_schedule(&logsoftc.sc_callout,
- hz / log_wakeups_per_second);
- return;
- }
+ if (msgbuftrigger == 0)
+ goto done;
msgbuftrigger = 0;
selwakeuppri(&logsoftc.sc_selp, LOG_RDPRI);
KNOTE_LOCKED(&logsoftc.sc_selp.si_note, 0);
if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL)
pgsigio(&logsoftc.sc_sigio, SIGIO, 0);
cv_broadcastpri(&log_wakeup, LOG_RDPRI);
- callout_schedule(&logsoftc.sc_callout, hz / log_wakeups_per_second);
+done:
+ if (log_wakeups_per_second < 1) {
+ printf("syslog wakeup is less than one. Adjusting to 1.\n");
+ log_wakeups_per_second = 1;
+ }
+ callout_reset_flags(&logsoftc.sc_callout, hz / log_wakeups_per_second,
+ logtimeout, NULL, C_PRELSET(1));
}
/*ARGSUSED*/
More information about the svn-src-projects
mailing list