3 ms·
Just an aligned malloc. The cache line size was eight 64-bit words, so aligning on 64 byte boundaries did the trick. The failure mechanism is when one processo
by drmpeg 8y ago
Just an aligned malloc. The cache line size was eight 64-bit words, so aligning on 64 byte boundaries did the trick.
The failure mechanism is when one processor writes a memory variable, the entire cache line is written. If the variable is within 64 bytes of a variable on the other processor (and in the same cache line), the variable on the other processor gets (possibly) overwritten.
I forget exactly how the aligned malloc was coded. This was 18 years ago and gcc 2.7.2 on SPARC. For the application programmers, we just had an overloaded new operator that was aligned.
- nsb1 8y agoI'm envisioning how this played out... <Motorola Eng Manager ranting away in the background> First LSI engineer: "He seems pretty upset." Second LSI engineer: "Yeah." First LSI engineer: "Think we should do anything?" Second LSI engineer: "Meh, he'll get over it." First LSI engineer: "Still, maybe we should throw him a bone." Second LSI engineer: "<sigh> Fine. I'll add an overloaded new operator after I finish my beer." ... something like that? :)
- drmpeg 8y agoWe had figured out the issue years before that episode. We did write him a nice application note / errata describing the issue. They were just declaring static/global variables that they didn't know were forbidden.