All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.name>
To: Thunder from the hill <thunder@ngforever.de>,
	Keith Owens <kaos@ocs.com.au>
Cc: Patrick Mochel <mochel@osdl.org>, <linux-kernel@vger.kernel.org>
Subject: Re: Driverfs updates
Date: Tue, 9 Jul 2002 10:30:17 +0200	[thread overview]
Message-ID: <200207091030.17096.oliver@neukum.name> (raw)
In-Reply-To: <Pine.LNX.4.44.0207081745150.10105-100000@hawkeye.luckynet.adm>


> > I suggest you add a global driverfs_lock.
>
> Better than locking all kernel threads, isn't it?

No, it is not, not by far.

-It means that modules are not transparent.
-Everybody is punished, module or no module.
-It limits modules to providing open/use/close APIs.
-It is slow.
-Modules can only be used on APIs that provide for them.

By freezing, which happens only on module removal,
only users of modules are punished. Handling of
module usage counts can be encapsulated in the modules
themselves. And alternative methods of determining removability
are possible.

Face it, SMP and module unloading have some fundamental problems.
Therefore you switch the box to pseudo-UP for unloading,
that's what freeze effectively does. You just have to disable preempt
on all CPUs and wait for the tasks running to leave kernel.

Cleanly killing a kernel thread of a module is duty of the module's
cleanup function. Independent kernel threads which use a module
must be allowed to sleep voluntarily before they are frozen.
In this case the old rule of "INC before you sleep" is valid again.

	Regards
		Oliver


  parent reply	other threads:[~2002-07-09  8:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-08 18:41 Driverfs updates Patrick Mochel
2002-07-08 23:33 ` Keith Owens
2002-07-08 23:52   ` Thunder from the hill
2002-07-09  0:09     ` Keith Owens
2002-07-09  8:30     ` Oliver Neukum [this message]
2002-07-09 11:08       ` Thunder from the hill
2002-07-09 11:45         ` Richard B. Johnson
2002-07-09 12:20           ` David D. Hagood
2002-07-09 12:33             ` Thunder from the hill
2002-07-09 14:43             ` jbradford
2002-07-10  7:15             ` jw schultz
2002-07-09 17:05         ` Oliver Neukum
2002-07-10  0:43         ` Pavel Machek
2002-07-09 16:56   ` Patrick Mochel
2002-07-09 23:29     ` Keith Owens
2002-07-10 20:02       ` Patrick Mochel
2002-07-11  0:40     ` John Alvord
2002-07-18 18:11 driverfs updates Patrick Mochel
2002-07-18 18:33 ` Greg KH
2002-07-18 19:57   ` Patrick Mochel

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=200207091030.17096.oliver@neukum.name \
    --to=oliver@neukum.name \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=thunder@ngforever.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 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.