public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, Lin Ming <ming.m.lin@intel.com>,
	Roland McGrath <roland@redhat.com>,
	"Zhang, Yanmin" <yanmin_zhang@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] posix-cpu-timers: use ->sighand instead of ->signal to check the task is alive
Date: Wed, 4 Feb 2009 14:19:01 +0100	[thread overview]
Message-ID: <20090204131901.GA7367@redhat.com> (raw)
In-Reply-To: <1233746479.5076.6.camel@laptop>

On 02/04, Peter Zijlstra wrote:
>
> On Wed, 2009-02-04 at 00:17 +0100, Oleg Nesterov wrote:
> > Sadly, it is not trivial to audit kernel/posix-cpu-timers.c, but it really
> > abuses tasklist_lock. I believe it doesn't need this lock at all, but the
> > changes are not easy to test.
>
> It uses that to hold of task reaping so ->signal doesn't go away.

Yes sure, but ->siglock alone is enough (this was not true when this code
was written, as far as I know). It is not trivial to remove tasklist
completely, but some places are trivial.

> If we make ->signal refcountable, and rcu freed along with the tasks I
> think we can get away without tasklist_lock.

I think this is possible even without this change (which is good anyway).
But the problem is not only that ->signal can go away. For example,
posix_cpu_timer_set/posix_cpu_timer_schedule should not proceed if the
task was already released, even if it had the valid ->signal.

Oleg.


  reply	other threads:[~2009-02-04 13:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 23:17 [PATCH 2/2] posix-cpu-timers: use ->sighand instead of ->signal to check the task is alive Oleg Nesterov
2009-02-04 11:21 ` Peter Zijlstra
2009-02-04 13:19   ` Oleg Nesterov [this message]
2009-02-05  3:31 ` Roland McGrath
2009-02-05 15:54   ` Oleg Nesterov
2009-02-05 20:45     ` Roland McGrath
2009-02-05 22:59       ` 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=20090204131901.GA7367@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.com \
    --cc=yanmin_zhang@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox