public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <frey@cxau.zko.dec.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: RE: kernel_thread vs. zombie
Date: Thu, 22 Mar 2001 19:47:40 +0100	[thread overview]
Message-ID: <20010322184740.17781@mailhost.mipsys.com> (raw)
In-Reply-To: <007001c0b2f4$a4630110$90600410@SCHLEPPDOWN>
In-Reply-To: <007001c0b2f4$a4630110$90600410@SCHLEPPDOWN>

>The stuff done in daemonize() and the exit_files could need
>the kernel lock. At least on some 2.2.x version it does,
>I did not check whether it is still needed on 2.4.

Well, I don't really plan to backport this to 2.2.x. I'll
try to see if my problem is related to the lack of kernel
lock, or maybe I have just something else wrong.

>On stop of the thread I need the big kernel lock to make
>sure the kernel thread exited (everything really done
>from my up() till the thread is in zombie state) before
>I unload the module. The comment in the code should explain 
>in.

Ok. I don't need that as I'm not in a module, no chances I ever
get unloaded. At least not in 2.4. Making ADB and all the controllers
and device drivers in modules would  be an interesting exercise with
module dependencies ;)

>Note that the threads itself do not run with the kernel lock
>held. After setting everything up the make an unlock.

Ok. Well, I just have an atomic flag test&set'ed before starting the
bus reset, and released at the end of the thread. No need to make sure
the previous one is really dead before starting a new one. I could
benefit from semaphores when starting it since if it's already running,
I just loop scheduling waiting for the lock bit to be available. But
that case will almost never happen in real life. ADB probes are quite
rare.

Many thanks for your help,

I'll see what's wrong in my code ;)

ben.




  reply	other threads:[~2001-03-22 18:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-22 11:49 kernel_thread vs. zombie Benjamin Herrenschmidt
2001-03-22 14:32 ` Martin Frey
2001-03-22 15:07   ` Benjamin Herrenschmidt
2001-03-22 17:21     ` Martin Frey
2001-03-22 18:47       ` Benjamin Herrenschmidt [this message]
2001-03-22 19:50         ` Martin Frey
2001-03-22 23:33           ` Benjamin Herrenschmidt
2001-03-23  0:04             ` Andrew Morton
2001-03-23  1:57               ` Martin Frey
2001-03-23  2:13                 ` Andrew Morton
2001-03-23  8:06                   ` Martin Frey

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=20010322184740.17781@mailhost.mipsys.com \
    --to=benh@kernel.crashing.org \
    --cc=frey@cxau.zko.dec.com \
    --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