All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	OpenIPMI Developers <openipmi-developer@lists.sourceforge.net>,
	Konstantin Baydarov <kbaidarov@ru.mvista.com>
Subject: Re: [PATCH 3/4] IPMI: convert locked counters to atomics
Date: Thu, 14 Feb 2008 13:33:10 -0600	[thread overview]
Message-ID: <47B49776.7000802@acm.org> (raw)
In-Reply-To: <20080214111143.7e0937ea.akpm@linux-foundation.org>

Andrew Morton wrote:
>> +	for (i = 0; i < IPMI_NUM_STATS; i++)
>> +		atomic_set(&intf->stats[i], 0);
>>     
>
> And this is why it would be very hard for any architecture to ever
> implement atomic_t as
>
> struct atomic_t {
> 	int counter;
> 	spinlock_t lock;
> };
>
> The interface assumes that atomic_set() fully initialises the atomic_t, and
> that atomic_set() can be used agaisnt both an uninitialised atomic_t and
> against an already-initialised atomic_t.  IOW, we don't have atomic_init().
>
> So would our hypothetical future architcture's atomic_set() do spin_lock(),
> or would it do spin_lock_init()?  Either one is wrong in many atomic_set
> callsites.
>
> Oh well.
>   
Yeah, I thought the same thing when I did this.  Do we start working
on an atomic_init()?  It would be easy enough to set it to atomic_set()
for current architectures.

-corey

  reply	other threads:[~2008-02-14 20:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14 18:30 [PATCH 3/4] IPMI: convert locked counters to atomics Corey Minyard
2008-02-14 19:11 ` Andrew Morton
2008-02-14 19:33   ` Corey Minyard [this message]
2008-02-14 20:23     ` Andrew Morton
2008-02-15 13:57 ` Peter Zijlstra
2008-02-15 14:08   ` [Openipmi-developer] " Corey Minyard
2008-02-16 16:44 ` Matt Domsch
2008-02-20 15:20   ` Corey Minyard

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=47B49776.7000802@acm.org \
    --to=minyard@acm.org \
    --cc=akpm@linux-foundation.org \
    --cc=kbaidarov@ru.mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    /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.