diff options
-rw-r--r-- | fs/proc/array.c | 2 | ||||
-rw-r--r-- | fs/proc/base.c | 9 | ||||
-rw-r--r-- | kernel/sched_debug.c | 2 |
3 files changed, 1 insertions, 12 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 71c9be59c9c2..1c8d7b5d7a14 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -261,7 +261,6 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p) | |||
261 | sigemptyset(&ignored); | 261 | sigemptyset(&ignored); |
262 | sigemptyset(&caught); | 262 | sigemptyset(&caught); |
263 | 263 | ||
264 | rcu_read_lock(); | ||
265 | if (lock_task_sighand(p, &flags)) { | 264 | if (lock_task_sighand(p, &flags)) { |
266 | pending = p->pending.signal; | 265 | pending = p->pending.signal; |
267 | shpending = p->signal->shared_pending.signal; | 266 | shpending = p->signal->shared_pending.signal; |
@@ -272,7 +271,6 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p) | |||
272 | qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur; | 271 | qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur; |
273 | unlock_task_sighand(p, &flags); | 272 | unlock_task_sighand(p, &flags); |
274 | } | 273 | } |
275 | rcu_read_unlock(); | ||
276 | 274 | ||
277 | seq_printf(m, "Threads:\t%d\n", num_threads); | 275 | seq_printf(m, "Threads:\t%d\n", num_threads); |
278 | seq_printf(m, "SigQ:\t%lu/%lu\n", qsize, qlim); | 276 | seq_printf(m, "SigQ:\t%lu/%lu\n", qsize, qlim); |
diff --git a/fs/proc/base.c b/fs/proc/base.c index a28840b11b89..bb63fa1d34a2 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -164,7 +164,6 @@ static struct fs_struct *get_fs_struct(struct task_struct *task) | |||
164 | 164 | ||
165 | static int get_nr_threads(struct task_struct *tsk) | 165 | static int get_nr_threads(struct task_struct *tsk) |
166 | { | 166 | { |
167 | /* Must be called with the rcu_read_lock held */ | ||
168 | unsigned long flags; | 167 | unsigned long flags; |
169 | int count = 0; | 168 | int count = 0; |
170 | 169 | ||
@@ -471,14 +470,10 @@ static int proc_pid_limits(struct task_struct *task, char *buffer) | |||
471 | 470 | ||
472 | struct rlimit rlim[RLIM_NLIMITS]; | 471 | struct rlimit rlim[RLIM_NLIMITS]; |
473 | 472 | ||
474 | rcu_read_lock(); | 473 | if (!lock_task_sighand(task, &flags)) |
475 | if (!lock_task_sighand(task,&flags)) { | ||
476 | rcu_read_unlock(); | ||
477 | return 0; | 474 | return 0; |
478 | } | ||
479 | memcpy(rlim, task->signal->rlim, sizeof(struct rlimit) * RLIM_NLIMITS); | 475 | memcpy(rlim, task->signal->rlim, sizeof(struct rlimit) * RLIM_NLIMITS); |
480 | unlock_task_sighand(task, &flags); | 476 | unlock_task_sighand(task, &flags); |
481 | rcu_read_unlock(); | ||
482 | 477 | ||
483 | /* | 478 | /* |
484 | * print the file header | 479 | * print the file header |
@@ -3088,9 +3083,7 @@ static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct | |||
3088 | generic_fillattr(inode, stat); | 3083 | generic_fillattr(inode, stat); |
3089 | 3084 | ||
3090 | if (p) { | 3085 | if (p) { |
3091 | rcu_read_lock(); | ||
3092 | stat->nlink += get_nr_threads(p); | 3086 | stat->nlink += get_nr_threads(p); |
3093 | rcu_read_unlock(); | ||
3094 | put_task_struct(p); | 3087 | put_task_struct(p); |
3095 | } | 3088 | } |
3096 | 3089 | ||
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c index bbe6b31c3c56..ad958c1ec708 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched_debug.c | |||
@@ -333,12 +333,10 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) | |||
333 | unsigned long flags; | 333 | unsigned long flags; |
334 | int num_threads = 1; | 334 | int num_threads = 1; |
335 | 335 | ||
336 | rcu_read_lock(); | ||
337 | if (lock_task_sighand(p, &flags)) { | 336 | if (lock_task_sighand(p, &flags)) { |
338 | num_threads = atomic_read(&p->signal->count); | 337 | num_threads = atomic_read(&p->signal->count); |
339 | unlock_task_sighand(p, &flags); | 338 | unlock_task_sighand(p, &flags); |
340 | } | 339 | } |
341 | rcu_read_unlock(); | ||
342 | 340 | ||
343 | SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, p->pid, num_threads); | 341 | SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, p->pid, num_threads); |
344 | SEQ_printf(m, | 342 | SEQ_printf(m, |