From owner-freebsd-bugs Tue May 15 14:20:15 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5291137B42C for ; Tue, 15 May 2001 14:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4FLK1n56810; Tue, 15 May 2001 14:20:01 -0700 (PDT) (envelope-from gnats) Received: from rodent.utcs.utoronto.ca (rodent.utcs.utoronto.ca [128.100.102.5]) by hub.freebsd.org (Postfix) with SMTP id DE9D237B422 for ; Tue, 15 May 2001 14:10:02 -0700 (PDT) (envelope-from pkern@utcs.utoronto.ca) Received: by rodent.utcs.utoronto.ca id <444525>; Tue, 15 May 2001 17:09:53 -0400 Message-Id: <01May15.170953edt.444525@rodent.utcs.utoronto.ca> Date: Tue, 15 May 2001 17:09:45 -0400 From: pkern@utcc.utoronto.ca Reply-To: pkern@utcc.utoronto.ca To: FreeBSD-gnats-submit@freebsd.org Cc: pkern@utcc.utoronto.ca X-Send-Pr-Version: 3.113 Subject: kern/27361: kernel log messages only appear 3 times per minute. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 27361 >Category: kern >Synopsis: kernel log messages only appear 3 times per minute. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 15 14:20:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: pkern >Release: FreeBSD 4.3-RELEASE i386 >Organization: Computing and Network Services, University of Toronto. >Environment: System: FreeBSD knobs.utcs 4.3-RELEASE FreeBSD 4.3-RELEASE #10: Tue May 15 14:55:19 EDT 2001 pkern@knobs.utcs:/usr/src/sys/compile/KWAI i386 >Description: syslogd gets kernel log messages only once every 30 seconds or at the top of the minute, whichever comes first. It seems logtimeout() is only called once after the kernel log is opened and then never again after that. So I guess syslogd only gets kernel log messages by virtue of syncer(4)'s flushes ...? >How-To-Repeat: any activity which is guaranteed to generate kernel log messages more frequently than once every 30 seconds. eg. on a kernel configured with IPFIREWALL and IPFIREWALL_VERBOSE ... # ipfw add 10 count log logamount 199990 ip from any to any # ping -c 100 127.0.0.1 ... and look in /var/log/security. the timestamps will tend to clump together at regular 30-sec intervals or at :00 seconds. >Fix: --- /sys/kern/subr_log.c 2001/05/15 16:20:19 1.1 +++ /sys/kern/subr_log.c 2001/05/15 18:55:15 @@ -116,8 +116,8 @@ logclose(dev_t dev, int flag, int mode, struct proc *p) { - callout_stop(&logsoftc.sc_callout); log_open = 0; + callout_stop(&logsoftc.sc_callout); logsoftc.sc_state = 0; funsetown(logsoftc.sc_sigio); return (0); @@ -189,11 +189,14 @@ logtimeout(void *arg) { - if (msgbuftrigger == 0) - return; - msgbuftrigger = 0; if (!log_open) return; + if (msgbuftrigger == 0) { + callout_reset(&logsoftc.sc_callout, + hz / log_wakeups_per_second, logtimeout, NULL); + return; + } + msgbuftrigger = 0; selwakeup(&logsoftc.sc_selp); if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL) pgsigio(logsoftc.sc_sigio, SIGIO, 0); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message