[RFC] [PATCH] syslogd polling (v2)

From: Alan Jenkins <alan-jenkins_at_tuffmail.co.uk>
Date: Wed, 26 Sep 2007 15:34:16 +0100

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.

> [1] http://www.linuxpowertop.org

Received on Wed Sep 26 2007 - 16:34:16 CEST

This archive was generated by hypermail 2.2.0 : Wed Sep 26 2007 - 16:34:22 CEST