public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: George Anzinger <george@mvista.com>
To: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Mark Gross <mgross@linux.jf.intel.com>,
	Arjan van de Ven <arjanv@redhat.com>,
	high-res-timers-discourse@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [ANNOUNCE] high-res-timers patches for 2.6.6
Date: Tue, 22 Jun 2004 16:07:24 -0700	[thread overview]
Message-ID: <40D8BBAC.2070503@mvista.com> (raw)
In-Reply-To: <40D86E51.2080108@am.sony.com>

Geoff Levand wrote:
> George Anzinger wrote:
> 
>> Geoff Levand wrote:
>>
>>> Mark Gross wrote:
>>>
>>>> On Friday 11 June 2004 15:33, George Anzinger wrote:
>>>>
>>>>> I have been thinking of a major rewrite which would leave this code 
>>>>> alone,
>>>>> but would introduce an additional list and, of course, overhead for
>>>>> high-res timers. This will take some time and be sub optimal, so I 
>>>>> wonder
>>>>> if it is needed.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> What would your goal for the major rewrite be?
>>>> Redesign the implementation?
>>>> Clean up / re-factor the current design?
>>>> Add features?
>>>>
>>>> I've been wondering lately if a significant restructuring of the 
>>>> implementation could be done.  Something bottom's up that enabled 
>>>> changing / using different time bases without rebooting and 
>>>> coexisted nicely with HPET.
>>>>
>>>> Something along the lines of;
>>>> * abstracting the time base's, calibration and computation of the 
>>>> next interrupt time into a polymorphic interface along with the 
>>>> implementation of a few of your time bases (ACPI, TSC) as a stand 
>>>> allown patch.
>>>> * implement yet another polymorphic interface for the interrupt 
>>>> source used by the patch, along with a few interrupt sources (PIT, 
>>>> APIC, HPET <-- new )
>>>> * Implement a simple RTC-like charactor driver using the above for 
>>>> testing and integration.  * Finally a patch to integrate the first 3 
>>>> with the POSIX timers code.
>>>>
>>>> What do you think?
>>>>
>>>>
>>>> --mgross
>>>>
>>>
>>> Mark,
>>>
>>> Generally I agree with your ideas on what needs fixing up, but I'm 
>>> concerned that the run-time binding of this kind of design would have 
>>> too much overhead for time-critical code paths.  Do you think it is 
>>> useful to have run-time selection of the time base and interrupt 
>>> source?   In my work we have a known fixed hardware configuration 
>>> that has limited timers, so I don't really see a need for runtime 
>>> configuration there.
>>
>>
>>
>> Well, I don't see much added overhead, (save memory).  We already 
>> dispatch interrupts via indirect function calls in irq.c.  And the 
>> core clock functions (used by gettimeofday, for example) are also 
>> indirected today (this to allow pm-timer, TSC, or PIT at boot time).  
>> All we would do is put both of our possibilities in the list.  The 
>> only place we add overhead is in an indirect to the "proper" hardware 
>> timer for the sub-jiffie interrupt.
>>
> 
> If that's the case, then Mark's proposal sounds like a good way to 
> abstract the arch dependent code.  Someone mentioned to me that distro 
> vendors would like the idea of runtime configuration because they could 
> use a single kernel binary to support many different hardware 
> configurations.  I suppose if needed some optimization can be done later.
> 
> Mark, do you have time to do a first cut at the interfaces?  It seems 
> you've been thinking about this, and I'd like to see your ideas.  It 
> would be great if you could put together a sample hrtime.h.  If you are 
> short on time, I could put something together, but I think you are the 
> guy to do this.
> 
>  From what I've been told, Renesas did an HRT port to the SH arch on a 
> recent kernel.  I'm trying to get the code so that there will be three 
> arch's (i386, ppc32 & sh) to work against when doing the arch 
> independent interface.

MV has ported HRT to PPC, MIPS, and, I think, a couple of ARM processors.
> 
> Another thing that seems to be a sore point is the HRT core.  I think 
> there's a good consensus that the current use of preprocessor 
> conditionals makes the code pretty hairy, but what alternatives are there?
> 
> If the HRT code is always compiled in, that would simplify things alot, 
> but then there would always be a small performance hit in the compares, 
> and a slightly bigger code size.  Is this acceptable?  Also, something 
> would need to be arranged to take care of the non-supported arch's.  Any 
> ideas here?

