Changeset 31d8e10 in mainline for kernel/generic/src/synch/waitq.c


Ignore:
Timestamp:
2007-04-05T16:09:49Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
547fa39
Parents:
879585a3
Message:

Continue to de-oversynchronize the kernel.

  • replace as→refcount with an atomic counter; accesses to this

reference counter are not to be done when the as→lock mutex is held;
this gets us rid of mutex_lock_active();

Remove the possibility of a deadlock between TLB shootdown and asidlock.

  • get rid of mutex_lock_active() on as→lock
  • when locking the asidlock spinlock, always do it conditionally and with

preemption disabled; in the unsuccessful case, enable interrupts and try again

  • there should be no deadlock between TLB shootdown and the as→lock mutexes
  • PLEASE REVIEW !!!

Add DEADLOCK_PROBE's to places where we have spinlock_trylock() loops.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/waitq.c

    r879585a3 r31d8e10  
    8787        waitq_t *wq;
    8888        bool do_wakeup = false;
     89        DEADLOCK_PROBE_INIT(p_wqlock);
    8990
    9091        spinlock_lock(&threads_lock);
     
    9798                if (!spinlock_trylock(&wq->lock)) {
    9899                        spinlock_unlock(&t->lock);
     100                        DEADLOCK_PROBE(p_wqlock, DEADLOCK_THRESHOLD);
    99101                        goto grab_locks;        /* avoid deadlock */
    100102                }
     
    129131        bool do_wakeup = false;
    130132        ipl_t ipl;
     133        DEADLOCK_PROBE_INIT(p_wqlock);
    131134
    132135        ipl = interrupts_disable();
     
    148151                if (!spinlock_trylock(&wq->lock)) {
    149152                        spinlock_unlock(&t->lock);
     153                        DEADLOCK_PROBE(p_wqlock, DEADLOCK_THRESHOLD);
    150154                        goto grab_locks;        /* avoid deadlock */
    151155                }
Note: See TracChangeset for help on using the changeset viewer.