Re: Event based scheduling and USB.

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Fri, 29 Oct 2010 23:44:13 +0300
Alexander Motin wrote:
> Takanori Watanabe wrote:
>> I updated my FreeBSD tree on laptop, to the current
>> as of 18 Oct.2010, it works fine with CPU C3 state enabled,
>>
>> I think this is your achievement of event time scheduler,
>> thanks!
>>
>> But when USB driver is enabled, the load average is considerablly 
>> high (0.6 to 1.0) if sysctl oid kern.eventtimer.periodic is set to 0.
>>  Then kern.eventtimer.periodic is set to 1, the load average goes
>> to 0 quickly as before, but almost never transit to C3.
>>
>> Is this behavior expected, or something wrong?
>> I noticed one of usb host controller device shares HPET irq.
>> When I implement interrupt filter in uhci driver, the load average
>> goes to 0 as before.
>>
>> ====
>> % vmstat -i
>> interrupt                          total       rate
>> irq1: atkbd0                         398          2
>> irq9: acpi0                          408          2
>> irq12: psm0                            3          0
>> irq19: ehci1                          37          0
>> irq20: hpet0 uhci0                 35970        230
>> irq22: ehci0                           2          0
>> irq256: em0                            4          0
>> irq257: ahci0                       1692         10
>> Total                              38514        246
>> ===
> 
> I haven't noticed that issue and it is surely not expected for me. I
> will try to reproduce it.

I've easily reproduced the problem. Scheduler tracing shows that problem
is the result of aliasing between "swi4: clock" thread on one CPU
(measuring load average) and "irq21: hpet0 uhci1" thread on another.
Those two events are aliased by definition due to shared interrupt
source. Not sure what to do with it. Either we should change algorithm
of load average calculation or exclude timer's interrupt threads from
load average accounting. Adding interrupt filter for USB also reasonably
helps, but it is only a partial solution for this specific sharing case.

-- 
Alexander Motin
Received on Fri Oct 29 2010 - 18:44:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:08 UTC