All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jack Stone <jack@hawkeye.stone.uk.eu.org>
To: Roland Dreier <rdreier@cisco.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Spinlock init
Date: Wed, 20 Jun 2007 21:31:29 +0100	[thread overview]
Message-ID: <46798EA1.6020102@hawkeye.stone.uk.eu.org> (raw)
In-Reply-To: <ada4pl29xph.fsf@cisco.com>

Roland Dreier wrote:
>  > can rwlock_init and spin_lock_init be used outside of functions declared
>  > __init. The spinlock documentation suggests that it can't but I'd like
>  > someone to confirm that.
> 
> Those function can be used in any function.  A function is declared
> __init if it only runs during the kernel startup, so that the memory
> holding the code for __init functions can be freed once startup is
> done.  However, spin_lock_init() is just used to initialize a freshly
> allocated spinlock, and spinlocks may be allocated at any time, even
> long after the kernel is done starting up.  A quick look throught
> kernel source code will show many, many examples where
> spin_lock_init(), rwlock_init(), mutex_init(), etc. are called from
> non-__init functions.

Exactly what I wanted to hear. Thank you very much.

Jack


      reply	other threads:[~2007-06-20 20:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-20 20:12 Spinlock init Jack Stone
2007-06-20 20:29 ` Roland Dreier
2007-06-20 20:31   ` Jack Stone [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=46798EA1.6020102@hawkeye.stone.uk.eu.org \
    --to=jack@hawkeye.stone.uk.eu.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdreier@cisco.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.