#2350 closed enhancement (fixed)

One watchdog ticks header per scheduler instance

Reported by: Sebastian Huber Owned by:
Priority: normal Milestone: 5.1
Component: score Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Currently there is one watchdog header for all ticks based watchdogs. This is not scalable. For example on the Freescale T4240 platform with 24-processors we observe in the smptests/smpwakeafter01 test a maximum thread dispatch disabled time of 3.8ms on processor 0 and 1.7ms on the other processors.

<PerCPUProfilingReport processorIndex="0">
  <MaxThreadDispatchDisabledTime unit="ns">3807457</MaxThreadDispatchDisabledTime>
  <MeanThreadDispatchDisabledTime unit="ns">124091</MeanThreadDispatchDisabledTime>
  <TotalThreadDispatchDisabledTime unit="ns">1706880473</TotalThreadDispatchDisabledTime>
  <ThreadDispatchDisabledCount>13755</ThreadDispatchDisabledCount>
  <MaxInterruptDelay unit="ns">0</MaxInterruptDelay>
  <MaxInterruptTime unit="ns">24661</MaxInterruptTime>
  <MeanInterruptTime unit="ns">10148</MeanInterruptTime>
  <TotalInterruptTime unit="ns">127682501</TotalInterruptTime>
  <InterruptCount>12582</InterruptCount>
</PerCPUProfilingReport>
<PerCPUProfilingReport processorIndex="1">
  <MaxThreadDispatchDisabledTime unit="ns">1715826</MaxThreadDispatchDisabledTime>
  <MeanThreadDispatchDisabledTime unit="ns">102805</MeanThreadDispatchDisabledTime>
  <TotalThreadDispatchDisabledTime unit="ns">1884937615</TotalThreadDispatchDisabledTime>
  <ThreadDispatchDisabledCount>18335</ThreadDispatchDisabledCount>
  <MaxInterruptDelay unit="ns">0</MaxInterruptDelay>
  <MaxInterruptTime unit="ns">47</MaxInterruptTime>
  <MeanInterruptTime unit="ns">12</MeanInterruptTime>
  <TotalInterruptTime unit="ns">8299</TotalInterruptTime>
  <InterruptCount>664</InterruptCount>
</PerCPUProfilingReport>
<SMPLockProfilingReport name="Watchdog">
  <MaxAcquireTime unit="ns">47020</MaxAcquireTime>
  <MaxSectionTime unit="ns">2709</MaxSectionTime>
  <MeanAcquireTime unit="ns">31</MeanAcquireTime>
  <MeanSectionTime unit="ns">52</MeanSectionTime>
  <TotalAcquireTime unit="ns">990203330</TotalAcquireTime>
  <TotalSectionTime unit="ns">1674926849</TotalSectionTime>
  <UsageCount>31604848</UsageCount>
  <ContentionCount initialQueueLength="0">10574</ContentionCount>
  <ContentionCount initialQueueLength="1">8168</ContentionCount>
  <ContentionCount initialQueueLength="2">8578</ContentionCount>
  <ContentionCount initialQueueLength="3">31577528</ContentionCount>
</SMPLockProfilingReport>

The watchdog lock is highly contended and since the watchdog insert procedure acquires and releases the lock during the iteration of the watchdog chain several times, this yields the high thread dispatch disabled times.

To get rid of this bottleneck we should move the watchdog context into the scheduler context to use one watchdog context per scheduler instance. Take care that active watchdogs move in case of a scheduler change of a thread.

Change History (5)

comment:1 Changed on 08/14/17 at 00:08:57 by Chris Johns

Milestone: 5.0Indefinite
Version: 4.11

comment:2 Changed on 08/21/17 at 05:26:59 by Sebastian Huber

Milestone: Indefinite4.12.0
Resolution: fixed
Status: newclosed

There is now one watchdog header per processor.

comment:3 Changed on 10/10/17 at 06:27:10 by Sebastian Huber

Component: SMPscore

comment:4 Changed on 10/10/17 at 06:29:01 by Sebastian Huber

Component: scorecpukit

comment:5 Changed on 11/09/17 at 06:27:14 by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.