public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Davide Libenzi <davidel@xmailserver.org>,
	Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Roland McGrath <roland@redhat.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH] kthread: Enhance kthread_stop to abort interruptible sleeps
Date: Tue, 24 Apr 2007 15:19:50 -0600	[thread overview]
Message-ID: <m1ejm9tqq1.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070424202727.GB5042@tv-sign.ru> (Oleg Nesterov's message of "Wed, 25 Apr 2007 00:27:27 +0400")

Oleg Nesterov <oleg@tv-sign.ru> writes:

> On 04/24, Eric W. Biederman wrote:
>> 
>> I don't know if this is the problem but it certainly needs to be fixed.
>
> I guess you will re-submit these patches soon. May I suggest you to put
> this
>
>> +	spin_lock_irq(&tsk->sighand->siglock);
>> +	signal_wake_up(tsk, 1);
>> +	spin_unlock_irq(&tsk->sighand->siglock);
>
> and this
>
>>  fastcall void recalc_sigpending_tsk(struct task_struct *t)
>>  {
>>  	if (t->signal->group_stop_count > 0 ||
>> -	    (freezing(t)) ||
>> +	    (freezing(t)) || __kthread_should_stop(t) ||
>
> into the separate patch?
>
> Perhaps I am too paranoid, and most probably this change is good, but
> still I'm afraid this very subtle change may break things. In that case
> it would be easy to revert that only part (for example for the testing
> purposes).

It makes sense.  I doubt we are going to run into issues when
we are killing a thread but we certainly could.

Making it easy to test for that scenario would certainly be
a good idea.

> Consider,
>
> 	current->flags |= PF_NOFREEZE;
>
> 	while (!kthread_should_stop()) {
>
> 		begin_something();
>
> 		// I am a kernel thread, all signals are ignored.
> 		// I don't want to contribute to loadavg, so I am
> 		// waiting for the absoulutely critical event in
> 		// TASK__INTERRUPTIBLE state.
>
> 		if (wait_event_interruptible(condition))
> 			panic("Impossible!");
>
> 		commit_something();
> 	}

Of course if it's impossible it is most likely there won't be a check
there so something more subtle will happen.

Eric

      reply	other threads:[~2007-04-24 21:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13 13:02 [PATCH 3/3] make kthread_stop() scalable Oleg Nesterov
2007-04-13 23:44 ` Eric W. Biederman
2007-04-14 18:02   ` Oleg Nesterov
2007-04-14 18:34     ` Eric W. Biederman
2007-04-14 18:50       ` Oleg Nesterov
2007-04-14  3:13 ` [PATCH] kthread: Enhance kthread_stop to abort interruptible sleeps Eric W. Biederman
2007-04-14  3:17   ` [PATCH] kthread: Simplify kthread_create Eric W. Biederman
2007-04-14 18:35   ` [PATCH] kthread: Enhance kthread_stop to abort interruptible sleeps Oleg Nesterov
2007-04-14 19:04     ` Eric W. Biederman
2007-04-14 19:34       ` Oleg Nesterov
2007-04-24 10:09   ` Andrew Morton
2007-04-24 10:30     ` Eric W. Biederman
2007-04-24 10:42       ` Andrew Morton
2007-04-24 11:11         ` Eric W. Biederman
2007-04-24 15:05       ` Oleg Nesterov
2007-04-24 15:53         ` Oleg Nesterov
2007-04-24 17:18           ` Eric W. Biederman
2007-04-24 20:27             ` Oleg Nesterov
2007-04-24 21:19               ` Eric W. Biederman [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=m1ejm9tqq1.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    --cc=rjw@sisk.pl \
    --cc=roland@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@linux-foundation.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