From: "Michael S. Zick" <mszick@morethan.org>
To: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
Cc: kyle@mcmartin.ca, parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] Heavy Iron Reference Docs
Date: Sun, 30 Apr 2006 22:23:18 -0500 [thread overview]
Message-ID: <200604302223.18736.mszick@morethan.org> (raw)
In-Reply-To: <200604302330.k3UNU3C5017984@hiauly1.hia.nrc.ca>
On Sun April 30 2006 18:30, John David Anglin wrote:
> > Somewhere it is written: "No data should be stored on the same cache
> > line as the lock unless all access is protected by that lock."
>
> It's in the arch:
>
> When using semaphores to synchronize with I/O, care must be taken
> in placing other information in the same cache line as the semaphore.
> Data which is writable, can only be placed in the same cache line as
> a semaphore if access to write the data is controlled by the semaphore.
>
> I think it's easy to misread these two sentences (i.e., to assume
> that writeable data can occur on the same line as the semaphore
> if the semaphore isn't being used to synchonize with I/O).
>
> I'm almost certain we have more than one semaphore per line in current
> kernels and I think that using ldcw,co is dangerous when that's done.
>
Been giving that some thought, mixed with the prior weeks findings...
Consider;
Two processors;
Two semaphores, unrelated by any program logic, except they share
the same cache line;
Each of the processors grabs an 'unrelated' semaphore -
No matter how I work that problem, there is a failure window in at
least one of the event order sequences.
I agree: "Don't do that (tm)"
Mike
> ldcw appears safer because it does a flush if needed. Still, I worry
> that this may not be sufficient because a sync is usually also necessary.
> Flushes are weakly ordered.
>
> If we dedicate 128 bytes per semaphore, then possibly ldcw,co will work.
> It's also optimal from the contention standpoint. This is pointed out
> in the paper on semaphores.
>
> Dave
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
next prev parent reply other threads:[~2006-05-01 3:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-30 3:50 [parisc-linux] Heavy Iron Reference Docs Michael S. Zick
2006-04-30 4:36 ` John David Anglin
2006-04-30 17:13 ` Kyle McMartin
2006-04-30 21:25 ` John David Anglin
2006-04-30 23:01 ` Michael S. Zick
2006-04-30 23:28 ` Michael S. Zick
2006-05-02 6:24 ` Grant Grundler
2006-05-02 11:27 ` Michael S. Zick
2006-04-30 23:30 ` John David Anglin
2006-05-01 3:23 ` Michael S. Zick [this message]
2006-05-02 6:00 ` Grant Grundler
2006-05-02 15:10 ` John David Anglin
2006-05-02 15:13 ` Kyle McMartin
2006-05-02 15:41 ` John David Anglin
2006-04-30 7:03 ` Grant Grundler
2006-04-30 13:12 ` Michael S. Zick
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=200604302223.18736.mszick@morethan.org \
--to=mszick@morethan.org \
--cc=dave@hiauly1.hia.nrc.ca \
--cc=kyle@mcmartin.ca \
--cc=parisc-linux@lists.parisc-linux.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.