mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Werner Almesberger <wa@almesberger.net>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
	Alexander Viro <viro@math.psu.edu>
Subject: Re: Module Refcount & Stuff mini-FAQ
Date: Sun, 24 Nov 2002 23:07:58 -0300	[thread overview]
Message-ID: <20021124230758.A1549@almesberger.net> (raw)
In-Reply-To: <20021125003005.15F762C095@lists.samba.org>; from rusty@rustcorp.com.au on Mon, Nov 25, 2002 at 09:50:46AM +1100

Rusty Russell wrote:
> Q: But the modules' init routine calls my register() routine which
>    wants to call back into one of the function pointers immediately,
>    and so try_module_get() fails! (because the module is not finished
>    initializing yet)
> A: You're being called from the module, so someone already has a
>    reference (unless there's a bug), so you don't need a
>    try_module_get().

Hmm, I wouldn't call this the answer. How about:
 - Q: why does it fail ?
 - A: because you're initializing
 - solution: but since you're calling from a module, and the call
   goes back to the same module, you don't have to worry

This raises the question: why is this a special case ? The
registration function shouldn't have to know all these details.
(That's the whole point of try_module_get, isn't it ?)

Wouldn't it be possible to simply allow try_module_get also
while the module is initializing ?

> Well, if we continue to start modules unisolated, I need to rewrite
> the FAQ anyway...

Does "unisolated" mean that try_module_get would work ? If yes,
you've already solved the problem ;-)

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/

  reply	other threads:[~2002-11-25  2:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-18 22:58 Rusty Russell
2002-11-19  2:30 ` Werner Almesberger
2002-11-24 22:50   ` Rusty Russell
2002-11-25  2:07     ` Werner Almesberger [this message]
2002-11-25  2:27       ` Rusty Russell
2002-11-25  6:39         ` Werner Almesberger
2002-11-25 22:43           ` Rusty Russell
2002-11-26  2:26             ` Werner Almesberger
2002-11-26  3:16               ` Rusty Russell
2002-11-26  7:12                 ` Werner Almesberger
2002-11-26 22:56                   ` Rusty Russell
2002-11-19  2:40 ` John Levon
2002-11-24 23:02   ` Rusty Russell
2002-11-25  0:38     ` John Levon
2002-11-19  3:10 ` kksymoops Jeff Garzik
2002-11-19  3:50   ` kksymoops Jeff Garzik
2002-11-19 21:10   ` kksymoops Rusty Russell
2002-11-20 15:46     ` kksymoops Kai Germaschewski
2002-11-23 22:23 ` Module Refcount & Stuff mini-FAQ Pavel Machek
2002-11-25  0:26   ` Rusty Russell
2002-11-19 19:18 Adam J. Richter
2002-11-20 12:25 Adam J. Richter

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=20021124230758.A1549@almesberger.net \
    --to=wa@almesberger.net \
    --cc=dledford@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=viro@math.psu.edu \
    /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®