From mboxrd@z Thu Jan 1 00:00:00 1970 From: Evgeniy Polyakov Subject: Re: [take25 1/6] kevent: Description. Date: Fri, 24 Nov 2006 15:13:12 +0300 Message-ID: <20061124121312.GD32545@2ka.mipt.ru> References: <11641265982190@2ka.mipt.ru> <456621AC.7000009@redhat.com> <20061124120531.GC32545@2ka.mipt.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Cc: David Miller , Andrew Morton , netdev , Zach Brown , Christoph Hellwig , Chase Venters , Johann Borck , linux-kernel@vger.kernel.org, Jeff Garzik Return-path: Received: from relay.2ka.mipt.ru ([194.85.82.65]:5316 "EHLO 2ka.mipt.ru") by vger.kernel.org with ESMTP id S934378AbWKXMOC (ORCPT ); Fri, 24 Nov 2006 07:14:02 -0500 To: Ulrich Drepper Content-Disposition: inline In-Reply-To: <20061124120531.GC32545@2ka.mipt.ru> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Fri, Nov 24, 2006 at 03:05:31PM +0300, Evgeniy Polyakov (johnpol@2ka.mipt.ru) wrote: > On Thu, Nov 23, 2006 at 02:33:16PM -0800, Ulrich Drepper (drepper@redhat.com) wrote: > > Evgeniy Polyakov wrote: > > >+ int kevent_commit(int ctl_fd, unsigned int start, > > >+ unsigned int num, unsigned int over); > > > > I think we can simplify this interface: > > > > int kevent_commit(int ctl_fd, unsigned int new_tail, > > unsigned int over); > > > > The kernel sets the ring_uidx value to the 'new_tail' value if the tail > > pointer would be incremented (module wrap around) and is not higher then > > the current front pointer. The test will be a bit complicated but not > > more so than what the current code has to do to check for mistakes. > > > > This approach has the advantage that the commit calls don't have to be > > synchronized. If one thread sets the tail pointer to, say, 10 and > > another to 12, then it does not matter whether the first thread is > > delayed. If it will eventually be executed the result is simply a no-op > > and since second thread's action supersedes it. > > > > Maybe the current form is even impossible to use with explicit locking > > at userlevel. What if one thread, which is about to call kevent_commit, > > if indefinitely delayed. Then this commit request's value is never > > taken into account and the tail pointer is always short of what it > > should be. > > I like this interface, although current one does not allow special ...does not require... > synchronization in userspace, since it calculates if new commit is in > the area where previous commit was. > Will change for the next release. -- Evgeniy Polyakov