Skip to content

Commit 0e13d3f

Browse files
authored
No need for shadow to notify plugin that shmem operations are done (#1132)
thread_preload was notifying the shim shmem operations were done before sending back the results of each syscall. The shim doesn't do anything in response to this other than send back an acknowledgment message. Removing this drops execution time from 20s to 17s in the "workload" syscall microbenchmark with 512 hosts.
1 parent 0a5d6a5 commit 0e13d3f

2 files changed

Lines changed: 1 addition & 15 deletions

File tree

src/main/host/thread_preload.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -283,19 +283,6 @@ SysCallCondition* threadpreload_resume(Thread* base) {
283283

284284
_threadpreload_flushPtrs(thread);
285285

286-
// We've handled the syscall, so we notify that we are done
287-
// with shmem IPC
288-
ShimEvent ipc_complete_ev = {
289-
.event_id = SHD_SHIM_EVENT_SHMEM_COMPLETE,
290-
};
291-
292-
shimevent_sendEventToPlugin(thread->ipc_blk.p, &ipc_complete_ev);
293-
294-
ShimEvent resp = {0};
295-
shimevent_recvEventFromPlugin(thread->ipc_blk.p, &resp);
296-
297-
utility_assert(resp.event_id == SHD_SHIM_EVENT_SHMEM_COMPLETE);
298-
299286
ShimEvent shim_result;
300287
if (result.state == SYSCALL_DONE) {
301288
// Now send the result of the syscall

src/shim/preload_syscall.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ static SysCallReg _shadow_syscall_event(const ShimEvent* syscall_event) {
134134
shim_shmemHandleWrite(&res);
135135
shim_shmemNotifyComplete(ipc_blk.p);
136136
break;
137-
case SHD_SHIM_EVENT_SHMEM_COMPLETE: shim_shmemNotifyComplete(ipc_blk.p); break;
138137
default: {
139138
error("Got unexpected event %d", res.event_id);
140139
abort();
@@ -211,4 +210,4 @@ long syscall(long n, ...) {
211210
}
212211
va_end(args);
213212
return rv;
214-
}
213+
}

0 commit comments

Comments
 (0)