Skip to content

Commit

Permalink
Add logging to check if stuck in DCM allocation/requests
Browse files Browse the repository at this point in the history
  • Loading branch information
hunhoffe committed Oct 4, 2023
1 parent cddc2e5 commit 138fd92
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions kernel/src/arch/x86_64/rackscale/dcm/affinity_alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ pub(crate) fn dcm_affinity_alloc(
let mut res = AffinityAllocRes { can_satisfy: false };

// Ask DCM to make sure we can safely take from the shmem allocators
log::info!("Calling DCM for affinity alloc request");
DCM_CLIENT.lock().call(
DCMOps::AffinityAlloc as RPCType,
unsafe { &[req.as_bytes()] },
unsafe { &mut [res.as_mut_bytes()] },
)?;
log::info!("Finished calling DCM for affinity alloc request");

// TODO(rackscales): if it fails, ask for memory from somewhere else??
// Maybe implement this with a boolean "force" mode?
Expand Down
9 changes: 8 additions & 1 deletion kernel/src/arch/x86_64/rackscale/dcm/resource_alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub(crate) fn dcm_resource_alloc(
) -> (Vec<MachineId>, Vec<MachineId>) {
// TODO(rackscale): make debug assert
assert!(cores > 0 || memslices > 0);
log::debug!(
log::info!(
"Asking DCM for {:?} cores and {:?} memslices for pid {:?}",
cores,
memslices,
Expand Down Expand Up @@ -146,5 +146,12 @@ pub(crate) fn dcm_resource_alloc(
received_allocations += 1;
}
}
log::info!(
"Received resources from DCM for {:?} cores and {:?} memslices for pid {:?}, assignments: {:?}",
cores,
memslices,
pid,
assignments
);
(dcm_node_for_cores, dcm_node_for_memslices)
}
3 changes: 2 additions & 1 deletion kernel/src/arch/x86_64/rackscale/dcm/resource_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub(crate) fn dcm_resource_release(mid: MachineId, pid: usize, is_core: bool) ->
memslices: if is_core { 0 } else { 1 },
};
let mut res = ResourceReleaseResponse { is_success: 0 };
log::info!("Sending DCM a resource release request");

// Send call, get allocation response in return
{
Expand All @@ -69,7 +70,7 @@ pub(crate) fn dcm_resource_release(mid: MachineId, pid: usize, is_core: bool) ->
)
.expect("Failed to send resource release RPC to DCM");
}
log::debug!(
log::info!(
"Received is_success for DCM resource release: {:?}",
res.is_success
);
Expand Down

0 comments on commit 138fd92

Please sign in to comment.