Date: Tue, 19 Jun 2012 00:08:16 +0200 From: Davide Italiano <davide.italiano@gmail.com> To: Attilio Rao <attilio@freebsd.org> Cc: svn-src-projects@freebsd.org, Alexander Motin <mav@freebsd.org>, src-committers@freebsd.org, Bruce Evans <brde@optusnet.com.au> Subject: Re: svn commit: r237202 - in projects/calloutng/sys: kern sys Message-ID: <CACYV=-E6zE8D_2X4VE-uGxuTBxJmouHmO1iSzA0EfGPi7WOmkg@mail.gmail.com> In-Reply-To: <CAJ-FndA%2BzK5seKuVhx%2BQsprK2NTP0yqrREbSG3Nk4Qa%2B%2Be9S3A@mail.gmail.com> References: <201206172045.q5HKjj92031635@svn.freebsd.org> <CAJ-FndA%2BzK5seKuVhx%2BQsprK2NTP0yqrREbSG3Nk4Qa%2B%2Be9S3A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 18, 2012 at 3:40 PM, Attilio Rao <attilio@freebsd.org> wrote: > 2012/6/17, Davide Italiano <davide@freebsd.org>: >> Author: davide >> Date: Sun Jun 17 20:45:45 2012 >> New Revision: 237202 >> URL: http://svn.freebsd.org/changeset/base/237202 >> >> Log: >> =A0 - Extend the condvar(9) KPI introducing a new cv_timedwait_bt_sig() >> =A0 function so that we can specify timeout precision in terms of struct >> =A0 bintime. >> >> =A0 - Now seltdwait() takes three argument rather than two so that their >> =A0 consumers can specify if the timeout should be passed as ticks or >> bintime. >> >> =A0 - Refactor the kern_select() and the sys_poll() code so that these t= wo >> =A0 services may rely on cv_timedwait_bt_sig() rather than on the previo= us >> less >> =A0 precise cv_timedwait_sig(). >> >> =A0 - Rethink the sleepqueue(9) KPI in order to make an attempt of avoid= ing >> =A0 both code duplication and breakages. Your mileage WILL vary, feel fr= ee to >> =A0 comment. > > I would still prefer the unified KPI, but at least the committed code > avoids code-duplication, I appreciate your effort here, thanks. > > Why you don't do the same thing for callout_ KPI? > > Attilio > > > -- > Peace can only be achieved by understanding - A. Einstein Attilio, here you can find a patch: http://people.freebsd.org/~davide/callout_refactorkpi.diff I'm not confident enough at this point to break all the callout_reset_on() stuffs, but at least I thought it's good to provide a variant of it named callout_reset_direct_on() that takes an additive parameter so that you can specifiy if you want to execute your callout directly from hw interrupt context or in SWI thread. I also patched the callout_reset_on() to always execute in SWI thread, as it has done until now. Note that this solution is a good compromise among breakages and code duplication avoidance, even though, as you pointed out makes the KPI more verbose. If you want to make a review, feel free. I've some doubt on the style of the macros I've added, to I cc'ed Bruce, I guess he's the best person to point me out what I'm doing wrong. Thanks for your time, Davide
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACYV=-E6zE8D_2X4VE-uGxuTBxJmouHmO1iSzA0EfGPi7WOmkg>