linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nagendra Singh Tomar <nagendra_tomar@adaptec.com>
To: kuznet@ms2.inr.ac.ru
Cc: "Tomar, Nagendra" <nagendra_tomar@adaptec.com>,
	<wa@almesberger.net>, <quade@hsnr.de>,
	<linux-kernel@vger.kernel.org>
Subject: Re: tasklet_kill will always hang for recursive tasklets on a UP
Date: Thu, 28 Aug 2003 21:55:33 +0530 (IST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0308282143330.14580-100000@localhost.localdomain> (raw)
In-Reply-To: <200308281317.RAA20747@dub.inr.ac.ru>


On Thu, 28 Aug 2003 kuznet@ms2.inr.ac.ru wrote:

> Hello!
> 
> > Either the tasklet_kill hangs (which will happen on UP)
> 
> Never can happen, unless you are trying to call tasklet_kill
> from softirq context, which is illegal.

If I was not explicit, I meant that tasklet_kill called from process 
context, for recursive tasklets will *always* hang on a UP machine at 
least till 2.4 when the kernel was not premptible. And yes, "always". The 
logic says that and experimentation also shows that.

> 
> 
> > So I believe that at least one (to be precise, the last one called
> before 
> > tasklet dies) tasklet_schedule is not honoured.
> 
> You cannot call tasklet_schedule while kill is called. As I said in
> previous
> mail, preventing new schedules is responsibility of callers. tasklet
> struct
> and control functions do not maintain any information about its state,
> it is
> for client to handle this in his preferred way.

So a better name would be wait_for_tasklet_completion. I think now I 
understand the
intent. If somebody is unloading a module which has scheduled a tasklet, 
the module cleanup function wants to be sure that the tasklet is not 
sitting on any CPU queue waiting to be executed (if that happens the 
tasklet might try to access the module address space and if that happens 
after the module unload we will get an OOPS). Once tasklet_kill completes 
the caller of tsaklet_kill has the responsibility to make sure that it is 
not scheduled again (if it is scheduled it will again start running 
happily as if nothing has happened)
All is fine, but the recursive tasklet problem is still there. We need 
to add another state to tasklet TASKLET_STATE_KILLED which is set once 
tasklet_kill is called. Once this is set tasklet_schedule just does not 
schedule the tasklet.

> 
> You are right when saying the name is misnomer. tasklet_kill does not
> kill,
> it waits for the moment when tasklet becomes really dead after client
> strangled it with his own hands.
> 
> Alexey
> 

Thanx for making things clear.
tomar



  reply	other threads:[~2003-08-29  4:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-25  0:00 tasklet_kill will always hang for recursive tasklets on a UP Nagendra Singh Tomar
2003-08-25  1:53 ` Nagendra Singh Tomar
2003-08-25 14:11 ` Juergen Quade
2003-08-25 17:14   ` Nagendra Singh Tomar
2003-08-27 18:21     ` Juergen Quade
2003-08-27 17:46       ` Nagendra Singh Tomar
2003-08-28 15:29         ` Juergen Quade
2003-08-28 15:53           ` kuznet
2003-08-28 16:17             ` Juergen Quade
2003-08-29  2:22               ` Werner Almesberger
2003-08-26  5:48 ` Werner Almesberger
2003-08-25 18:45   ` Nagendra Singh Tomar
2003-08-26  7:38     ` Werner Almesberger
2003-08-26  8:32       ` Juergen Quade
2003-08-26 17:56         ` Werner Almesberger
2003-08-27  1:47           ` kuznet
2003-08-26 16:17             ` Nagendra Singh Tomar
2003-08-28 13:17               ` kuznet
2003-08-28 16:25                 ` Nagendra Singh Tomar [this message]
2003-09-04 13:25                   ` kuznet
2003-08-29  2:30             ` Werner Almesberger

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=Pine.LNX.4.44.0308282143330.14580-100000@localhost.localdomain \
    --to=nagendra_tomar@adaptec.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quade@hsnr.de \
    --cc=wa@almesberger.net \
    /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;
as well as URLs for NNTP newsgroup(s).