mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Duncan Sands <baldrick@wanadoo.fr>
To: Martin Diehl <lists@mdiehl.de>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	"David S. Miller" <davem@redhat.com>, <schlicht@uni-mannheim.de>,
	<ricardo.b@zmail.pt>, <linux-kernel@vger.kernel.org>
Subject: Re: SET_MODULE_OWNER
Date: Fri, 18 Jul 2003 12:12:09 +0200	[thread overview]
Message-ID: <200307181212.09102.baldrick@wanadoo.fr> (raw)
In-Reply-To: <Pine.LNX.4.44.0307181045520.14014-100000@notebook.home.mdiehl.de>

On Friday 18 July 2003 11:05, Martin Diehl wrote:
> On Fri, 18 Jul 2003, Duncan Sands wrote:
> > On Thursday 17 July 2003 22:22, Jeff Garzik wrote:
> > > David S. Miller wrote:
> > > > On Thu, 17 Jul 2003 12:00:58 -0400
> > > >
> > > > Jeff Garzik <jgarzik@pobox.com> wrote:
> > > >>David?  Does Rusty have a plan here or something?
> > > >
> > > > It just works how it works and that's it.
> > > >
> > > > Net devices are reference counted, anything more is superfluous.
> > > > They may be yanked out of the kernel whenever you want.
> > >
> > > (I'm obviously just realizing the implications of this... missed it
> > > completely during the earlier discussions)
> > >
> > > Object lifetime is just part of the story.
> > >
> > > This change is a major behavior change.  The whole point of removing a
> > > module is knowing its gone ;-)  And that is completely changed now.
> > > Modules are very often used by developers in a "modprobe ; test ;
> > > rmmod" cycle, and that's now impossible (you don't know when the net
> > > device, and thus your code, is really gone).  It's already breaking
> > > userland, which does sweeps for zero-refcount modules among other
> > > things.
> >
> > Most USB drivers can be unloaded at any time, so this problem already
> > existed elsewhere.
>
> Most? Since when?
>
> For me neither usb-storage nor usbserial (pl2303 f.e.) can be unloaded
> when in use (storage being mounted or /dev/usb/ttyUSBX opened).

OK, maybe most was exagerated. :) 

If you want to see what I have in mind, do
	rmmod uhci-hcd
(or whatever your hcd is).  This shows that there was already a problem with
unloading modules with zero refcount.

> True, irda-usb (and probably usbnet) can be unloaded when the interface is
> up since a few weeks - but this is due to the networking not bumping
> the module use counter anymore, nothing todo with usb.
>
> Doing something comparable to network with usb in general one would need
> to change usb-storage reporting use-count==0 while the disk is mounted!
> Only then one could rmmod and the fs would (hopefully) get synced and
> unmounted (or staled) automagically.
>
> Personally I believe it all comes down to the semantics of the module use
> counter. If it's taken to indicate the module cannot be unloaded while
> !=0, it might (or should) stay ==0 if the underlaying subsystem can handle
> module removal at any time safe - like it is done for network now.
>
> In contrast, if the module use count is taken to indicate a module is in
> use (interface up, fs mounted, chardev open, ...) I'd expect it to be >0.
> Being unable to rmmod in this situation is just a consequence of the fact
> it's being used then, regardless whether we could rmmod anyway.
>
> OTOH David has a point as the current situation with network helps to
> identify bugs there - YMMV.

Duncan.

  reply	other threads:[~2003-07-18  9:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-17 12:56 SET_MODULE_OWNER Ricardo Bugalho
2003-07-17 15:32 ` SET_MODULE_OWNER Jeff Garzik
2003-07-17 15:56   ` SET_MODULE_OWNER Thomas Schlichter
2003-07-17 16:00     ` SET_MODULE_OWNER Jeff Garzik
2003-07-17 19:59       ` SET_MODULE_OWNER David S. Miller
2003-07-17 20:22         ` SET_MODULE_OWNER Jeff Garzik
2003-07-17 20:19           ` SET_MODULE_OWNER David S. Miller
2003-07-17 20:48             ` SET_MODULE_OWNER Jeff Garzik
2003-07-17 21:34               ` SET_MODULE_OWNER David S. Miller
2003-07-18  9:48             ` SET_MODULE_OWNER Roman Zippel
2003-07-18  7:31           ` SET_MODULE_OWNER Duncan Sands
2003-07-18  9:05             ` SET_MODULE_OWNER Martin Diehl
2003-07-18 10:12               ` Duncan Sands [this message]
2003-07-18 12:46                 ` SET_MODULE_OWNER Martin Diehl
2003-07-17 21:36         ` SET_MODULE_OWNER Ricardo Bugalho
2003-07-17 21:40           ` SET_MODULE_OWNER David S. Miller
2003-07-17 22:23             ` SET_MODULE_OWNER Ricardo Bugalho
2003-07-17 22:16               ` SET_MODULE_OWNER David S. Miller
2003-07-18  0:49                 ` SET_MODULE_OWNER Ricardo Bugalho
2003-07-18  2:27             ` SET_MODULE_OWNER James H. Cloos Jr.
2003-07-18  5:26               ` SET_MODULE_OWNER David S. Miller
2003-07-20  2:10                 ` SET_MODULE_OWNER James H. Cloos Jr.

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=200307181212.09102.baldrick@wanadoo.fr \
    --to=baldrick@wanadoo.fr \
    --cc=davem@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lists@mdiehl.de \
    --cc=ricardo.b@zmail.pt \
    --cc=schlicht@uni-mannheim.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

all inboxes | Powered by JetHome®