Changeset 31d8e10 in mainline for kernel/generic/include/synch/mutex.h


Ignore:
Timestamp:
2007-04-05T16:09:49Z (17 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/include/synch/mutex.h

    r879585a3 r31d8e10  
    4545
    4646#define mutex_lock(mtx) \
    47         _mutex_lock_timeout((mtx),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE)
     47        _mutex_lock_timeout((mtx), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE)
    4848#define mutex_trylock(mtx) \
    49         _mutex_lock_timeout((mtx),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NON_BLOCKING)
    50 #define mutex_lock_timeout(mtx,usec) \
    51         _mutex_lock_timeout((mtx),(usec),SYNCH_FLAGS_NON_BLOCKING)
    52 #define mutex_lock_active(mtx) \
    53         while (mutex_trylock((mtx)) != ESYNCH_OK_ATOMIC)
     49        _mutex_lock_timeout((mtx), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NON_BLOCKING)
     50#define mutex_lock_timeout(mtx, usec) \
     51        _mutex_lock_timeout((mtx), (usec), SYNCH_FLAGS_NON_BLOCKING)
    5452
    5553extern void mutex_initialize(mutex_t *mtx);
Note: See TracChangeset for help on using the changeset viewer.