Project

General

Profile

Feature #541

SMP mesage passing must enforce memory ordering consistency

Added by Phil Miller almost 5 years ago. Updated about 1 year ago.

Status:
Merged
Priority:
Normal
Assignee:
Category:
SMP
Target version:
Start date:
07/28/2014
Due date:
% Done:

0%


Description

When one PE passes a message to another PE within the same process, memory consistency should require that subsequent code executed as a result of that message read the right data.

I believe the right semantics for this are as follows:
  1. Placing a message in a queue should be under memory_order_release
  2. Receivers like the comm thread that will only read from shared data derived from the message need to pick up the message with memory_order_consume
  3. Receivers of a message that may infer broader synchronization from the message's delivery (i.e. some shared state outside the mesage having been updated) need to pick up the message with memory_order_acquire

The distinction between the latter two cases matters on machines that implement consistency of 'dependent loads' - if all loads to shared data is through the message itself, then they are guaranteed to be consistent with what was written before the message's deposit. On machines like POWER and ARM, this can provide a performance advantage. However, it's not clear whether receivers will necessarily be able to make that distinction without introducing some additional overheard (like a separate queue to/from the comm thread). If they can't, then we'll just have to use memory_order_acquire uniformly.


Related issues

Related to Charm++ - Cleanup #536: Data Races in SMP PCQueue Merged 07/28/2014
Related to Charm++ - Feature #1184: SMP-safe CmiReference and CmiFree Implemented 08/24/2016

History

#1 Updated by Nikhil Jain over 3 years ago

  • Target version changed from 6.7.0 to 6.8.0

#2 Updated by Eric Bohm over 2 years ago

  • Target version changed from 6.8.0 to 6.8.1

#3 Updated by Sam White over 2 years ago

  • Category set to SMP

#4 Updated by Eric Bohm almost 2 years ago

  • Target version changed from 6.8.1 to 6.9.0

#5 Updated by Eric Bohm over 1 year ago

  • Assignee set to Seonmyeong Bak

This appears to require an audit of memory consistency usage throughout machine-smp.

#6 Updated by Phil Miller over 1 year ago

Per the C++ standards committee, memory_order_consume has been temporarily deprecated while its broken definition gets fixed. Just use memory_order_acquire in its place until then.

#7 Updated by Eric Bohm over 1 year ago

#8 Updated by Eric Bohm over 1 year ago

  • Assignee changed from Seonmyeong Bak to Phil Miller

#9 Updated by Phil Miller over 1 year ago

  • Assignee changed from Phil Miller to Nitin Bhat

#10 Updated by Nitin Bhat over 1 year ago

  • Status changed from New to In Progress

#11 Updated by Nitin Bhat over 1 year ago

  • Status changed from In Progress to Implemented

#12 Updated by Eric Bohm about 1 year ago

  • Related to Feature #1184: SMP-safe CmiReference and CmiFree added

#13 Updated by Sam White about 1 year ago

  • Status changed from Implemented to Merged

Also available in: Atom PDF