PCR 1868 (A-1868) - Add TLB performance gathering to kernel
Summary: Add TLB performance gathering to kernel
Status: NEW
Alias: A-1868
Product: Kernel
Classification: Deos
Component: Kernel (show other PCRs)
Version: mainline
Hardware: TBD Deos
: Hold
: Enhancement
Target Milestone: mainline
Assignee: .Kernel
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2004-11-17 00:00 MST by mdiethelm
Modified: 2023-08-14 11:47 MST (History)
1 user (show)

See Also:
Impact Assessment: ---
Organization: ---
alarson: Requirements?
alarson: Code?
alarson: TestCases?
alarson: TestProcedures?
alarson: Other?


Attachments

Note You need to log in before you can comment on or make changes to this PCR.
Description alarson 2005-09-22 17:05:43 MST
Generally we want instrumentation to determine the dynamic state of the system.
Here are some suggestions:

Add instrumentation counters:
  - TLB misses       (aggregate and per thread/process?)
  - context switches (aggregate and per thread)
  - floating pt saves(aggregate and per thread)
  - event dispatches (aggregate, per event is already there)
  - mutex locks      (aggregate and per mutex, contention vs success)
  - semaphore        like mutex.
  - interrupts       (aggregate and per Deos defined interrupt)

More event logs:
  when a thread is restarted.
  wait event, pulse event
  lock and unlock mutex
  signal and wait semaphore
The returns from waits or locks can be inferred.

A more through look at the API is in order to see if there are more needed.  The
above are generally useful, and likely won't affect performance significantly
(although TLB would have to be done carefully).

from email:

