[parisc-linux] Heavy Iron Reference Docs
John David Anglin
dave at hiauly1.hia.nrc.ca
Sun Apr 30 17:30:03 MDT 2006
> 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.
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
--
J. David Anglin dave.anglin at nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
More information about the parisc-linux
mailing list