Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Dec 2012 23:03:53 +0200
From:      Alexander Motin <mav@FreeBSD.org>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        Davide Italiano <davide@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: API explosion (Re: [RFC/RFT] calloutng)
Message-ID:  <50CF88B9.6040004@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50CF88B9.6040004>