Skip to content

Commit fcbd789

Browse files
leitaorafaeljw
authored andcommitted
cpuidle: menu: Remove incorrect unlikely() annotation
The unlikely() annotation on the early-return condition in menu_select() is incorrect on systems with only one idle state (e.g., ARM64 servers with a single ACPI LPI state). Branch profiling shows 100% misprediction on such systems since drv->state_count <= 1 is always true. On platforms where only state0 is available, this path is the common case, not an unlikely edge case. Remove the misleading annotation to let the branch predictor learn the actual behavior. Signed-off-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20260105-annotated_idle-v1-1-10ddf0771b58@debian.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent be6a150 commit fcbd789

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/cpuidle/governors

drivers/cpuidle/governors/menu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
271271
data->bucket = BUCKETS - 1;
272272
}
273273

274-
if (unlikely(drv->state_count <= 1 || latency_req == 0) ||
274+
if (drv->state_count <= 1 || latency_req == 0 ||
275275
((data->next_timer_ns < drv->states[1].target_residency_ns ||
276276
latency_req < drv->states[1].exit_latency_ns) &&
277277
!dev->states_usage[0].disable)) {

0 commit comments

Comments
 (0)