Date: Tue, 30 Aug 2011 07:44:12 +0200 From: Luigi Rizzo <rizzo@iet.unipi.it> To: John Baldwin <jhb@freebsd.org>, freebsd-current@freebsd.org Subject: Re: kqueue and device driver experience anyone ? Message-ID: <20110830054412.GA43880@onelab2.iet.unipi.it> In-Reply-To: <20110830002315.GD3098@funkthat.com> References: <20110826153940.GA3800@onelab2.iet.unipi.it> <201108261313.03441.jhb@freebsd.org> <20110826210101.GA5822@onelab2.iet.unipi.it> <20110830002315.GD3098@funkthat.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 29, 2011 at 05:23:15PM -0700, John-Mark Gurney wrote: > Luigi Rizzo wrote this message on Fri, Aug 26, 2011 at 23:01 +0200: > > The other thing i need (but i believe i know how to handle it) > > is tell whether .f_event() is called by KNOTE() or by kqueue_scan(), > > but i believe i can use the "hint" argument to tell the two. > > Why do you need to know the difference? kqueue is a level triggered because i want to control what gets executed in the lower and upper half of the kernel, for two reasons: - livelock/interrupt mitigation control. I want the bottom half to be as lightweight as possible so that the system does not get overwhelmed by incoming interrupts. - reduced locking overhead. If the bottom half only notifies that 'something happened', it does not need to bother locking device specific data structures. For things like netmap this is especially useful because some data structures are shared between kernel and userland and the only way to protect access is make sure that the kernel only plays with them when it is in the upper half. cheers luigi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110830054412.GA43880>