mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vineet Gupta" <vineetg76@gmail.com>
To: "Chris Snook" <csnook@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Usage semantics of atomic_set ( )
Date: Sat, 12 Jan 2008 10:36:57 -0800	[thread overview]
Message-ID: <9f4f8abe0801121036gfdc14fctdbcc075ac6ae91c4@mail.gmail.com> (raw)
In-Reply-To: <478819EA.2080905@redhat.com>

> What operations are you using to implement spinlocks?

The cpu provides atomic exchange instruction (atomic Read/write
semantics) which forms the back end of spin lock code.
__raw_spin_trylock( ) atomically swaps the lock memory with a reg (set
to 1)

Using a pool of spinlocks rather that original idea of spinlock per
atomic_t anyways seems to be a better idea.
I really appreciate the responses. Thanks a lot

-Vineet

      reply	other threads:[~2008-01-12 18:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11 22:57 Vineet Gupta
2008-01-11 23:16 ` Roland Dreier
2008-01-12  1:37 ` Chris Snook
2008-01-12 18:36   ` Vineet Gupta [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=9f4f8abe0801121036gfdc14fctdbcc075ac6ae91c4@mail.gmail.com \
    --to=vineetg76@gmail.com \
    --cc=csnook@redhat.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®