kern/156423: Please add kqueue support for /dev/klog

Balazs Scheidler bazsi at
Fri Apr 15 14:20:04 UTC 2011

>Number:         156423
>Category:       kern
>Synopsis:       Please add kqueue support for /dev/klog
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 15 14:20:03 UTC 2011
>Originator:     Balazs Scheidler
>Release:        8.1-RELEASE
BalaBit IT Ltd.
FreeBSD fbsd81.balabit 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010     root at  amd64

The multi-threaded version of syslog-ng (an alternative to syslogd) would try to use the kqueue mechanism to drive its main loop for maximum performance. 

However /dev/klog currently doesn't support kqueue().

There's a patch by DragonflyBSD, which seems to implement it (however I don't know FreeBSD kernel code that much):

The kqueue() support is implemented through a wrapper library called libivykis ( This library makes it possible to enable or disable polling mechanisms at runtime using an environment variable.

For now, I'll simply disable kqueue() support, and revert to using plain poll(), since with the current syslog-ng architecture it's either an all-or-nothing decision. (e.g. either everything goes with kqueue() or nothing) 

I'm sure sockets would work nicely and users may come up with alternatives (like running two instances of syslog-ng, one for /dev/klog the other for the rest), but it's a big hassle.

So if it's not a big issue, please try to support it in one of the upcoming FreeBSD versions, so I can reenable kqueue() support.





More information about the freebsd-bugs mailing list