linux/drivers/cpuidle/governors/haltpoll.c

// 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 <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/cpuidle.h>
#include <linux/time.h>
#include <linux/ktime.h>
#include <linux/hrtimer.h>
#include <linux/tick.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/kvm_para.h>
#include <trace/events/power.h>

static unsigned int guest_halt_poll_ns __read_mostly =;
module_param(guest_halt_poll_ns, uint, 0644);

/* division factor to shrink halt_poll_ns */
static unsigned int guest_halt_poll_shrink __read_mostly =;
module_param(guest_halt_poll_shrink, uint, 0644);

/* multiplication factor to grow per-cpu poll_limit_ns */
static unsigned int guest_halt_poll_grow __read_mostly =;
module_param(guest_halt_poll_grow, uint, 0644);

/* value in us to start growing per-cpu halt_poll_ns */
static unsigned int guest_halt_poll_grow_start __read_mostly =;
module_param(guest_halt_poll_grow_start, uint, 0644);

/* allow shrinking guest halt poll */
static bool guest_halt_poll_allow_shrink __read_mostly =;
module_param(guest_halt_poll_allow_shrink, bool, 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
 */
static int haltpoll_select(struct cpuidle_driver *drv,
			   struct cpuidle_device *dev,
			   bool *stop_tick)
{}

static void adjust_poll_limit(struct cpuidle_device *dev, u64 block_ns)
{}

/**
 * haltpoll_reflect - update variables and update poll time
 * @dev: the CPU
 * @index: the index of actual entered state
 */
static void haltpoll_reflect(struct cpuidle_device *dev, int index)
{}

/**
 * haltpoll_enable_device - scans a CPU's states and does setup
 * @drv: cpuidle driver
 * @dev: the CPU
 */
static int haltpoll_enable_device(struct cpuidle_driver *drv,
				  struct cpuidle_device *dev)
{}

static struct cpuidle_governor haltpoll_governor =;

static int __init init_haltpoll(void)
{}

postcore_initcall(init_haltpoll);