From 86e2955a31972dc283a7b83990edb1011729c11d Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Fri, 16 Feb 2007 01:28:22 -0800 Subject: [PATCH] --- yaml --- r: 48607 b: refs/heads/master c: 1f2ea0837dbc263ce2a2512c4e73c83df68a6a55 h: refs/heads/master i: 48605: 6d5d51d678578453423e4321afb491e88f8dd189 48603: 553dd459fa737af09ef7da291bd434a74adcb6a5 48599: 3c3e4ad23bafe1aa7a5f9f41bdffef6d7a3b7a75 48591: 974edcd599947115ec507616481aef7fc4012a15 48575: 949a61372b94d7ea4ad0842a6bb5fc1c5d16a633 v: v3 --- [refs] | 2 +- trunk/kernel/posix-cpu-timers.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index c10f83133c65..12cc7be8c997 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7460ed2844ffad7141e30271c0c3da8336e66014 +refs/heads/master: 1f2ea0837dbc263ce2a2512c4e73c83df68a6a55 diff --git a/trunk/kernel/posix-cpu-timers.c b/trunk/kernel/posix-cpu-timers.c index 7c3e1e6dfb5b..657f77697415 100644 --- a/trunk/kernel/posix-cpu-timers.c +++ b/trunk/kernel/posix-cpu-timers.c @@ -304,7 +304,7 @@ int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *tp) * should be able to see it. */ struct task_struct *p; - read_lock(&tasklist_lock); + rcu_read_lock(); p = find_task_by_pid(pid); if (p) { if (CPUCLOCK_PERTHREAD(which_clock)) { @@ -312,12 +312,17 @@ int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *tp) error = cpu_clock_sample(which_clock, p, &rtn); } - } else if (p->tgid == pid && p->signal) { - error = cpu_clock_sample_group(which_clock, - p, &rtn); + } else { + read_lock(&tasklist_lock); + if (p->tgid == pid && p->signal) { + error = + cpu_clock_sample_group(which_clock, + p, &rtn); + } + read_unlock(&tasklist_lock); } } - read_unlock(&tasklist_lock); + rcu_read_unlock(); } if (error)