Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113675
b: refs/heads/master
c: a6bebbc
h: refs/heads/master
i:
  113673: 862010e
  113671: 7c479af
v: v3
  • Loading branch information
Lai Jiangshan authored and Alexey Dobriyan committed Oct 10, 2008
1 parent 5d60a89 commit 26c5e3a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53167a3ef23df561d898dee636f3393e9fba937c
refs/heads/master: a6bebbc87a8c16eabb6bd5c6fd2d994be0236fba
2 changes: 0 additions & 2 deletions trunk/fs/proc/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p)
sigemptyset(&ignored);
sigemptyset(&caught);

rcu_read_lock();
if (lock_task_sighand(p, &flags)) {
pending = p->pending.signal;
shpending = p->signal->shared_pending.signal;
Expand All @@ -272,7 +271,6 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p)
qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur;
unlock_task_sighand(p, &flags);
}
rcu_read_unlock();

seq_printf(m, "Threads:\t%d\n", num_threads);
seq_printf(m, "SigQ:\t%lu/%lu\n", qsize, qlim);
Expand Down
9 changes: 1 addition & 8 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ static struct fs_struct *get_fs_struct(struct task_struct *task)

static int get_nr_threads(struct task_struct *tsk)
{
/* Must be called with the rcu_read_lock held */
unsigned long flags;
int count = 0;

Expand Down Expand Up @@ -471,14 +470,10 @@ static int proc_pid_limits(struct task_struct *task, char *buffer)

struct rlimit rlim[RLIM_NLIMITS];

rcu_read_lock();
if (!lock_task_sighand(task,&flags)) {
rcu_read_unlock();
if (!lock_task_sighand(task, &flags))
return 0;
}
memcpy(rlim, task->signal->rlim, sizeof(struct rlimit) * RLIM_NLIMITS);
unlock_task_sighand(task, &flags);
rcu_read_unlock();

/*
* print the file header
Expand Down Expand Up @@ -3088,9 +3083,7 @@ static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct
generic_fillattr(inode, stat);

if (p) {
rcu_read_lock();
stat->nlink += get_nr_threads(p);
rcu_read_unlock();
put_task_struct(p);
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/kernel/sched_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,10 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
unsigned long flags;
int num_threads = 1;

rcu_read_lock();
if (lock_task_sighand(p, &flags)) {
num_threads = atomic_read(&p->signal->count);
unlock_task_sighand(p, &flags);
}
rcu_read_unlock();

SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, p->pid, num_threads);
SEQ_printf(m,
Expand Down

0 comments on commit 26c5e3a

Please sign in to comment.