public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tilman Schmidt <tilman@imap.cc>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Pavel Machek <pavel@suse.cz>,
	kernel list <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	mtk.manpages@gmail.com, rdunlap@xenotime.net,
	linux-doc@vger.kernel.org
Subject: Re: atomics: document that linux expects certain atomic behaviour from unsigned long
Date: Sun, 04 Jan 2009 19:05:45 +0100	[thread overview]
Message-ID: <4960FA79.7040301@imap.cc> (raw)
In-Reply-To: <20090103203044.0166b561@lxorguk.ukuu.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]

On Sat 2009-01-03 20:19:55, Alan Cox wrote:
> On Sat, 3 Jan 2009 13:44:00 +0100
> Pavel Machek <pavel@suse.cz> wrote:
> 
> > Linux relies on unsigned long to behave like atomic for read/write.
> 
> Actually it isn't that simple and this advice shouldn't be given IMHO.
> 
> unsigned long is not the same as atomic in several respects including
> ordering and caching of the result.

I'm confused. I remember distinctly being told, when merging the
Gigaset driver, that reading and writing of "pointer sized objects"
(I specifically remember that term) was assumed to be atomic across
large parts of the kernel anyway, that locking around a single read
or write of such an item was therefore pointless, and that "atomic_t"
only made sense if I wanted to use atomic_inc or atomic_dec on them.
The patches I submitted in following that advice, specifically commit
4d1ff582246de67b15e3cd2427a39875943ae895 "gigaset: remove pointless
locking" and 9d4bee2b9de9e30057a860d2d6794f874caffc5e "gigaset: atomic
cleanup", were confirmed to do the right thing and merged without any
objection.

What am I missing?

Thanks,
Tilman

-- 
Tilman Schmidt                    E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

      parent reply	other threads:[~2009-01-04 18:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-03 12:44 atomics: document that linux expects certain atomic behaviour from unsigned long Pavel Machek
2009-01-03 20:19 ` Alan Cox
2009-01-03 20:27   ` Pavel Machek
2009-01-03 20:30     ` Alan Cox
2009-01-03 20:56       ` Pavel Machek
2009-01-03 23:01         ` david
2009-01-03 23:14         ` Alan Cox
2009-01-05 10:54           ` Nick Piggin
2009-01-05 11:23             ` Alan Cox
2009-01-05 12:00               ` Nick Piggin
2009-01-05 16:05                 ` Paul E. McKenney
2009-01-05 16:25                   ` Nick Piggin
2009-01-05 17:30                     ` Paul E. McKenney
2009-01-05 18:25                       ` Nick Piggin
2009-01-05 22:01                         ` Paul E. McKenney
2009-01-03 23:53         ` Robert Hancock
2009-01-04 18:05       ` Tilman Schmidt [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=4960FA79.7040301@imap.cc \
    --to=tilman@imap.cc \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=pavel@suse.cz \
    --cc=rdunlap@xenotime.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox