NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/38707: scheduler related deadlock during build.sh



The following reply was made to PR kern/38707; it has been noted by GNATS.

From: Andrew Doran <ad%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/38707: scheduler related deadlock during build.sh
Date: Tue, 20 May 2008 18:42:36 +0100

 Retrying with this patch:
 
 Index: kern_runq.c
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/kern_runq.c,v
 retrieving revision 1.5
 diff -u -r1.5 kern_runq.c
 --- kern_runq.c        19 May 2008 17:06:02 -0000      1.5
 +++ kern_runq.c        20 May 2008 17:41:48 -0000
 @@ -417,33 +417,11 @@
        runqueue_t *ci_rq;
        struct lwp *l;
  
 -      if (curci == ci)
 +      if (curci == ci || !mutex_tryenter(ci->ci_schedstate.spc_mutex))
                return NULL;
  
 -      /* Lockless check */
        spc = &ci->ci_schedstate;
        ci_rq = spc->spc_sched_info;
 -      if (ci_rq->r_mcount < min_catch)
 -              return NULL;
 -
 -      /*
 -       * Double-lock the runqueues.
 -       */
 -      if (curci < ci) {
 -              spc_lock(ci);
 -      } else if (!mutex_tryenter(ci->ci_schedstate.spc_mutex)) {
 -              const runqueue_t *cur_rq = curci->ci_schedstate.spc_sched_info;
 -
 -              spc_unlock(curci);
 -              spc_lock(ci);
 -              spc_lock(curci);
 -
 -              if (cur_rq->r_count) {
 -                      spc_unlock(ci);
 -                      return NULL;
 -              }
 -      }
 -
        if (ci_rq->r_mcount < min_catch) {
                spc_unlock(ci);
                return NULL;
 @@ -599,8 +577,6 @@
                /* Reset the counter, and call the balancer */
                ci_rq->r_avgcount = 0;
                sched_balance(ci);
 -
 -              /* The re-locking will be done inside */
                return sched_catchlwp();
        }
  #else
 


Home | Main Index | Thread Index | Old Index