Deadlocks with recent SMP current
Jon Noack
noackjr at alumni.rice.edu
Mon Aug 16 22:15:03 PDT 2004
On 08/15/04 00:44, Julian Elischer wrote:
> Jon Noack wrote:
>> On 08/13/04 15:13, Scott Long wrote:
>>> Can you try the patch below? It's really only a band-aid, but might
>>> make things usable for now. Also, are more lockups being seen under
>>> ULE or under 4BSD. There was a recent change to ULE (rev 1.120 of
>>> sched_ule.c) that seems to have aggrivated the scheduler problems on
>>> my test systems.
>>>
>>> Scott
>>>
>>> Index: kern_switch.c
>>> ===================================================================
>>> RCS file: /usr/ncvs/src/sys/kern/kern_switch.c,v
>>> retrieving revision 1.78
>>> diff -u -r1.78 kern_switch.c
>>> --- kern_switch.c 10 Aug 2004 00:26:25 -0000 1.78
>>> +++ kern_switch.c 13 Aug 2004 20:11:27 -0000
>>> @@ -345,6 +345,8 @@
>>> return;
>>> }
>>>
>>> + critical_enter();
>>> +
>>> tda = kg->kg_last_assigned;
>>> if ((ke = td->td_kse) == NULL) {
>>> if (kg->kg_idle_kses) {
>>> @@ -441,6 +443,7 @@
>>> CTR3(KTR_RUNQ, "setrunqueue: held: td%p kg%p pid%d",
>>> td, td->td_ksegrp, td->td_proc->p_pid);
>>> }
>>> + critical_exit();
>>> }
>>>
>>> /*
>>
>> Here's a data point:
>> My dual Pentium3 system has been up for 20+ hours with this patch.
>> Previously, it wouldn't survive for more than an hour or so
>> (regardless of load).
>
> try the following change instead:
> in maybe_preempt() in kern_switch.c
>
> ctd = curthread;
> + if ((ctd->td_kse == NULL) || (ctd->td_kse->ke_thread != ctd))
> + return (0);
> pri = td->td_priority;
With the previous patch I still had difficulties getting through a
buildworld in multi-user (while running apache, postfix+amavisd-new,
nfs, etc.). With this patch I have not run into any issues (make -j4
buildworlds are stable on my dual p3 even after uncommenting
-DUSE_KQUEUE and rebuilding make). If the last patch was a bandaid,
this is one of those new-fangled "sport" bandaids that are water- and
sweat-resistent... ;-)
Jon
More information about the freebsd-current
mailing list