public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: john stultz <johnstul@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org, Roland McGrath <roland@redhat.com>
Subject: Re: [RFC][PATCH] Avoid race w/ posix-cpu-timer and exiting tasks
Date: Thu, 15 Jun 2006 05:24:29 +0400	[thread overview]
Message-ID: <20060615012429.GA16951@oleg> (raw)
In-Reply-To: <1150239945.5799.14.camel@cog.beaverton.ibm.com>

On 06/13, john stultz wrote:
>
> The tsk->signal check from the patch above looks like it would avoid
> this as well. Is there a specific benefit to checking that over
> exit_state?

->exit_state is protected by tasklist_lock, and it would be nice to
avoid it in run_posix_cpu_timers(). (I guess we could remove it right
now, but I forgot the code). Yes, currently it doesn't matter because
tsk == current.

Personally I dislike the testing of ->exit_state != 0 because unlike
PF_EXITING or ->sighand/->signal it is changed from 0 to 1 in the middle
of do_exit() path. Imho it should be used only by do_exit/do_wait path,
but maybe this is just me.

Btw, I think there is another problem,

	check_process_timers:

			t = tsk;
			do {

				...
				
				do {
					t = next_thread(t);
				} while (unlikely(t->flags & PF_EXITING));
			} while (t != tsk);


This can hang if the local timer interrupt happens right after do_exit()
sets PF_EXITING ?

Oleg.


  reply	other threads:[~2006-06-14 21:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-14  2:49 [RFC][PATCH] Avoid race w/ posix-cpu-timer and exiting tasks Oleg Nesterov
2006-06-13 23:05 ` john stultz
2006-06-15  1:24   ` Oleg Nesterov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-06-13  0:25 john stultz

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=20060615012429.GA16951@oleg \
    --to=oleg@tv-sign.ru \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=rostedt@goodmis.org \
    --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