From 6546b215811df836eae44fa7762979716e8f4af4 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Wed, 21 Jun 2023 01:06:25 +0000 Subject: [PATCH] wip --- tokio/src/runtime/scheduler/multi_thread/stats.rs | 1 - tokio/src/runtime/scheduler/multi_thread/worker.rs | 3 +++ tokio/src/runtime/task/core.rs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tokio/src/runtime/scheduler/multi_thread/stats.rs b/tokio/src/runtime/scheduler/multi_thread/stats.rs index cc641df54..ce215e3fd 100644 --- a/tokio/src/runtime/scheduler/multi_thread/stats.rs +++ b/tokio/src/runtime/scheduler/multi_thread/stats.rs @@ -1,7 +1,6 @@ use crate::runtime::{Config, MetricsBatch, WorkerMetrics}; use std::cmp; -use std::f32::consts::E; use std::time::{Duration, Instant}; /// Per-worker statistics. This is used for both tuning the scheduler and diff --git a/tokio/src/runtime/scheduler/multi_thread/worker.rs b/tokio/src/runtime/scheduler/multi_thread/worker.rs index 1029c77d5..7c3cd6c55 100644 --- a/tokio/src/runtime/scheduler/multi_thread/worker.rs +++ b/tokio/src/runtime/scheduler/multi_thread/worker.rs @@ -826,6 +826,9 @@ impl Worker { #[cfg(loom)] const ROUNDS: usize = 1; + debug_assert!(core.lifo_slot.is_none()); + debug_assert!(core.run_queue.is_empty()); + if !self.transition_to_searching(cx, core) { return None; } diff --git a/tokio/src/runtime/task/core.rs b/tokio/src/runtime/task/core.rs index 640ed42bb..779cfa90a 100644 --- a/tokio/src/runtime/task/core.rs +++ b/tokio/src/runtime/task/core.rs @@ -29,6 +29,7 @@ use std::task::{Context, Poll, Waker}; /// Any changes to the layout of this struct _must_ also be reflected in the /// const fns in raw.rs. #[repr(C)] +#[repr(align(128))] pub(super) struct Cell { /// Hot task state data pub(super) header: Header,