What are four granularities at which we can share state?
What are the tradeoffs associated with sharing at the granularity of the cache line?
What are the tradeoffs associated with sharing at the granularity of the variable?
PROS
This level of granularity makes it possible for programmers to specify sharing semantics on a per-variable basis
CONS
This level of sharing is still too fine-grained, and the level of network overhead will still be too high.
What are the tradeoffs associated with sharing at the granularity of the page?
PROS
CONS
- Like any larger granularity, false sharing is a potential issue (which can occur when two processes are concurrently accessing different portions of the same page. In this case, the coherence traffic that gets generated is unnecessary)
What are the tradeoffs associated with sharing at the granularity of the object?
PROS
CONS
For distributed state management systems (think distributed shared memory) to maintain consistency, what abilities must it have?
Why do we differentiate between a global index structure to find the home nodes and local index structure about the portion of state they are responsible for?
Do you have some ideas about how you would go about implementing a distributed shared memory system?
The OS should be involved when we try to access shared memory, but not when we try to access local memory.
We also need the OS involved when a process tries to write a piece of shared data, but not local data.
What’s a consistency model?
A consistency model is an agreement between state (memory for example) and upper software layers.
It guarantees that state changes will be made visible to upper-level applications if those applications follow certain behaviors.
What is a strict consistency model?
A strict consistency model guarantees:
This strategy is not possible in practice. SMPs do not even offer this guarantee on single nodes. The added latency and message reordering/loss makes this even harder.
What is a sequential consistency model?
This is next best to the strict consistency model.
EXTRAS
What is a causal consistency model?
This is a little less strict than sequential consistency.
EXTRA:
What is a weak consistency model?
Instead of inferring causal relationships on its own, a weak consistency model makes a new operation available to the upper software layers: synchronization points.
What are the four consistency models discussed in this course?
What is Distributed Shared Memory?
Distributed shared memory is a service that manages memory across multiple nodes so that applications will have the illusion that they are running on a single shared-memory machine.
Why is Distributed Shared Memory important?
Distributed shared memory mechanisms are important because they permit scaling beyond the limitations of how much memory we can include in a single machine.
Single machines with large amounts of memory can cost hundreds of thousands of dollars per machine. In order to scale up memory affordably, it’s imperative to understand DSM concepts and semantics so many cheap machines can be connected to give the illusion of a high memory “single” machine.
Describe hardware DSM
Hardware-supported DSM relies on some physical interconnect. The OS running on each physical node is under the impression that it has access to much larger physical memory, and is allowed to establish virtual to physical mappings that point to physical addresses on other nodes.
Memory accesses that reference remote memory locations are passed to the network interconnect card, which translates remote memory accesses into interconnect messages that are then passed to the correct remote node.
The NICs are involved in all aspects of the memory management, access and consistency and even support some atomics.
While it’s very convenient to rely on hardware to do everything, this type of hardware is typically very expensive and as a result is reserved for very high-end machines.
What four things does a software DSM system have to do?
DSM is often realized in software. The software will have to
What is a cache line?
The smallest unit of memory that can be transferred between the main memory and the cache.
Rather than reading a single word or byte from main memory at a time, each cache entry is usually holds a certain number of words, known as a “cache line” or “cache block” and a whole line is read and cached at once. This takes advantage of the principle of locality of reference.
What is false sharing?
False sharing occurs when a process accesses data that is not being altered by another process, but shares a cache block with it (like a page, or an object). This triggers coherence mechanisms even though they are unnecessary.
Consider a page that internally has two variables, x and y. A process on one node is exclusively accessing and modifying x. Similarly, a process on another node is exclusively accessing and modifying y. When x and y are on the same page, the DSM system will interpret the two write accesses as an indication of concurrent access to a shared page. This will trigger coherence mechanisms which, while logically viable, are functionally superfluous.
How do the basic cloud computing service models differ?
The offerings differ primarily along the axis of ownership, with cloud providers owning different portions of an application stack for different models.
How do we find a particular page in a DSM system?
First we check the global map for the manager node, then check the manager node for page (object) metadata.
GLOBAL MAP (replicated across nodes)
LOCAL PAGE METADATA (partitioned across nodes)
- Each manager node has all info for the page (object) that it manages
What do we do if we want more flexibility from our global map?
The global map uses the page address to find the manager node. If we want to change the manager, we have to change the page address!
Instead, we can use a Global Mapping Table. This uses the object (page) ID to index into a table that returns the manager node. So instead changing the object address, we can just edit the table.
How does the sequential consistency model treat operations from the same process?
They must maintain their original ordering