From: Oleg Nesterov <oleg@redhat.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
Dave Jones <davej@redhat.com>,
John Stultz <john.stultz@linaro.org>,
Tommi Rantala <tt.rantala@gmail.com>
Subject: Re: [PATCH] posix-cpu-timers: fix nanosleep task_struct leak
Date: Thu, 7 Feb 2013 14:24:55 +0100 [thread overview]
Message-ID: <20130207132455.GA25793@redhat.com> (raw)
In-Reply-To: <20130207122212.GA2668@redhat.com>
On 02/07, Stanislaw Gruszka wrote:
>
> On Wed, Feb 06, 2013 at 05:10:11PM +0100, Oleg Nesterov wrote:
> >
> > It is not clear to me why other posix_cpu_timer_del's above can't fail..
> > May be you can add a comment.
>
> Sure, I'll add more comments.
Yes, please. This will help the next reader to understand that no, we
do not forget to check the error code, just we do not need to do this.
> Once posix_cpu_timer_set(..., &zero_it, it) succeed with 0 return value,
> it's not possible to fire timer, so posix_cpu_timer_del() will not fail.
> Similar assumption is with first posix_cpu_timer_del() call I added
> in the patch.
OK, I see.
> > And I am not sure that TIMER_RETRY is the only error we should worry.
> > And perhaps we need even more posix_cpu_timer_del's?
> >
> > For example. Suppose that posix_cpu_timer_create() succeeds and does
> > get_task_struct(p). But than p dies, and the first posix_cpu_timer_set()
> > fails with -ESRCH. No?
>
> On second -ESRCH case posix_cpu_timer_set() internally call
> put_task_struct().
Ah, missed that, thanks.
> It does not remove from cpu_timers list, but
> that is done at exit().
Yes, posix_cpu_timers_exit().
OK, thanks for your explanations, I think the patch is fine.
> BTW: I don't think we handle correctly case when traced process -
> - timer->it.cpu.task will die. Tracing process - timer->it_process will
> probably not be woken up.
Probably... or perhaps we can treat this case as "timer never expires".
Oleg.
next prev parent reply other threads:[~2013-02-07 13:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-01 13:39 clock_nanosleep() task_struct leak Tommi Rantala
2013-02-01 13:52 ` Thomas Gleixner
2013-02-04 19:32 ` Oleg Nesterov
2013-02-05 10:34 ` Stanislaw Gruszka
2013-02-05 10:55 ` Thomas Gleixner
2013-02-06 11:23 ` Stanislaw Gruszka
2013-02-06 12:01 ` Tommi Rantala
2013-02-06 15:15 ` [PATCH] posix-cpu-timers: fix nanosleep " Stanislaw Gruszka
2013-02-06 16:10 ` Oleg Nesterov
2013-02-07 12:22 ` Stanislaw Gruszka
2013-02-07 13:24 ` Oleg Nesterov [this message]
2013-02-07 16:04 ` [PATCH v2] " Stanislaw Gruszka
2013-02-07 18:37 ` Oleg Nesterov
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=20130207132455.GA25793@redhat.com \
--to=oleg@redhat.com \
--cc=davej@redhat.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sgruszka@redhat.com \
--cc=tglx@linutronix.de \
--cc=tt.rantala@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.