> -----Original Message-----
> From: Larson, Aaron (MN65) 
> 
> Yea, that's the objective.  You know that all the TLB misses 
> (sans interrupts) between context switches belong to the 
> current thread, so you could sweep the delta into a thread 
> specific counter at ctx times for a minimal cost.  You could 
> even zero the value at ctx time to make it easier.
> 
> I wouldn't be averse to making this sort of code be #ifdef'd 
> if it got expensive, but having some sort of dynamic behavior 
> monitor is critical for tuning, and we don't provide it.
> 
> -----Original Message-----
> From: Roffelsen, Ryan (AZ75) 
> Sent: Wednesday, November 17, 2004 4:40 PM
> To: Larson, Aaron (MN65); Diethelm, Matthew
> Cc: Johnson, G Craig; Cronk, Bill (AZ15)
> Subject: RE: Cost of TLB Miss
> 
> 
> I'm just not sure what value the total number of TLB misses 
> has.  I would think if you could find out the total number of 
> TLB misses on a per process bases it might be more useful. I 
> started to think about this then my head started hurting so I stopped.
> 
> -Ryan 
> 
> > -----Original Message-----
> > From: Larson, Aaron (MN65) 
> > Sent: Wednesday, November 17, 2004 3:36 PM
> > To: Roffelsen, Ryan (AZ75); Diethelm, Matthew
> > Cc: Johnson, G Craig; Cronk, Bill (AZ15)
> > Subject: RE: Cost of TLB Miss
> > 
> > 
> > Note change of recipients.
> > 
> > I was thinking we could increment a 32 bit number stored in 
> > the code immediately following the rfi.  It would (of 
> > necessity) be a cache hit so the extra 3 instructions would 
> > probably cost almost nothing.  I think the 750 has 
> > performance counters for this sort of thing, but I haven't looked.
> > 
> > -----Original Message-----
> > From: Roffelsen, Ryan (AZ75) 
> > Sent: Wednesday, November 17, 2004 4:31 PM
> > To: Diethelm, Matthew; McElroy, James J
> > Cc: Gremmert, Scott; Larson, Aaron (MN65); Johnson, G Craig; 
> > Cronk, Bill (AZ15)
> > Subject: RE: Cost of TLB Miss
> > 
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Diethelm, Matthew 
> > > Sent: Wednesday, November 17, 2004 1:39 PM
> > > To: McElroy, James J
> > > Cc: Gremmert, Scott; Larson, Aaron (MN65); Roffelsen, Ryan (AZ75);
> > > Johnson, G Craig; Cronk, Bill (AZ15)
> > > Subject: RE: Cost of TLB Miss
> > > 
> > ...
> > > 
> > > MD: Awesomely good question.  Alas, I'm not equipped mentally 
> > > to answer. :-)  I'm including our other two kernel 
> > > maintainers, Ryan and Aaron, in this conversation as I 
> > > believe they've recently been dealing with TLBs and cache 
> > > lines as part of the upcoming Agave kernel certification.  
> > > One of them can likely yield some information here.
> > 
> > We have no mechanism for measuring TLB miss times.  I'm 
> > guessing any thing we put it to try and measure the TLB miss 
> > time would probably double the time it take to handle a TLB 
> > miss.  What I can do is give you information about the code 
> > so you can estimate it's execution time.
> > The current version of the TLB miss handlers (there are 3, 
> > data write miss, data read miss, code read miss) have:
> > 17 instructions each (two possible cache misses to execute 
> > the code, probably not likely)
> > access two different RAM pages to read (two more possible 
> > cache misses, these are likely)
> > A couple of branches that won't be taken unless it is a real 
> > exception.
> > 
> > Here is the source of one of the TLB miss handlers:
> >     mfsr    r2, sr0
> >     mfspr   r3, dmiss
> >     rlwinm  r2, r2, 8, 0, 19
> >     mfcr    r1
> >     rlwimi  r2, r3, 32-20, 20, 29
> >     lwz     r2, 0(r2)
> >     andi.   r0, r2, PTElo_Pbit
> >     beq     synthesizeDSIonStore
> >     rlwinm  r2, r2,     0,  0, 19
> >     rlwimi  r2, r3, 32-10, 20, 29
> >     lwz     r2, 0(r2)
> >     andi.   r0, r2, PTElo_Pbit
> >     beq     synthesizeDSIonStore
> >     mtspr   rpa, r2
> >     tlbld   r3
> >     mtcr    r1
> >     rfi
> > 
> > 
> > > 
> > > MD: I'm worried that such a statistic couldn't be retrieved 
> > > without a specially instrumented kernel and or PAL.  I'll 
> > > once again leave it up to Ryan or Aaron to confirm or deny.
> > >
> > 
> > As you can see by the code above we do not have any way to 
> > count the number of TLB misses. 
> > 
>


TRACK Comments:

03/10/2005 12:12:28 - mattd - SAS classification Enhancement
11/17/2004 16:12:54 - mattd - No current customer funding stalls progress on
this feature


