Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2009 21:30:40 +0400
From:      pluknet <pluknet@gmail.com>
To:        freebsd-stable <freebsd-stable@freebsd.org>
Subject:   Re: coretemp(4) lockups on 6-stable
Message-ID:  <a31046fc0906151030j1d8dc2fsa66a2691a3096204@mail.gmail.com>
In-Reply-To: <a31046fc0906150523h75273cacw53d20e055b2c3c0d@mail.gmail.com>
References:  <a31046fc0906150429k311e74f4paed3390488b7ebe2@mail.gmail.com> <a31046fc0906150523h75273cacw53d20e055b2c3c0d@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2009/6/15 pluknet <pluknet@gmail.com>:
> 2009/6/15 pluknet <pluknet@gmail.com>:
>> This is 6.4-stable from April.
>>
>> System locks up while in `sysctl dev.cpu` (with coretemp kldloaded).
>
> Small follow-up:
>
> Just one of my wild guesses is that coretemp doesn't play nice with ncpu > 4.
> A problem box is 8-way cpu. I always observe this lockup when
> sched_bind(curthread, cpu) called with cpu==4. While on another box
> `sysctl dev.cpu` works good and that box have only 4 cpu cores.
>

And yet another small one:
coretemp(4) works ok under 7.0+ on same h/w.

>>
>> So as far as I understand sched_bind() binds an executing thread to
>> nonexistent CPU 255.
>> Same behavior on coretemp built on 6.2.
>>
>> db> ps
>>  pid  ppid  pgrp   uid   state   wmesg     wchan    cmd
>> 34381 34380 34381     0  R+      CPU 255             sysctl
>> [...]
>> db> bt 34381
>> Tracing pid 34381 tid 100166 td 0xc8634680
>> sched_switch(c8634680,0,1) at sched_switch+0x143
>> mi_switch(1,0,c86347e0,4,c0a4e510,...) at mi_switch+0x1ba
>> sched_bind(c8634680,4,c856f3b0,0,c0836b3b,...) at sched_bind+0x52
>> coretemp_get_temp_sysctl(c8ef56c0,c908c200,0,eebebc04,c8ef56c0,...) at
>> coretemp_get_temp_sysctl+0x47
>> sysctl_root(0,eebebc74,4,eebebc04) at sysctl_root+0x107
>> userland_sysctl(c8634680,eebebc74,4,0,bfbfda8c,0,0,0,eebebc70,0) at
>> userland_sysctl+0x112
>> __sysctl(c8634680,eebebd04) at __sysctl+0x93
>> syscall(3b,3b,3b,4,bfbfda8c,...) at syscall+0x2bf
>> Xint0x80_syscall() at Xint0x80_syscall+0x1f
>> --- syscall (202, FreeBSD ELF32, __sysctl), eip = 0x2812407b, esp =
>> 0xbfbfd9fc, ebp = 0xbfbfda38 ---
>>
>> static int
>> coretemp_get_temp(device_t dev)
>> {
>>        uint64_t msr;
>>        int temp;
>>        int cpu = device_get_unit(dev);
>>        struct coretemp_softc *sc = device_get_softc(dev);
>>        char stemp[16];
>>
>>        mtx_lock_spin(&sched_lock);
>>        sched_bind(curthread, cpu);
>>         ^^^
>>        mtx_unlock_spin(&sched_lock);
>>
>>
>> --
>> wbr,
>> pluknet
>>
>
>
>
> --
> wbr,
> pluknet
>



-- 
wbr,
pluknet



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