public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@innominate.de>
To: Roman Zippel <zippel@fh-brandenburg.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] move xchg/cmpxchg to atomic.h
Date: Tue, 02 Jan 2001 23:05:01 +0100	[thread overview]
Message-ID: <3A52508D.72C5419D@innominate.de> (raw)
In-Reply-To: <200101021121.DAA14657@pizda.ninka.net> <Pine.GSO.4.10.10101022125570.20383-100000@zeus.fh-brandenburg.de>

Roman Zippel wrote:
> 
> On Tue, 2 Jan 2001, David S. Miller wrote:
> 
> >    We really can't.  We _only_ have load-and-zero.  And it has to be
> >    16-byte aligned.  xchg() is just not something the CPU implements.
> >
> > Oh bugger... you do have real problems.
> 
> For 2.5 we could move all the atomic functions from atomic.h, bitops.h,
> system.h and give them a common interface. We could also give them a new
> argument atomic_spinlock_t, which is a normal spinlock, but only used on
> architectures which need it, everyone else can "optimize" it away. I think
> one such lock per major subsystem should be enough, as the lock is only
> held for a very short time, so contentation should be no problem.
> Anyway, this had the huge advantage that we could use the complete 32/64
> bit of the atomic value, e.g. for pointer operations.

*Yes*, and I could write:
	waiters = xchg(&bdflush_waiters.counter, 0);

instead of:
        waiters = atomic_read(&bdflush_waiters);
        atomic_sub(waiters, &bdflush_waiters);

in my daemon wakeup patch.

--
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-02 22:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-02  8:11 [PATCH] move xchg/cmpxchg to atomic.h Grant Grundler
2001-01-02  9:03 ` David S. Miller
2001-01-02 11:22   ` Matthew Wilcox
2001-01-02 11:21     ` David S. Miller
2001-01-02 20:44       ` Roman Zippel
2001-01-02 22:05         ` Daniel Phillips [this message]
2001-01-02 11:59     ` Andi Kleen
2001-01-02 17:18       ` Alan Cox
2001-01-02 19:51         ` Linus Torvalds
2001-01-02 20:39   ` Grant Grundler

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=3A52508D.72C5419D@innominate.de \
    --to=phillips@innominate.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zippel@fh-brandenburg.de \
    /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