PCR moved from Track to bugzilla by Aaron.Larson@Honeywell.com 2005-09-22 17:05
Comment 1 sb 2006-05-04 12:11:32 MST
Update Target Milestone per 3/2006 Deos ADIRU Final EASA audit.
Comment 2 deosbugs.ccb 2010-02-03 15:22:22 MST
CCB visited this PCR on 2010-02-03
Comment 3 deosbugs.ccb 2010-02-25 13:36:02 MST
CCB visited this PCR on 2010-02-25.
Comment 4 deosbugs.ccb 2010-03-31 12:12:02 MST
CCB 2 visited this PCR on  2010-03-31
Comment 5 deosbugs.ccb 2010-05-11 15:05:17 MST
CCB visited this PCR on 2010-05-11
Comment 6 deosbugs.ccb 2010-09-30 14:51:15 MST
CCB 2 visited this PCR on 2010-09-30.
Comment 7 deosbugs.ccb 2010-12-17 10:17:11 MST
CCB visited this PCR on 2010-12-17.
Comment 8 deosbugs.ccb 2011-03-07 17:38:51 MST
CCB visited this PCR on 2011-03-07
Comment 9 deosbugs.ccb 2011-04-11 14:37:24 MST
CCB visited this PCR on 2011-04-11
Comment 10 deosbugs.ccb 2011-05-16 15:20:00 MST
CCB2 visited this PCR on 2011-05-16
Comment 11 deosbugs.ccb 2011-08-17 15:10:21 MST
CCB visited this PCR on 2011-08-17
Comment 12 deosbugs.ccb 2011-11-04 15:52:09 MST
CCB 2 visited this PCR on 2011-11-04
Comment 13 deosbugs.ccb 2012-01-31 13:45:08 MST
CCB visited this PCR on 2012-01-31
Comment 14 deosbugs.ccb 2012-05-15 08:39:59 MST
CCB visited this PCR on 2012-05-15
Comment 15 deosbugs.ccb 2012-06-08 13:16:23 MST
CCB 2 visited this PCR on 2012-06-08
Comment 16 deosbugs.ccb 2012-08-24 09:16:52 MST
CCB visited this PCR on 2012-08-24
Comment 17 deosbugs.ccb 2012-09-07 10:38:11 MST
CCB visited this PCR on 2012-09-07
Comment 18 rroffelsen 2012-09-17 16:00:03 MST
CCB visited this PCR on 2012-09-17
Comment 19 deosbugs.ccb 2012-11-19 12:19:20 MST
CCB visited this PCR on 2012-11-19
Comment 20 deosbugs.ccb 2012-11-26 17:45:34 MST
CCB visited this PCR on 2012-11-26
Comment 21 deosbugs.ccb 2013-02-12 21:17:14 MST
CCB visited this PCR on 2013-02-12
Comment 22 deosbugs.ccb 2013-03-18 14:35:03 MST
CCB visited this PCR on 2013-03-18
Comment 23 deosbugs.ccb 2013-05-15 10:11:53 MST
CCB visited this PCR on 2013-05-15
Comment 24 deosbugs.ccb 2013-07-19 11:25:43 MST
CCB visited this PCR on 2013-07-19
Comment 25 deosbugs.ccb 2013-11-15 17:39:58 MST
CCB visited this PCR on 2013-11-15
Comment 26 deosbugs.ccb 2014-05-20 10:13:52 MST
CCB 2 visited this PCR on 2014-05-20
Comment 27 deosbugs.ccb 2014-07-14 15:11:35 MST
CCB visited this PCR on 2014-07-14
Comment 28 deosbugs.ccb 2014-11-11 13:16:32 MST
CCB 2 visited this PCR on 2014-11-11
Comment 29 deosbugs.ccb 2014-11-17 08:57:41 MST
CCB visited this PCR on 2014-11-17
Comment 30 deosbugs.ccb 2016-04-18 12:56:16 MST
CCB visited this PCR on 2016-04-18
Comment 31 deosbugs.ccb 2016-06-20 13:09:09 MST
CCB visited this PCR on 2016-06-20
Comment 32 deosbugs.ccb 2017-02-01 09:38:26 MST
CCB visited this PCR on 2017-02-01-59501
Comment 33 deosbugs.ccb 2017-06-28 13:01:33 MST
CCB visited this PCR on 2017-06-28-69227
Comment 34 deosbugs.ccb 2017-07-06 11:07:30 MST
CCB visited this PCR on 2017-07-06-58325
Comment 35 deosbugs.ccb 2021-03-26 09:37:02 MST
CCB visited this PCR on 2021-03-26-57787
Comment 36 deosbugs.ccb 2021-04-05 09:54:04 MST
CCB visited this PCR on 2021-04-05-59141
Comment 37 deosbugs.ccb 2023-08-14 11:06:37 MST
CCB visited this PCR on 2023-08-14-64795
Comment 38 deosbugs.ccb 2023-08-14 11:47:22 MST
PCR to remain on HOLD for kismet.