Some more progress with debugging pager exits

This commit is contained in:
Bahadir Balban
2009-10-30 18:28:45 +02:00
parent 18ffa0b4d1
commit ee7621b2df
9 changed files with 50 additions and 23 deletions

View File

@@ -117,6 +117,7 @@ int mutex_lock(struct mutex *mutex)
* undeterministic as to how many retries will result in success.
* We may need to add priority-based locking.
*/
printk("Thread (%d) locking (%p) nlocks: %d\n", current->tid, mutex, current->nlocks);
for (;;) {
spin_lock(&mutex->wqh.slock);
if (!__mutex_lock(&mutex->lock)) { /* Could not lock, sleep. */
@@ -131,6 +132,7 @@ int mutex_lock(struct mutex *mutex)
/* Did we wake up normally or get interrupted */
if (current->flags & TASK_INTERRUPTED) {
printk("Thread (%d) interrupted on mutex sleep\n", current->tid);
current->flags &= ~TASK_INTERRUPTED;
return -EINTR;
}
@@ -140,11 +142,14 @@ int mutex_lock(struct mutex *mutex)
}
}
spin_unlock(&mutex->wqh.slock);
printk("Thread (%d) locked (%p) nlocks: %d\n", current->tid, mutex, current->nlocks);
return 0;
}
static inline void mutex_unlock_common(struct mutex *mutex, int sync)
{
struct ktcb *c = current; if (c);
printk("Thread (%d) unlocking (%p) nlocks: %d\n", c->tid, mutex, c->nlocks);
spin_lock(&mutex->wqh.slock);
__mutex_unlock(&mutex->lock);
current->nlocks--;

View File

@@ -38,7 +38,7 @@ void task_unset_wqh(struct ktcb *task)
/*
* Initiate wait on current task that
* has already been placed in a waitqueue
*
*
* NOTE: This enables preemption and wait_on_prepare()
* should be called first.
*/
@@ -63,7 +63,7 @@ int wait_on_prepared_wait(void)
* Do all preparations to sleep but return without sleeping.
* This is useful if the task needs to get in the waitqueue before
* it releases a lock.
*
*
* NOTE: This disables preemption and it should be enabled by a
* call to wait_on_prepared_wait() - the other function of the pair.
*/