Skip to content

Commit

Permalink
[IA64-SGI] Fix XPC code which sleeps with spin_lock_irqsave().
Browse files Browse the repository at this point in the history
During some testing, we got a warning about trying to allocate
memory while holding a lock.  This fixes that problem.

Signed-off-by: Robin Holt <holt@sgi.com>
Acked-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Robin Holt authored and Tony Luck committed Feb 2, 2006
1 parent 9a52bbe commit 7c6c663
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions arch/ia64/sn/kernel/xpc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,18 +575,21 @@ xpc_activate_partition(struct xpc_partition *part)

spin_lock_irqsave(&part->act_lock, irq_flags);

pid = kernel_thread(xpc_activating, (void *) ((u64) partid), 0);

DBUG_ON(part->act_state != XPC_P_INACTIVE);

if (pid > 0) {
part->act_state = XPC_P_ACTIVATION_REQ;
XPC_SET_REASON(part, xpcCloneKThread, __LINE__);
} else {
XPC_SET_REASON(part, xpcCloneKThreadFailed, __LINE__);
}
part->act_state = XPC_P_ACTIVATION_REQ;
XPC_SET_REASON(part, xpcCloneKThread, __LINE__);

spin_unlock_irqrestore(&part->act_lock, irq_flags);

pid = kernel_thread(xpc_activating, (void *) ((u64) partid), 0);

if (unlikely(pid <= 0)) {
spin_lock_irqsave(&part->act_lock, irq_flags);
part->act_state = XPC_P_INACTIVE;
XPC_SET_REASON(part, xpcCloneKThreadFailed, __LINE__);
spin_unlock_irqrestore(&part->act_lock, irq_flags);
}
}


Expand Down

0 comments on commit 7c6c663

Please sign in to comment.