forked from SESA/EbbRT
-
Notifications
You must be signed in to change notification settings - Fork 1
May 24th, 2013
Jim Cadden edited this page May 23, 2013
·
4 revisions
Problem: Root construction may make ebb calls, hit a deadlock. Current implementation acquires a lock for both root and factory table.
Proposed Solution: While loop, locks (or compare-and-swaps) on table lookups. Upon first construction, a placeholder is inserted into the root table
Three options:
- No synchronous operations, wasteful spinning/polling structures to adhere behavior to system called defined to be synchronous (e.g., write)
- Preemptive threading (too large)
- Coarperative threading. Each event consists of an interrupt and an execution context. We are allowed to block a context, allowing an additional context to execute, while is synchronous operation is being processes. An context can be yielded (saved) with the event manager, with the intention that the context get be restored during a different context (e.g., the arrives of writes' "ack" message)
The following steps occur when the first non statically constructed ebb is defined and then called:
- Define a new ebb named
enet
of Ebb typeEthernet
Ebb<Ethernet> enet (ebb_manager->allocateID())
- Bind ebb to an root construction "factory"
ebb_manager->bind(virtio::construct_root, enet)
- Make an ebb call
enet->AllocateBuffer()
- Call will miss on local translation table and end up in
lrt::_trans_precall()
, which in turn will call the installed miss handler. - The default miss handler will resolve to
InitRoot::PreCall
- The call will again miss, this time on the initial (primative) root table that contains the statically constructed ebbs. This will require a call to
ebb_manager->Install()
- If this is the first install, the ebb_manager will need to lock, allocate local data structures, copy over primative root table entries, and construct the root.
- Finally, the constructed ebb root of enet will
root->PreCall
which will cache the rep into the local translation table, avoiding further misses.