Commit 6865038a authored by David Gibson's avatar David Gibson Committed by Christoph Hellwig

[PATCH] Remove CONFIG_SMP around wait_task_inactive()

Linus, please apply.  This defines wait_task_inactive() to be a no-op
on UP machines, and removes the #ifdef CONFIG_SMP which surrounds
current calls.

This also fixes compile on UP which was broken by the addition of a
call to wait_task_inactive in fs/exec.c which was not protected by an
#ifdef.
parent 16b38746
...@@ -2345,22 +2345,19 @@ static int ...@@ -2345,22 +2345,19 @@ static int
check_task_state(struct task_struct *task) check_task_state(struct task_struct *task)
{ {
int ret = 0; int ret = 0;
#ifdef CONFIG_SMP
/* We must wait until the state has been completely /* We must wait until the state has been completely
* saved. There can be situations where the reader arrives before * saved. There can be situations where the reader arrives before
* after the task is marked as STOPPED but before pfm_save_regs() * after the task is marked as STOPPED but before pfm_save_regs()
* is completed. * is completed.
*/ */
if (task->state != TASK_ZOMBIE && task->state != TASK_STOPPED) return -EBUSY;
DBprintk(("before wait_task_inactive [%d] state %ld\n", task->pid, task->state));
wait_task_inactive(task);
DBprintk(("after wait_task_inactive [%d] state %ld\n", task->pid, task->state));
#else
if (task->state != TASK_ZOMBIE && task->state != TASK_STOPPED) { if (task->state != TASK_ZOMBIE && task->state != TASK_STOPPED) {
DBprintk(("warning [%d] not in stable state %ld\n", task->pid, task->state)); DBprintk(("warning [%d] not in stable state %ld\n", task->pid, task->state));
ret = -EBUSY; ret = -EBUSY;
} }
#endif DBprintk(("before wait_task_inactive [%d] state %ld\n", task->pid, task->state));
wait_task_inactive(task);
DBprintk(("after wait_task_inactive [%d] state %ld\n", task->pid, task->state));
return ret; return ret;
} }
......
...@@ -690,7 +690,11 @@ extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); ...@@ -690,7 +690,11 @@ extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));
extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait));
extern void FASTCALL(remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); extern void FASTCALL(remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));
#ifdef CONFIG_SMP
extern void wait_task_inactive(task_t * p); extern void wait_task_inactive(task_t * p);
#else
#define wait_task_inactive(p) do { } while (0)
#endif
extern void kick_if_running(task_t * p); extern void kick_if_running(task_t * p);
#define __wait_event(wq, condition) \ #define __wait_event(wq, condition) \
......
...@@ -55,10 +55,8 @@ void release_task(struct task_struct * p) ...@@ -55,10 +55,8 @@ void release_task(struct task_struct * p)
if (p->state != TASK_ZOMBIE) if (p->state != TASK_ZOMBIE)
BUG(); BUG();
#ifdef CONFIG_SMP
if (p != current) if (p != current)
wait_task_inactive(p); wait_task_inactive(p);
#endif
atomic_dec(&p->user->processes); atomic_dec(&p->user->processes);
security_ops->task_free_security(p); security_ops->task_free_security(p);
free_uid(p->user); free_uid(p->user);
......
...@@ -69,9 +69,7 @@ int ptrace_check_attach(struct task_struct *child, int kill) ...@@ -69,9 +69,7 @@ int ptrace_check_attach(struct task_struct *child, int kill)
if (!kill) { if (!kill) {
if (child->state != TASK_STOPPED) if (child->state != TASK_STOPPED)
return -ESRCH; return -ESRCH;
#ifdef CONFIG_SMP
wait_task_inactive(child); wait_task_inactive(child);
#endif
} }
/* All systems go.. */ /* All systems go.. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment