Re: [RFC] [PATCH] syslogd polling (v2)

From: Martin Schulze <>
Date: Mon, 8 Oct 2007 17:25:49 +0200

Alan Jenkins wrote:
> On Wednesday 12 September 2007 16:34:28 you wrote:
> > === syslog vs powertop ===
> >
> > If I run powertop[1], syslogd's polling shows up (at a very low
> > level). I've already patched the most frequent pollers on my idle
> > system, so I started looking at the more simple of the minor offenders
> > - which I'm more likely to be able to understand than the complex GUI
> > offenders.
> >
> > I found that syslogd shows up because it has a constant 30s poll cycle
> > to log --MARK-- at longer intervals (minimum 1 minute) and to flush
> > duplicate messages ("last message repeated 2 times"). Ideally it
> > should be able to poll less frequently when there are no pending
> > duplicate messages. As I said, syslogd is a very minor offender; I
> > can get my (idle) system down to 5 wakeups/second and syslogd is
> > responsible for less than 0.1 of those, so it's difficult to argue
> > that this is anything more than a cosmetic issue. On the other hand,
> > syslogd runs on virtually all linux PCs - maybe it would make a
> > difference overall.
> >
> > I also noticed that due to some unusual indentation in domark(),
> > disabling --MARK-- with "-m0" has an undocumented feature. It appears
> > to stop pending duplicate messages from being flushed by the 30s
> > timeout, so that they will only get flushed when a new message is written.
> >
> > === my patch, using posix timers to help cope with non-monotonic
> > system time ===
> Since no-ones accepted the patch yet and I've recently discovered the return
> value of alarm(), heres a rather less intrusive patch which doesn't rely on
> posix timers. As before, I've tested both MARK and duplicate message
> flushing, and am now running the patched sysklogd on my own system. I'm
> assuming the return value of alarm() isn't affected by "date -s", although I
> haven't found that explicitly documented anywhere. Please let me know if
> theres anything I can do to make it more acceptable.

Cool stuff! I've adjusted indention in domark() and applied your
patch. Both available in CVS HEAD.

Thanks a lot!



The good thing about standards is that there are so many to choose from.
		-- Andrew S. Tanenbaum
Received on Mon Oct 08 2007 - 17:25:49 CEST

This archive was generated by hypermail 2.2.0 : Mon Oct 08 2007 - 17:27:09 CEST