Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit 79416e8

Browse files
committed
Reduce logging, now that bugs are addressed.
1 parent e4a6d8c commit 79416e8

File tree

3 files changed

+7
-24
lines changed

3 files changed

+7
-24
lines changed

kernel/src/arch/x86_64/rackscale/dcm/affinity_alloc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub(crate) fn dcm_affinity_alloc(node_id: DCMNodeId, num_memslices: usize) -> bo
5454
num_cores: 0,
5555
num_memslices: num_memslices as u64,
5656
};
57-
log::warn!(
57+
log::debug!(
5858
"dcm_affinity_alloc(node={:?}, cores={:?}, memslices={:?})",
5959
node_id,
6060
0,
@@ -71,6 +71,6 @@ pub(crate) fn dcm_affinity_alloc(node_id: DCMNodeId, num_memslices: usize) -> bo
7171
unsafe { &mut [res.as_mut_bytes()] },
7272
)
7373
.expect("Failed to send resource alloc RPC to DCM");
74-
log::warn!("Can the allocation be satisfied? {:?}", res.can_satisfy);
74+
log::debug!("Can the allocation be satisfied? {:?}", res.can_satisfy);
7575
return res.can_satisfy;
7676
}

kernel/src/arch/x86_64/rackscale/dcm/resource_alloc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub(crate) fn dcm_resource_alloc(
5858
) -> (Vec<DCMNodeId>, Vec<DCMNodeId>) {
5959
// TODO(rackscale): make debug assert
6060
assert!(cores > 0 || memslices > 0);
61-
log::warn!(
61+
log::debug!(
6262
"Asking DCM for {:?} cores and {:?} memslices for pid {:?}",
6363
cores,
6464
memslices,
@@ -85,7 +85,7 @@ pub(crate) fn dcm_resource_alloc(
8585
)
8686
.expect("Failed to send resource alloc RPC to DCM");
8787
}
88-
log::warn!("Received allocation id in response: {:?}", res.alloc_id);
88+
log::debug!("Received allocation id in response: {:?}", res.alloc_id);
8989

9090
let mut received_allocations = 0;
9191
let mut dcm_node_for_cores =
@@ -115,7 +115,5 @@ pub(crate) fn dcm_resource_alloc(
115115
_ => unreachable!("Should not reach here"),
116116
}
117117
}
118-
assert!(dcm_node_for_cores.len() as u64 == cores);
119-
assert!(dcm_node_for_memslices.len() as u64 == memslices);
120118
(dcm_node_for_cores, dcm_node_for_memslices)
121119
}

kernel/src/arch/x86_64/rackscale/get_shmem_frames.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub(crate) fn handle_get_shmem_frames(
110110
mut payload: &mut [u8],
111111
state: ControllerState,
112112
) -> Result<ControllerState, RPCError> {
113-
log::warn!("Handling get_shmem_frames()");
113+
log::debug!("Handling get_shmem_frames()");
114114

115115
// Parse request
116116
let (machine_id, pid, num_frames) = match unsafe { decode::<ShmemFrameReq>(payload) } {
@@ -141,14 +141,6 @@ pub(crate) fn handle_get_shmem_frames(
141141
.shmem_manager
142142
.as_mut()
143143
.expect("No shmem manager found for client");
144-
log::warn!(
145-
"Manager for client {:?} ({:?}) free_bp={:?} free_lp={:?} need_lp={:?}",
146-
mid,
147-
node_id,
148-
manager.free_base_pages(),
149-
manager.free_large_pages(),
150-
num_frames
151-
);
152144

153145
for _i in 0..num_frames {
154146
let frame = manager
@@ -165,21 +157,14 @@ pub(crate) fn handle_get_shmem_frames(
165157
let (_, dcm_ids) = dcm_resource_alloc(pid, 0, num_frames as u64);
166158
for i in 0..num_frames {
167159
let dcm_id = dcm_ids[i];
168-
log::warn!("Received node assignment from DCM: node {:?}", dcm_id);
160+
log::debug!("Received node assignment from DCM: node {:?}", dcm_id);
169161

170162
// TODO(error_handling): should handle errors gracefully here, maybe percolate to client?
171163
let mut client_state = state.get_client_state_by_dcm_id(dcm_id).lock();
172164
let mut manager = client_state
173165
.shmem_manager
174166
.as_mut()
175167
.expect("No shmem manager found for client");
176-
177-
// TODO(error): this is where things fail
178-
log::warn!(
179-
"About to allocate large page from shmem manager: free_large:{:?} free_base:{:?}",
180-
manager.free_large_pages(),
181-
manager.free_base_pages()
182-
);
183168
let frame = manager
184169
.allocate_large_page()
185170
.expect("DCM OK'd allocation, this should succeed");
@@ -201,7 +186,7 @@ pub(crate) fn handle_get_shmem_frames(
201186
let additional_data = end - start;
202187
unsafe { encode(&regions, &mut &mut payload[start..end]) }
203188
.expect("Failed to encode shmem region vector");
204-
log::warn!(
189+
log::debug!(
205190
"Sending back {:?} bytes of data ({:?} frames)",
206191
additional_data,
207192
regions.len()

0 commit comments

Comments
 (0)