浏览代码

devtmpfsd: fix task state handling

- Set the state to TASK_INTERRUPTIBLE using __set_current_state()
  instead of set_current_state() as the spin_unlock is an implicit memory
  barrier.

- After return from schedule(), there is no need to set the current
  state to TASK_RUNNING - a call to schedule() always returns in
  TASK_RUNNING state.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Kautuk Consul 14 年之前
父节点
当前提交
65e6757be4
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      drivers/base/devtmpfs.c

+ 1 - 2
drivers/base/devtmpfs.c

@@ -413,10 +413,9 @@ static int devtmpfsd(void *p)
 			}
 			}
 			spin_lock(&req_lock);
 			spin_lock(&req_lock);
 		}
 		}
-		set_current_state(TASK_INTERRUPTIBLE);
+		__set_current_state(TASK_INTERRUPTIBLE);
 		spin_unlock(&req_lock);
 		spin_unlock(&req_lock);
 		schedule();
 		schedule();
-		__set_current_state(TASK_RUNNING);
 	}
 	}
 	return 0;
 	return 0;
 out:
 out: