Re: [RFC][PATCH] Isolate some explicit usage of task->tgid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux