From owner-svn-src-projects@FreeBSD.ORG Mon Jun 18 22:08:18 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 186801065670; Mon, 18 Jun 2012 22:08:18 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8287A8FC18; Mon, 18 Jun 2012 22:08:17 +0000 (UTC) Received: by vbmv11 with SMTP id v11so3814715vbm.13 for ; Mon, 18 Jun 2012 15:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=9IQYqCsNTauF7eaOxsseC95ZtnNxUxYGGYFTepUfFqM=; b=YNmHB+jDqP4JL9o1jYlogLYH84aYX49BQH5zyM7guZKhZOG+62lNf6rYnzNyuSnF9a LbVDu1b6OphPARCc1rgA8x9k/NXaJC8c/KGIW4ShZRoDM+9uYI766+/g5/um6ydFg6En PKPRQ9CFnr/LOA8XtVNoX+9Qgp5TYPDCT9tlsjISq6fFqqCCcGCwx/D2i0/7quqII/HL 9o1XkAqi+JPbUOs8bpPhwWBccXa/6mLGx4zWuuLB/dw/Ww5RY9no/3efp1wylDYJ6oc2 AQ/VxNhMOZxga4h90EY2Dvwe5Ruw8S0a1PX26JQnHSsRklcn7rQ8fGWDWGRDEXq9ZQ8k rsqQ== MIME-Version: 1.0 Received: by 10.220.215.136 with SMTP id he8mr8619458vcb.13.1340057296772; Mon, 18 Jun 2012 15:08:16 -0700 (PDT) Received: by 10.52.28.132 with HTTP; Mon, 18 Jun 2012 15:08:16 -0700 (PDT) In-Reply-To: References: <201206172045.q5HKjj92031635@svn.freebsd.org> Date: Tue, 19 Jun 2012 00:08:16 +0200 Message-ID: From: Davide Italiano To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-projects@freebsd.org, Alexander Motin , src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r237202 - in projects/calloutng/sys: kern sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 22:08:18 -0000 On Mon, Jun 18, 2012 at 3:40 PM, Attilio Rao wrote: > 2012/6/17, Davide Italiano : >> 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