public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Philipp Rumpf <prumpf@parcelfarce.linux.theplanet.co.uk>
To: Brian Gerst <bgerst@didntduck.org>
Cc: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PROPOSED PATCH] ATM refcount + firestream
Date: Mon, 30 Oct 2000 15:18:14 +0000	[thread overview]
Message-ID: <20001030151814.F2272@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.21.0010270945510.13233-200000@panoramix.bitwizard.nl> <39F96BE1.B9C97C20@uow.edu.au> <20001028141518.A2272@parcelfarce.linux.theplanet.co.uk> <39FAD698.2FF9C8C8@didntduck.org> <20001028145312.B2272@parcelfarce.linux.theplanet.co.uk> <39FADAC9.DC1255D1@didntduck.org> <20001028160537.C2272@parcelfarce.linux.theplanet.co.uk> <39FAF5BE.C79801A2@didntduck.org>
In-Reply-To: <39FAF5BE.C79801A2@didntduck.org>; from bgerst@didntduck.org on Sat, Oct 28, 2000 at 11:50:22AM -0400

On Sat, Oct 28, 2000 at 11:50:22AM -0400, Brian Gerst wrote:
> Philipp Rumpf wrote:
> > 
> > On Sat, Oct 28, 2000 at 09:55:21AM -0400, Brian Gerst wrote:
> > > Yes, but they can be called (and sleep) with module refcount == 0.  This
> > > is because the file descripter used to perform the ioctl isn't directly
> > > associated with the network device, thereby not incrementing the
> > > refcount on open.
> > 
> > According to my proposal, it is perfectly safe to call a function in a module
> > while the module's use count is 0.  This function would typically look like this:
> > 
> > foo()
> > {
> >         MOD_INC_USE_COUNT;
> > 
> >         copy_*_user() (or anything else that sleeps);
> > 
> >         MOD_DEC_USE_COUNT;
> > 
> >         return bar;
> > }
> > 
> > The only difference to the "old" module scheme is that the above currently isn't
> > safe on SMP systems.
> 
> This will only work while the kernel is not preemptable.  Once the
> kernel thread can be rescheduled, all bets are off.

The implementation will need adjusting for preemptable kernel threads.  The
concept still works fine.	

> With or without your patch, the network ioctls are unsafe, since they
> don't currently do refcounting at all.

I was under the impression most network ioctls didn't sleep.

> Adding it in the layer above thTe
> driver is the easier and cleaner solution.

I disagree.  I dislike special-casing inter-module calls (and that's not even
taking into account that the current implementation of an inter-module call is
quite ugly).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

      parent reply	other threads:[~2000-10-30 15:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-27  7:50 [PROPOSED PATCH] ATM refcount + firestream Patrick van de Lageweg
2000-10-27 11:49 ` Andrew Morton
2000-10-27 13:49   ` Brian Gerst
2000-10-27 14:34   ` Patrick van de Lageweg
2000-10-27 14:49     ` Brian Gerst
2000-10-27 14:56       ` Rogier Wolff
2000-10-28 13:15   ` Philipp Rumpf
2000-10-28 13:37     ` Brian Gerst
2000-10-28 13:53       ` Philipp Rumpf
2000-10-28 13:55         ` Brian Gerst
2000-10-28 15:05           ` Philipp Rumpf
2000-10-28 15:50             ` Brian Gerst
2000-10-28 16:10               ` Andrew Morton
2000-10-30 15:18               ` Philipp Rumpf [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=20001030151814.F2272@parcelfarce.linux.theplanet.co.uk \
    --to=prumpf@parcelfarce.linux.theplanet.co.uk \
    --cc=bgerst@didntduck.org \
    --cc=linux-kernel@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