All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Roland Dreier <rdreier@cisco.com>
Cc: Mike Frysinger <vapier@gentoo.org>,
	Luca Barbieri <luca@luca-barbieri.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib/atomic64_test: do not build on non-atomic64 systems
Date: Sun, 24 Oct 2010 18:52:08 -0700	[thread overview]
Message-ID: <20101024185208.6a7e0648.akpm@linux-foundation.org> (raw)
In-Reply-To: <adavd4ro94d.fsf@cisco.com>

On Sun, 24 Oct 2010 09:20:34 -0700 Roland Dreier <rdreier@cisco.com> wrote:

>  > That's only part of the problem.  The following won't build also:
> 
>  > drivers/infiniband/hw
> 
> Interesting... I hadn't looked at that usage before.  Both drivers that
> seem to use atomic64 already depend on 64BIT in Kconfig, so I suspect
> the intersection of 64BIT and !ATOMIC64 is empty?
> 
> But eg drivers/infiniband/hw/qib/qib_rc.c does essentially:
> 
> 	atomic64_t *maddr;
> 	u64 sdata = <something>
> 	...
> 	maddr = (atomic64_t *) qp->r_sge.sge.vaddr;
> 	atomic64_add_return(sdata, maddr)
> 
> is it legit to cast some random address to atomic64_t and expect it to
> work across archs that implement atomic64?

Not really.  If someone implements atomic64 on 32-bit they may 
do it by putting a spinlock in the atomic64_t.  Or they might use
hashed spinlocks, in which case that'll work.

Probably hashed spinlocks, given the (realtively new) convention that
the all-zeroes pattern is a legit way of initialising an atomic_t.


      reply	other threads:[~2010-10-25  1:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-16 17:27 [PATCH] lib/atomic64_test: do not build on non-atomic64 systems Mike Frysinger
2010-10-21 22:02 ` Andrew Morton
2010-10-21 22:23   ` Mike Frysinger
2010-10-21 22:55     ` Andrew Morton
2010-10-21 23:04       ` Mike Frysinger
2010-10-21 23:24         ` Andrew Morton
2010-10-22 20:14           ` Mike Frysinger
2010-10-22 20:31             ` Andrew Morton
2010-10-22 20:47               ` Mike Frysinger
2010-10-22 21:00                 ` Andrew Morton
2010-10-22 21:07                   ` Mike Frysinger
2010-10-24 16:20               ` Roland Dreier
2010-10-25  1:52                 ` Andrew Morton [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=20101024185208.6a7e0648.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca@luca-barbieri.com \
    --cc=rdreier@cisco.com \
    --cc=vapier@gentoo.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 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.