From: Roland Dreier <rdreier@cisco.com>
To: "Robert P. J. Day" <rpjday@mindspring.com>
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>,
Milind Arun Choudhary <milindchoudhary@gmail.com>,
kernel-janitors@lists.osdl.org, kernelnewbies@nl.linux.org,
linux-kernel@vger.kernel.org
Subject: Re: [KJ]remove SPIN_LOCK_UNLOCKED
Date: Tue, 10 Apr 2007 14:58:37 -0700 [thread overview]
Message-ID: <ada3b37q4c2.fsf@cisco.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0704101743520.24794@CPE00045a9c397f-CM001225dbafb6> (Robert P. J. Day's message of "Tue, 10 Apr 2007 17:45:07 -0400 (EDT)")
> > Don't worry about the __RAW_SPIN_LOCK_UNLOCKED stuff, that's
> > obviously not for generic code to use. The right answer (as I said
> > before) is to use DEFINE_SPINLOCK().
>
> that works fine if you're defining a single spinlock, but what do you
> do in cases like this:
>
> arch/sparc/lib/atomic32.c: [0 ... (ATOMIC_HASH_SIZE-1)] = SPIN_LOCK_UNLOCKED
>
> that is, when you're assigning an array of them? you still need some
> kind of generic, unnamed spinlock in those circumstances, no?
Wow, I didn't realize there was code doing that. I guess for that
handful of cases, you indeed would probably want to convert them to
raw_spinlock_t and use __RAW_SPIN_LOCK_UNLOCKED. But in the vast
majority of cases, DEFINE_SPINLOCK() is the right think to do.
- R.
next prev parent reply other threads:[~2007-04-10 21:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-10 18:16 [KJ]remove SPIN_LOCK_UNLOCKED Milind Arun Choudhary
2007-04-10 20:50 ` Jan Engelhardt
2007-04-10 21:13 ` Roland Dreier
2007-04-10 21:25 ` Robert P. J. Day
2007-04-10 21:28 ` Jan Engelhardt
2007-04-10 21:42 ` Roland Dreier
2007-04-10 21:45 ` Robert P. J. Day
2007-04-10 21:58 ` Roland Dreier [this message]
2007-04-10 22:08 ` [KJ] remove SPIN_LOCK_UNLOCKED Matthew Wilcox
2007-04-11 4:09 ` Milind Arun Choudhary
2007-04-11 5:47 ` Robert P. J. Day
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=ada3b37q4c2.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=jengelh@linux01.gwdg.de \
--cc=kernel-janitors@lists.osdl.org \
--cc=kernelnewbies@nl.linux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=milindchoudhary@gmail.com \
--cc=rpjday@mindspring.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox