From: Oleg Nesterov <oleg-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org>
To: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [RFC][PATCH] Isolate some explicit usage of task->tgid
Date: Fri, 17 Aug 2007 17:51:37 +0400 [thread overview]
Message-ID: <20070817135137.GA311@tv-sign.ru> (raw)
In-Reply-To: <46C596F1.6020202-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
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.
prev parent reply other threads:[~2007-08-17 13:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-17 12:39 [RFC][PATCH] Isolate some explicit usage of task->tgid Pavel Emelyanov
[not found] ` <46C596F1.6020202-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-08-17 13:51 ` Oleg Nesterov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070817135137.GA311@tv-sign.ru \
--to=oleg-6lxkizvqkoavjsylp49lxw@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox