mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv: sched_iorr: Add IO sensitive Round-robin scheduler
IO sensitive Round-robin scheduler aim to schedule threads with round-robin policy. Meanwhile, we also enhance it with some fairness configuration, such as thread will be scheduled out without properly timeslice. IO request on thread will be handled in high priority. This patch only add a skeleton for the sched_iorr scheduler. Tracked-On: #4178 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Signed-off-by: Yu Wang <yu1.wang@intel.com> Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
54
hypervisor/common/sched_iorr.c
Normal file
54
hypervisor/common/sched_iorr.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <list.h>
|
||||
#include <per_cpu.h>
|
||||
#include <schedule.h>
|
||||
|
||||
struct sched_iorr_data {
|
||||
/* keep list as the first item */
|
||||
struct list_head list;
|
||||
|
||||
uint64_t slice_cycles;
|
||||
uint64_t last_cycles;
|
||||
int64_t left_cycles;
|
||||
};
|
||||
|
||||
int sched_iorr_init(__unused struct sched_control *ctl)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sched_iorr_deinit(__unused struct sched_control *ctl)
|
||||
{
|
||||
}
|
||||
|
||||
void sched_iorr_init_data(__unused struct thread_object *obj)
|
||||
{
|
||||
}
|
||||
|
||||
static struct thread_object *sched_iorr_pick_next(__unused struct sched_control *ctl)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void sched_iorr_sleep(__unused struct thread_object *obj)
|
||||
{
|
||||
}
|
||||
|
||||
static void sched_iorr_wake(__unused struct thread_object *obj)
|
||||
{
|
||||
}
|
||||
|
||||
struct acrn_scheduler sched_iorr = {
|
||||
.name = "sched_iorr",
|
||||
.init = sched_iorr_init,
|
||||
.init_data = sched_iorr_init_data,
|
||||
.pick_next = sched_iorr_pick_next,
|
||||
.sleep = sched_iorr_sleep,
|
||||
.wake = sched_iorr_wake,
|
||||
.deinit = sched_iorr_deinit,
|
||||
};
|
Reference in New Issue
Block a user