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/include/synch/spinlock.h

    r879585a3 r31d8e10  
    102102}
    103103
     104#ifdef CONFIG_DEBUG_SPINLOCK
     105
     106extern int printf(const char *, ...);
     107
     108#define DEADLOCK_THRESHOLD              100000000
     109#define DEADLOCK_PROBE_INIT(pname)      count_t pname = 0
     110#define DEADLOCK_PROBE(pname, value)                                    \
     111        if ((pname)++ > (value)) {                                      \
     112                (pname) = 0;                                            \
     113                printf("Deadlock probe %s: exceeded threshold %d\n",    \
     114                    "cpu%d: function=%s, line=%d\n",                    \
     115                    #pname, (value), CPU->id, __FUNCTION__, __LINE__);  \
     116        }
     117#else
     118#define DEADLOCK_PROBE_INIT(pname)
     119#define DEADLOCK_PROBE(pname, value)
     120#endif
     121
    104122#else
    105123
     
    114132#define spinlock_unlock(x)              preemption_enable()
    115133
     134#define DEADLOCK_PROBE_INIT(pname)
     135#define DEADLOCK_PROBE(pname, value)
     136
    116137#endif
    117138
Note: See TracChangeset for help on using the changeset viewer.