From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
Stanislaw Gruszka <sgruszka@redhat.com>
Subject: Re: [PATCH] posix-cpu-timers: rcu_read_lock/unlock protect find_task_by_vpid call
Date: Wed, 3 Nov 2010 18:38:16 +0200 [thread overview]
Message-ID: <20101103163816.GC30053@swordfish.minsk.epam.com> (raw)
In-Reply-To: <20101103161059.GA13530@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]
On (11/03/10 17:10), Oleg Nesterov wrote:
> On 11/03, Oleg Nesterov wrote:
> >
> > Sergey, Thomas, please wait a bit.
> >
> > Yes, I believe this patch is fine by itself. But looking into
> > posix-cpu-timers.c again, I suspect that those "other problems
> > with de_thread" I already mentioned are much more serious and
> > need the urgent fix.
>
> Yes. I'll send the patch tomorrow.
>
>
> However, my initial thinking was wrong, that bug is orthogonal
> to this patch.
>
> Sergey, how much will you hate me if I ask you to re-send it again?
>
Oleg, not a problem at all. Which one should I resend?
# desc.
1) added rcu_read_lock/unlock
2) removed tasklist_lock
3) added has_group_leader_pid
Sergey
>
> > > On (11/02/10 19:33), Oleg Nesterov wrote:
> > > > > On Tue, 2 Nov 2010, Sergey Senozhatsky wrote:
> > > > >
> > > > > > > We can remove the tasklist_lock while at it. rcu_read_lock is enough.
> > > > > > >
> > > >
> > > > Yes, I believe posix-cpu-timers.c shouldn't use tasklist at all,
> > > > but it is not trivial to change this code.
> > > >
> > > >[..]
> > > >
> > > > I think this change is fine, but please note that thread_group_leader()
> > > > check is not relaible without tasklist. If we race with de_thread()
> > > > find_task_by_vpid() can find the new leader before it updates its
> > > > ->group_leader. IOW, posix_cpu_timer_create() can fail when it shouldn't.
> > > >
> > > > Not that I think this really matters, posix_cpu_timer_create() has
> > > > other problems with de_thread(). But perhaps it makes sense to
> > > > change posix_cpu_timer_create() to use has_group_leader_pid() instead,
> > > > just to make this code not look racy and avoid adding new problems.
> > > >
> > > > The real fix, I think, should change cpu_timer_list to use
> > > > struct pid* instead of task_struct.
> > > >
> > >
> > > Hello,
> > > Using has_group_leader_pid instead of thread_group_leader, when tasklist_lock
> > > is not aquired (check_clock and posix_cpu_timer_create).
>
> This doesn't look like a valid changelog ;) I'd suggest you to write
> the new one without quoting old emails. It should explain that a)
> tasklist_lock is not enough for find_vpid() and b) it is not needed.
>
> Also, you forgot to add your signed-of-by.
>
> Otherwise,
>
> Reviewed-by: Oleg Nesterov <oleg@redhat.com>
>
[-- Attachment #2: Type: application/pgp-signature, Size: 316 bytes --]
next prev parent reply other threads:[~2010-11-03 16:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-02 13:58 Sergey Senozhatsky
2010-11-02 15:31 ` Thomas Gleixner
2010-11-02 16:02 ` Sergey Senozhatsky
2010-11-02 16:04 ` Thomas Gleixner
2010-11-02 18:33 ` Oleg Nesterov
2010-11-03 10:58 ` Sergey Senozhatsky
2010-11-03 12:48 ` Oleg Nesterov
2010-11-03 16:10 ` Oleg Nesterov
2010-11-03 16:38 ` Sergey Senozhatsky [this message]
2010-11-03 16:52 ` Sergey Senozhatsky
2010-11-03 17:17 ` Oleg Nesterov
2010-11-05 15:53 ` [PATCH] posix-cpu-timers: workaround to suppress the problems with mt exec Oleg Nesterov
2010-11-08 18:14 ` Roland McGrath
2010-11-09 14:54 ` Stanislaw Gruszka
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=20101103163816.GC30053@swordfish.minsk.epam.com \
--to=sergey.senozhatsky@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=sgruszka@redhat.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome