aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2006-03-24 06:16:10 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:23 -0500
commit8488bc359d674baf710992e4b641513ea5ebd212 (patch)
tree28f6558f6b006c5a28a64a1beabec5498d9b77d4 /kernel/cpuset.c
parentb0196009d8c3ecf6ea6ec080c63d2ccc146e7ad9 (diff)
[PATCH] cpuset: remove unnecessary NULL check
Remove a no longer needed test for NULL cpuset pointer, with a little comment explaining why the test isn't needed. Signed-off-by: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 38f18b33de6c..bc4131141230 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2023,7 +2023,7 @@ void cpuset_fork(struct task_struct *child)
2023 * because tsk is already marked PF_EXITING, so attach_task() won't 2023 * because tsk is already marked PF_EXITING, so attach_task() won't
2024 * mess with it, or task is a failed fork, never visible to attach_task. 2024 * mess with it, or task is a failed fork, never visible to attach_task.
2025 * 2025 *
2026 * Hack: 2026 * the_top_cpuset_hack:
2027 * 2027 *
2028 * Set the exiting tasks cpuset to the root cpuset (top_cpuset). 2028 * Set the exiting tasks cpuset to the root cpuset (top_cpuset).
2029 * 2029 *
@@ -2062,7 +2062,7 @@ void cpuset_exit(struct task_struct *tsk)
2062 struct cpuset *cs; 2062 struct cpuset *cs;
2063 2063
2064 cs = tsk->cpuset; 2064 cs = tsk->cpuset;
2065 tsk->cpuset = &top_cpuset; /* Hack - see comment above */ 2065 tsk->cpuset = &top_cpuset; /* the_top_cpuset_hack - see above */
2066 2066
2067 if (notify_on_release(cs)) { 2067 if (notify_on_release(cs)) {
2068 char *pathbuf = NULL; 2068 char *pathbuf = NULL;
@@ -2373,12 +2373,12 @@ void __cpuset_memory_pressure_bump(void)
2373 * - No need to task_lock(tsk) on this tsk->cpuset reference, as it 2373 * - No need to task_lock(tsk) on this tsk->cpuset reference, as it
2374 * doesn't really matter if tsk->cpuset changes after we read it, 2374 * doesn't really matter if tsk->cpuset changes after we read it,
2375 * and we take manage_mutex, keeping attach_task() from changing it 2375 * and we take manage_mutex, keeping attach_task() from changing it
2376 * anyway. 2376 * anyway. No need to check that tsk->cpuset != NULL, thanks to
2377 * the_top_cpuset_hack in cpuset_exit(), which sets an exiting tasks
2378 * cpuset to top_cpuset.
2377 */ 2379 */
2378
2379static int proc_cpuset_show(struct seq_file *m, void *v) 2380static int proc_cpuset_show(struct seq_file *m, void *v)
2380{ 2381{
2381 struct cpuset *cs;
2382 struct task_struct *tsk; 2382 struct task_struct *tsk;
2383 char *buf; 2383 char *buf;
2384 int retval = 0; 2384 int retval = 0;
@@ -2389,13 +2389,7 @@ static int proc_cpuset_show(struct seq_file *m, void *v)
2389 2389
2390 tsk = m->private; 2390 tsk = m->private;
2391 mutex_lock(&manage_mutex); 2391 mutex_lock(&manage_mutex);
2392 cs = tsk->cpuset; 2392 retval = cpuset_path(tsk->cpuset, buf, PAGE_SIZE);
2393 if (!cs) {
2394 retval = -EINVAL;
2395 goto out;
2396 }
2397
2398 retval = cpuset_path(cs, buf, PAGE_SIZE);
2399 if (retval < 0) 2393 if (retval < 0)
2400 goto out; 2394 goto out;
2401 seq_puts(m, buf); 2395 seq_puts(m, buf);