From owner-freebsd-bugs Fri Jul 6 11:20: 7 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 EC68037B401 for ; Fri, 6 Jul 2001 11:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f66IK2K69543; Fri, 6 Jul 2001 11:20:02 -0700 (PDT) (envelope-from gnats) Date: Fri, 6 Jul 2001 11:20:02 -0700 (PDT) Message-Id: <200107061820.f66IK2K69543@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: P Kern Subject: Re: bin/28738: IPFW log messages causes syslogd to fsync. Reply-To: P Kern Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/28738; it has been noted by GNATS. From: P Kern To: dima@unixfreak.org Cc: FreeBSD-gnats-submit@freebsd.org, pkern@utcs.utoronto.ca Subject: Re: bin/28738: IPFW log messages causes syslogd to fsync. Date: Fri, 6 Jul 2001 14:15:21 -0400 >From unixfreak.org!dima Thu Jul 5 21:13:29 2001 > > pkern@utcs.utoronto.ca writes: > > >Description: > > > > syslogd is set to fsync after each klog message. > > This results in a lot of disk activity if IPFW is being used > > with verbose logging enabled -- an fsync for each IPFW syslog > > (and there could be more than one IPFW log message per packet). > > But IPFW syslogs use the LOG_SECURITY facility so it's possible > > to exempt those messages from being fsync'ed each time. > > But it may not be the only one using LOG_SECURITY. Hi. I made sure to check the kernel sources before trying this change. In 4.3-RELEASE, IPFW messages are the only ones using LOG_SECURITY. So this change would only affect how syslogd behaves when it receives IPFW messages from the kernel. > And if it is now, can you say that for N months in the future? Hmmm, I'm guessing this implies that new code should include comments. Sorry about that. Here's an updated patch. Hope this helps. pk. --- syslogd.c 2001/06/12 08:25:31 1.1 +++ syslogd.c 2001/07/06 22:01:36 @@ -712,6 +712,11 @@ ++p; if ((pri & LOG_FACMASK) == LOG_CONSOLE) flags |= IGN_CONS; + + /* don't fsync for IPFW messages. */ + if ((pri & LOG_FACMASK) == LOG_SECURITY) + flags &= ~SYNC_FILE; + } else { /* kernel printf's come out on console */ flags |= IGN_CONS; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message