From owner-freebsd-arch@FreeBSD.ORG Mon Dec 17 21:03:59 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33FA49C2; Mon, 17 Dec 2012 21:03:59 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3B88FC12; Mon, 17 Dec 2012 21:03:58 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so3022735wey.13 for ; Mon, 17 Dec 2012 13:03:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=BSdFSZV7b+8Je0QAPEO+KvvoTC+MZ3f0TujYVgfjsJE=; b=iARPxZ6cMYac1CYvTjyUBzHk7GuXZnuNTdrCBK/1tCTohajTh5+oLIIX9k1I1LkOFR zjmYDn5gXX4U6RgQc/c7onTnOIeuY6OWBCg08Gy++1cSsvo4nMm6UiQiw59sKJdMWwJ7 0vCy8anjZ3NbXOSwAofkuTQEQX+rMAWPlaAFY9qDcETCypYCQ+PJpngIbR88OvFTehCA k/bm9LnthNCDIqdVgDjJkAsPdVBt4puaHc/DUMgcZ5WlSjNjfdKbrWxWCGWrvNITKFjX WY3SRiQh3XI7iHINYdFAZAfLR2kLaJHuuzJrvHFpahtphost9CnYIc6c5h/lupOr2VAV Avrw== Received: by 10.180.87.102 with SMTP id w6mr17883446wiz.19.1355778236465; Mon, 17 Dec 2012 13:03:56 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id i6sm12853292wix.5.2012.12.17.13.03.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Dec 2012 13:03:55 -0800 (PST) Sender: Alexander Motin Message-ID: <50CF88B9.6040004@FreeBSD.org> Date: Mon, 17 Dec 2012 23:03:53 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: Luigi Rizzo Subject: Re: API explosion (Re: [RFC/RFT] calloutng) Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Davide Italiano , freebsd-current , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2012 21:03:59 -0000 Hi. > I would instead do the following: I also don't very like the wide API and want to hear fresh ideas, but approaches to time measurement there are too different to do what you are proposing. Main problem is that while ticks value is relative, bintime is absolute. It is not easy to make conversion between them fast and precise. I've managed to do it, but the only function that does it now is _callout_reset_on(). All other functions are just passing values down. I am not sure I want to duplicate that code in each place, though doing it at least for for callout may be a good idea. Creating sets of three functions I had three different goals: - callout_reset() -- it is legacy variant required to keep API compatibility; - callout_reset_flags() -- it is for cases where custom precision specification needs to be added to the existing code, or where direct callout execution is needed. Conversion to bintime would additionally complicate consumer code, that I would try to avoid. - callout_reset_bt() -- API for the new code, which needs high precision and doesn't mind to operate bintime. Now there is only three such places in kernel now, and I don't think there will be much more. Respectively, these three options are replicated to other APIs where time intervals are used. PS: Please keep me in CC. -- Alexander Motin