I think the best thing is to include an include/asm/hrtime.h in each arch.  The 
file could be empty.  (I, at one time, suggested a modification of the build 
environment such that such a file could be put in the asm-generic/ directory and 
would be found if no such file was found in the archs asm/ directory, but, alas, 
the powers that be DID NOT LIKE THAT.)  In any case, this would allow the 
including file (include/hrtime.h) to determine that the arch was not supported 
(i.e. it did not define the required functions) and define dummys that would 
satisfy the externals and also prevent the registration of the HR clocks.

> 
> Another way would be to pull out the HRT operations into separate 
> functions that could be conditionally included or replaced with no-op 
> versions based on a config option.  I don't know if this would be 
> do-able, or if the result would be very clean though...

As it stands "most" timer and clock functions are dispatched through the 
k_clocks array.  We don't use different functions here at this time except for 
the monotonic clock_settime(), but, if we wanted to duplicate most of the code, 
this might be a way to go.  (Note, that the current code has a test for 
existence of the function address and uses a default if no such exists.  This 
was to avoid the indirect function call which, I think, is rather expensive.)
> 
> George also mentioned an idea of a second 'timer slave list'.   Any 
> other ideas here?

I am tempted to send a message to Linus on this issue.  The problem is that 
separating the two lists adds overhead and is just not the clean way to do it. 
The up side is that those who don't want HRT will see less impact on the normal 
timer code.

Oh, and by the way, I welcome all the help you can give on these issues.  Thanks.
-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml


  parent reply	other threads:[~2004-06-22 23:10 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-10  1:49 [ANNOUNCE] high-res-timers patches for 2.6.6 Geoff Levand
2004-06-10  2:40 ` William Lee Irwin III
2004-06-10  8:40   ` eric.piel
2004-06-10  9:08     ` William Lee Irwin III
2004-06-10 10:04 ` Arjan van de Ven
2004-06-11  0:02   ` George Anzinger
2004-06-11  6:22     ` Arjan van de Ven
2004-06-11 22:11       ` George Anzinger
2004-06-11 22:33       ` George Anzinger
2004-06-12 14:01         ` Arjan van de Ven
2004-06-14 15:28         ` Mark Gross
2004-06-14 20:48           ` George Anzinger
2004-06-14 22:20             ` Mark Gross
2004-06-15  0:21               ` George Anzinger
2004-06-15 16:04                 ` Mark Gross
2004-06-16 22:33                   ` George Anzinger
2004-06-17 19:35                     ` Mark Gross
2004-06-21 22:50           ` Geoff Levand
2004-06-21 23:17             ` George Anzinger
2004-06-22 17:37               ` Geoff Levand
2004-06-22 18:05                 ` Stephen Hemminger
2004-06-22 23:07                 ` George Anzinger [this message]
2004-06-23  0:15                   ` Geoff Levand
     [not found]                   ` <40D8CF88.4050608@am.sony.com>
2004-09-03  1:35                     ` [ANNOUNCE] high-res-timers patch Geoff Levand
2004-11-04 20:41                     ` Geoff Levand
2004-06-23 16:23                 ` [ANNOUNCE] high-res-timers patches for 2.6.6 Mark Gross
2004-06-21 23:29             ` Mark Gross
2004-06-12  0:24 ` Karim Yaghmour
2004-06-14 20:57   ` George Anzinger
2004-06-21  3:14     ` Karim Yaghmour
2004-06-21 21:33       ` George Anzinger
2004-06-22  4:50         ` Karim Yaghmour
2004-06-21 23:13 ` Stephen Hemminger
2004-06-21 23:22   ` Randy.Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2004-06-10 12:46 Dave Hylands

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40D8BBAC.2070503@mvista.com \
    --to=george@mvista.com \
    --cc=arjanv@redhat.com \
    --cc=geoffrey.levand@am.sony.com \
    --cc=high-res-timers-discourse@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.jf.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox