// SPDX-License-Identifier: GPL-2.0 /* * haltpoll.c - haltpoll idle governor * * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. * * Authors: Marcelo Tosatti <mtosatti@redhat.com>
*/
/* value in us to start growing per-cpu halt_poll_ns */ staticunsignedint guest_halt_poll_grow_start __read_mostly = 50000;
module_param(guest_halt_poll_grow_start, uint, 0644);
/** * haltpoll_select - selects the next idle state to enter * @drv: cpuidle driver containing state data * @dev: the CPU * @stop_tick: indication on whether or not to stop the tick
*/ staticint haltpoll_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, bool *stop_tick)
{
s64 latency_req = cpuidle_governor_latency_req(dev->cpu);
val = dev->poll_limit_ns; if (shrink == 0) {
val = 0;
} else {
val /= shrink; /* Reset value to 0 if shrunk below grow_start */ if (val < guest_halt_poll_grow_start)
val = 0;
}
/** * haltpoll_reflect - update variables and update poll time * @dev: the CPU * @index: the index of actual entered state
*/ staticvoid haltpoll_reflect(struct cpuidle_device *dev, int index)
{
dev->last_state_idx = index;
if (index != 0)
adjust_poll_limit(dev, dev->last_residency_ns);
}
/** * haltpoll_enable_device - scans a CPU's states and does setup * @drv: cpuidle driver * @dev: the CPU
*/ staticint haltpoll_enable_device(struct cpuidle_driver *drv, struct cpuidle_device *dev)
{
dev->poll_limit_ns = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.