public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Stuart MacDonald" <stuartm@connecttech.com>
To: "'Linux Kernel Mailing List'" <linux-kernel@vger.kernel.org>
Subject: Proper use of daemonize()?
Date: Wed, 6 Oct 2004 11:18:07 -0400	[thread overview]
Message-ID: <030601c4abb7$af573770$294b82ce@stuartm> (raw)

I've been looking at the kernel threads that use daemonize() and have
some questions about the proper use of this call:

1: Some threads use the lock_kernel() calls around the daemonize()
call. Is this necessary? I thought the BKL was phasing out.

2: Some threads do their setup (like changing the comm string, setting
the signal masks, etc) before daemonize(), some do it after. Is there
any benefit to a particular order of operations? I can't see one.

3: Some threads set current->tty to NULL. Why would a thread *not* do
this?

4: Some threads grab the sigmask_lock before manipulating their masks.
Is this necessary? If so, some threads have bugs. If not, why do some
threads bother?

5: Some threads do flush_signals() or recalc_sigpending() before
updating their blocked mask, some do it after. Does the order matter?
I suspect not.

6: MOD_INC_USE_COUNT should be used by all threads that could be in
drivers built as modules, correct?

7: If you're not spawning a permanent kernel thread (like kswapd frex)
is the any benefit to using reparent_to_init()? I can't see one.

Thanks,
..Stu


             reply	other threads:[~2004-10-06 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-06 15:18 Stuart MacDonald [this message]
2004-10-06 15:55 ` Proper use of daemonize()? Lee Revell
2004-10-06 16:51 ` Chris Wright

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='030601c4abb7$af573770$294b82ce@stuartm' \
    --to=stuartm@connecttech.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