OpenVZ Forum


Home » Mailing lists » Devel » [RFC][PATCH] Isolate some explicit usage of task->tgid
Re: [RFC][PATCH] Isolate some explicit usage of task->tgid [message #15976 is a reply to message #15975] Fri, 17 August 2007 13:49 Go to previous message
Oleg Nesterov is currently offline  Oleg Nesterov
Messages: 143
Registered: August 2006
Senior Member
On 08/17, Pavel Emelyanov wrote:
>
> diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
> index b53c8fc..06a1e7d 100644
> --- a/kernel/posix-cpu-timers.c
> +++ b/kernel/posix-cpu-timers.c
> @@ -21,8 +21,8 @@ static int check_clock(const clockid_t w
> 
> 	read_lock(&tasklist_lock);
> 	p = find_task_by_pid(pid);
> -	if (!p || (CPUCLOCK_PERTHREAD(which_clock) ?
> -		   p->tgid != current->tgid : p->tgid != pid)) {
> +	if (!p || !(CPUCLOCK_PERTHREAD(which_clock) ?
> +		   same_thread_group(p, current) : has_group_leader_pid(p)))

Could you use thread_group_leader() instead of has_group_leader_pid() for
posix timers?

This is what the code means, and it is a bit faster. has_group_leader_pid()
is a bit special, and imho should be avoided.

Otherwise I think the patch is nice, and the helper is really useful.

Oleg.
 
Read Message
Read Message
Previous Topic: [PATCH] Use find_task_by_pid_ns() in places that operate with virtual pids
Next Topic: [PATCH] Isolate some explicit usage of task->tgid
Goto Forum:
  


Current Time: Sun Aug 24 08:16:05 GMT 2025

Total time taken to generate the page: 0.05571 seconds