style: cargo fmt sweep under rustc 1.98.1 (toolchain reformat, no semantic change)
Four files were already fmt-dirty on 8fd724a; the merge added none.
This commit is contained in:
+9
-3
@@ -634,16 +634,22 @@ fn main() {
|
||||
run_n("tokio multi-thread", ITERS, bench_pp_tokio_multi);
|
||||
|
||||
// ---- 5. spawn_pair_control ----
|
||||
print_header(&format!("spawn_pair_control: {PP_ROUNDS} rounds, no messages"));
|
||||
print_header(&format!(
|
||||
"spawn_pair_control: {PP_ROUNDS} rounds, no messages"
|
||||
));
|
||||
run_n("smarm 1-thread", ITERS, || bench_ctl_smarm(1));
|
||||
run_n(&format!("smarm {n}-thread"), ITERS, || bench_ctl_smarm(n));
|
||||
run_n("tokio current_thread", ITERS, bench_ctl_tokio_current);
|
||||
run_n("tokio multi-thread", ITERS, bench_ctl_tokio_multi);
|
||||
|
||||
// ---- 6. ping_pong_steady ----
|
||||
print_header(&format!("ping_pong_steady: 1 pair × {PP_STEADY} roundtrips"));
|
||||
print_header(&format!(
|
||||
"ping_pong_steady: 1 pair × {PP_STEADY} roundtrips"
|
||||
));
|
||||
run_n("smarm 1-thread", ITERS, || bench_steady_smarm(1));
|
||||
run_n(&format!("smarm {n}-thread"), ITERS, || bench_steady_smarm(n));
|
||||
run_n(&format!("smarm {n}-thread"), ITERS, || {
|
||||
bench_steady_smarm(n)
|
||||
});
|
||||
run_n("tokio current_thread", ITERS, bench_steady_tokio_current);
|
||||
run_n("tokio multi-thread", ITERS, bench_steady_tokio_multi);
|
||||
}
|
||||
|
||||
@@ -257,7 +257,14 @@ fn main() {
|
||||
mid.us,
|
||||
per_s
|
||||
);
|
||||
println!("RQDIAG,{},{},{},{},{}", variant(), slot_str, name, t, mid.diag);
|
||||
println!(
|
||||
"RQDIAG,{},{},{},{},{}",
|
||||
variant(),
|
||||
slot_str,
|
||||
name,
|
||||
t,
|
||||
mid.diag
|
||||
);
|
||||
if slot {
|
||||
println!(
|
||||
"RQSLOT,{},{},{},{},{}",
|
||||
|
||||
+12
-3
@@ -418,7 +418,9 @@ impl SchedulerStats {
|
||||
/// Bump a per-thread diagnostic counter on the calling scheduler thread.
|
||||
macro_rules! diag {
|
||||
($inner:expr, $field:ident) => {
|
||||
$inner.stats[sched_slot()].$field.fetch_add(1, Ordering::Relaxed)
|
||||
$inner.stats[sched_slot()]
|
||||
.$field
|
||||
.fetch_add(1, Ordering::Relaxed)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -480,7 +482,11 @@ impl RuntimeStats {
|
||||
/// (target 5 instrumentation). Reset at the start of each `run()`.
|
||||
pub fn wake_diag(&self) -> String {
|
||||
let sum = |f: fn(&SchedulerStats) -> &AtomicU64| -> u64 {
|
||||
self.inner.stats.iter().map(|s| f(s).load(Ordering::Relaxed)).sum()
|
||||
self.inner
|
||||
.stats
|
||||
.iter()
|
||||
.map(|s| f(s).load(Ordering::Relaxed))
|
||||
.sum()
|
||||
};
|
||||
format!(
|
||||
"slot_hits={} displaced={} unpark_slot={} unpark_queue={} unpark_notified={} \
|
||||
@@ -1792,7 +1798,10 @@ pub(crate) fn install_actor(
|
||||
stack: crate::stack::Stack,
|
||||
supervisor: Pid,
|
||||
closure: Closure,
|
||||
monitor: Option<(crate::monitor::MonitorId, crate::channel::Sender<crate::monitor::Down>)>,
|
||||
monitor: Option<(
|
||||
crate::monitor::MonitorId,
|
||||
crate::channel::Sender<crate::monitor::Down>,
|
||||
)>,
|
||||
) -> Pid {
|
||||
let slot = &inner.slots[idx as usize];
|
||||
let gen = slot.generation(); // stable: we own the vacant slot via the free list
|
||||
|
||||
+3
-6
@@ -404,7 +404,8 @@ pub fn spawn_monitor_with(
|
||||
let (pid, id) = with_runtime(|inner| {
|
||||
let idx = inner.allocate_slot(); // panics loudly on slab exhaustion
|
||||
let id = inner.alloc_monitor_id();
|
||||
let pid = crate::runtime::install_actor(inner, idx, sp, stack, parent, closure, Some((id, tx)));
|
||||
let pid =
|
||||
crate::runtime::install_actor(inner, idx, sp, stack, parent, closure, Some((id, tx)));
|
||||
(pid, id)
|
||||
});
|
||||
|
||||
@@ -612,11 +613,7 @@ pub(crate) fn runtime_weak() -> Option<Weak<RuntimeInner>> {
|
||||
// (preemption-gated, slot-eligible); off one that path is a silent no-op, so
|
||||
// we reach the runtime through `rt` — the `Weak` the waker captured while it
|
||||
// was in-runtime. Mirrors the IO backend's cross-context wake (io.rs, RFC 018).
|
||||
pub(crate) fn unpark_at_via(
|
||||
pid: Pid,
|
||||
epoch: u32,
|
||||
rt: impl FnOnce() -> Option<Weak<RuntimeInner>>,
|
||||
) {
|
||||
pub(crate) fn unpark_at_via(pid: Pid, epoch: u32, rt: impl FnOnce() -> Option<Weak<RuntimeInner>>) {
|
||||
if try_with_runtime(|inner| inner.unpark_at(pid, epoch)).is_some() {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user