linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <Oliver.Neukum@lrz.uni-muenchen.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: Device count (to be done with)
Date: Tue, 16 Oct 2001 08:23:55 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-100322589608112@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-100274805227939@msgid-missing>

> >Now our point of disagreement is whether this file will be read-only or
> >it will also accept two commands (something like "inc" and "dec").
>
> The file cannot be read only, it exists to take commands from user
> space to adjust the use count on loaded modules.
>
> echo "up foo" > /proc/sys/kernel/mod_use_count
>
> increments the use count on module foo.  Whether the command is "up" or
> "inc" is irrelevant.

We are not yet in agreement whether user space needs to be able to change the 
count.

> >The should-count has a
> >fundamentially different meaning than the use count (must-count).
>
> I am still not convinced that you need a separate count field, if
> _either_ count is non-zero then the module will not be unloaded.  A
> single count is all that is required.

No the modules with the "should" count nonzero should be unloadable. Only 
autoclean should not unload them.
The meaning of the current use count should not be altered.

> Adding a second count field will be very messy.  It has to be stored
> somewhere in the module header created by insmod so you need a new
> version of insmod.  Alternatively it can be stored in an area created
> by syscall init_module and pointed to by the kernel_data field, that
> needs a new kernel.

We need a new kernel anyway as the older kernels will not increment and 
decrement the new counter.

> The second count has to be exposed for rmmod and friends.  This is the
> biggest mess, struct module_info has to be expanded to hold the new
> count, syscall query_module and several bits of modutils also have to
> be changed for the new structure size.
>
> It is absolutely that such changes are backwards compatible.  Users can
> run new modutils on old kernels and vice versa, some people even run
> modutils 2.4 on 2.0 kernels.  I will not accept any change that breaks
> compatibility between modutils and kernels at the moment.  modutils 2.5
> will break compatibility all over the place but that is acceptable for
> development modutils and kernels.

This is 2.5 stuff.

> Since it is a lot of work to add a separate count field, you will have
> to convince me that you really need a separate count.  Neither rmmod
> nor autoclean (which is just rmmod -a) will remove any module with a
> non-zero use count.  Either the "should" count stops unloading or it
> does not.  If it does not stop rmmod then the "should" count is
> pointless.

It should stop just autoclean.
The issue is that USB drivers for devices connected to a computer can be 
unloaded when the device is not opened. Though obviously the device becomes 
thus unusable. Therefore autoclean cannot be used with USB drivers.
Additionally we cannot unload the module on the hotplug device removal event, 
as the module may be needed for several devices, only one of which is removed.
A counter is needed. Doing it in kernel space is robuster as finding out 
which drivers are bound to which devices at removal time is messy.

	Regards
		Oliver

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2001-10-16  8:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-10 20:06 Device count (to be done with) Stamatis Mitrofanis
2001-10-11 15:01 ` Oliver Neukum
2001-10-12 22:53 ` Stamatis Mitrofanis
2001-10-13  8:45 ` Oliver Neukum
2001-10-15  0:15 ` Stamatis Mitrofanis
2001-10-15  9:39 ` Oliver.Neukum
2001-10-15 22:27 ` Stamatis Mitrofanis
2001-10-16  4:03 ` Keith Owens
2001-10-16  5:37 ` Greg KH
2001-10-16  5:59 ` Keith Owens
2001-10-16  7:02 ` David Brownell
2001-10-16  8:23 ` Oliver Neukum [this message]
2001-10-16  8:29 ` Oliver Neukum
2001-10-16  8:47 ` Keith Owens
2001-10-16 12:00 ` Oliver Neukum

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=marc-linux-hotplug-100322589608112@msgid-missing \
    --to=oliver.neukum@lrz.uni-muenchen.de \
    --cc=linux-hotplug@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).