Skip to content

Commit

Permalink
Change the name, GVFS to GVTS
Browse files Browse the repository at this point in the history
  • Loading branch information
cdkimcode committed Jul 9, 2018
1 parent 4c01726 commit a0bc18c
Show file tree
Hide file tree
Showing 17 changed files with 472 additions and 472 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,7 +1,7 @@
VERSION = 4
PATCHLEVEL = 6
SUBLEVEL = 4
EXTRAVERSION = -gvfs
EXTRAVERSION = -gvts
NAME = Charred Weasel

# To prevent adding plus sign
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/entry/syscalls/syscall_32.tbl
Expand Up @@ -386,4 +386,4 @@
377 i386 copy_file_range sys_copy_file_range
378 i386 preadv2 sys_preadv2 compat_sys_preadv2
379 i386 pwritev2 sys_pwritev2 compat_sys_pwritev2
380 i386 gvfs sys_gvfs
380 i386 gvts sys_gvts
2 changes: 1 addition & 1 deletion arch/x86/entry/syscalls/syscall_64.tbl
Expand Up @@ -335,7 +335,7 @@
326 common copy_file_range sys_copy_file_range
327 64 preadv2 sys_preadv2
328 64 pwritev2 sys_pwritev2
329 common gvfs sys_gvfs
329 common gvts sys_gvts

#
# x32-specific system call numbers start at 512 to avoid cache impact
Expand Down
48 changes: 24 additions & 24 deletions include/linux/sched.h
Expand Up @@ -5,16 +5,16 @@

#include <linux/sched/prio.h>

#ifdef CONFIG_GVFS_AMP
#define NUM_CPU_TYPES CONFIG_GVFS_NUM_CPU_TYPES
#if CONFIG_GVFS_BASE_CPU_TYPE >= CONFIG_GVFS_NUM_CPU_TYPES
ERROR "CONFIG_GVFS_BASE_CPU_TYPE should be smaller than CONFIG_GVFS_NUM_CPU_TYPES"
#ifdef CONFIG_GVTS_AMP
#define NUM_CPU_TYPES CONFIG_GVTS_NUM_CPU_TYPES
#if CONFIG_GVTS_BASE_CPU_TYPE >= CONFIG_GVTS_NUM_CPU_TYPES
ERROR "CONFIG_GVTS_BASE_CPU_TYPE should be smaller than CONFIG_GVTS_NUM_CPU_TYPES"
#endif
#else /* !CONFIG_GVFS_AMP */
#else /* !CONFIG_GVTS_AMP */
#define NUM_CPU_TYPES 2 /* default value */
#endif

#ifdef CONFIG_GVFS_STATS
#ifdef CONFIG_GVTS_STATS
#define NUM_MAX_TARGET_DIFF 10
#endif

Expand Down Expand Up @@ -1054,11 +1054,11 @@ struct sched_domain {
struct sched_domain *parent; /* top domain must be null terminated */
struct sched_domain *child; /* bottom domain must be null terminated */
struct sched_group *groups; /* the balancing groups of the domain */
#ifdef CONFIG_GVFS
struct sd_vruntime *vruntime; /* the balancing criteria of GVFS */
#ifdef CONFIG_GVTS
struct sd_vruntime *vruntime; /* the balancing criteria of GVTS */
u64 vruntime_interval;
u64 vruntime_tolerance;
#endif /* CONFIG_GVFS */
#endif /* CONFIG_GVTS */
unsigned long min_interval; /* Minimum balance interval ms */
unsigned long max_interval; /* Maximum balance interval ms */
unsigned int busy_factor; /* less balancing by factor if busy */
Expand All @@ -1085,7 +1085,7 @@ struct sched_domain {
unsigned long next_decay_max_lb_cost;

#ifdef CONFIG_SCHEDSTATS
#ifdef CONFIG_GVFS_STATS
#ifdef CONFIG_GVTS_STATS
/* _target_vruntime_balance() */
unsigned int target_update_racing;
/* __target_vruntime_balance() */
Expand Down Expand Up @@ -1128,7 +1128,7 @@ struct sched_domain {
unsigned int atb_pushed;
unsigned int atb_pushed_under;
unsigned int target_diff[NUM_MAX_TARGET_DIFF];
#endif /* CONFIG_GVFS_STATS */
#endif /* CONFIG_GVTS_STATS */

/* load_balance() stats */
unsigned int lb_count[CPU_MAX_IDLE_TYPES];
Expand Down Expand Up @@ -1202,7 +1202,7 @@ struct sd_data {
struct sched_domain **__percpu sd;
struct sched_group **__percpu sg;
struct sched_group_capacity **__percpu sgc;
#ifdef CONFIG_GVFS
#ifdef CONFIG_GVTS
struct sd_vruntime **__percpu sdv;
#endif
};
Expand Down Expand Up @@ -1284,7 +1284,7 @@ struct sched_avg {
unsigned long load_avg, util_avg;
};

#ifdef CONFIG_GVFS
#ifdef CONFIG_GVTS
struct remember_info;
#endif

Expand Down Expand Up @@ -1334,19 +1334,19 @@ struct sched_entity {
u64 sum_exec_runtime;
u64 prev_sum_exec_runtime;
u64 vruntime;
#ifdef CONFIG_GVFS_AMP
#ifdef CONFIG_GVTS_AMP
u64 sum_perf_runtime;
u32 vruntime_rem;
u32 perf_rem;
u64 sum_type_runtime[NUM_CPU_TYPES];
#endif /* CONFIG_GVFS_AMP */
#ifdef CONFIG_GVFS
#endif /* CONFIG_GVTS_AMP */
#ifdef CONFIG_GVTS
u64 sleep_start; /* remember the sleep start time
to prevent vruntime normalization for short sleep */
u64 sleep_target; /* remember the target when start to sleep
for vruntime normalization */
#endif /* CONFIG_GVFS_AMP */
#ifdef CONFIG_GVFS_DEBUG_NORMALIZATION /* for debug */
#endif /* CONFIG_GVTS_AMP */
#ifdef CONFIG_GVTS_DEBUG_NORMALIZATION /* for debug */
unsigned int num_normalization;
u64 added_normalization;
u64 max_added_normalization;
Expand All @@ -1365,7 +1365,7 @@ struct sched_entity {
struct cfs_rq *cfs_rq;
/* rq "owned" by this entity/group: */
struct cfs_rq *my_q;
#ifdef CONFIG_GVFS_BANDWIDTH
#ifdef CONFIG_GVTS_BANDWIDTH
struct list_head *state_q; /* refer to active_q or throt_q.
NULL while running */
struct list_head state_node; /* node inserted to active_q or throt_q */
Expand All @@ -1381,7 +1381,7 @@ struct sched_entity {
*/
struct sched_avg avg ____cacheline_aligned_in_smp;
#endif
#ifdef CONFIG_GVFS
#ifdef CONFIG_GVTS
struct load_weight eff_load; /* for vruntime update */
struct sched_entity *curr_child; /* for update effective_load */
unsigned long eff_weight_real; /* NOT affected by MIN_SHARES and MAX_SHARES */
Expand All @@ -1390,14 +1390,14 @@ struct sched_entity {
or
eff_weight_real * util_avg << ADDED_BITS / efficiency[rq->cpu_type]
*/
#ifdef CONFIG_GVFS_AMP
#ifdef CONFIG_GVTS_AMP
unsigned long *effi; /* a pointer to task->effi related to this se */
unsigned long __lagged_weight[NUM_CPU_TYPES]; /* lagged_weight for each type */
#endif
s64 lagged; /* necessary time to reach se->vruntime to lagged_target */
u64 lagged_target; /* target used when calculating @lagged. */
unsigned long tg_load_sum_contrib;
#endif /* CONFIG_GVFS */
#endif /* CONFIG_GVTS */
};

struct sched_rt_entity {
Expand Down Expand Up @@ -1517,7 +1517,7 @@ struct task_struct {
int wake_cpu;
#endif
int on_rq;
#ifdef CONFIG_GVFS_AMP
#ifdef CONFIG_GVTS_AMP
int effi_mode;
unsigned long __effi[NUM_CPU_TYPES]; /* set by users or estimations */
unsigned long effi[NUM_CPU_TYPES]; /* normalized value of __efficiency */
Expand Down Expand Up @@ -1611,7 +1611,7 @@ struct task_struct {

pid_t pid;
pid_t tgid;
#ifdef CONFIG_GVFS
#ifdef CONFIG_GVTS
struct remember_info *remember;
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/linux/syscalls.h
Expand Up @@ -898,8 +898,8 @@ asmlinkage long sys_copy_file_range(int fd_in, loff_t __user *off_in,

asmlinkage long sys_mlock2(unsigned long start, size_t len, int flags);

#ifdef CONFIG_GVFS_SYSCALL
asmlinkage long sys_gvfs(int op, int id, u64 num, void __user *vars);
#ifdef CONFIG_GVTS_SYSCALL
asmlinkage long sys_gvts(int op, int id, u64 num, void __user *vars);
#endif

#endif
4 changes: 2 additions & 2 deletions include/uapi/asm-generic/unistd.h
Expand Up @@ -722,8 +722,8 @@ __SC_COMP(__NR_preadv2, sys_preadv2, compat_sys_preadv2)
#define __NR_pwritev2 287
__SC_COMP(__NR_pwritev2, sys_pwritev2, compat_sys_pwritev2)

#define __NR_gvfs 288
__SYSCALL(__NR_gvfs, sys_gvfs)
#define __NR_gvts 288
__SYSCALL(__NR_gvts, sys_gvts)

#undef __NR_syscalls
#define __NR_syscalls 289
Expand Down
84 changes: 42 additions & 42 deletions init/Kconfig
Expand Up @@ -787,7 +787,7 @@ config BUILD_BIN2C
bool
default n

config GVFS
config GVTS
bool "Global Virtual-time Fair Scheduler by CDKIM"
default y
help
Expand All @@ -800,7 +800,7 @@ config GVFS
* Topology-aware hierarchical balancing for scalability
The 'interval' length, the amount of target increase for each interval,
determines the accuracy of fairness and the frequency of thread migreation.
GVFS awares the topology and uses the long interval length for NUMA,
GVTS awares the topology and uses the long interval length for NUMA,
and the short interval length for SMT.
This mitigates the thread migration overhead and improves fairness accuracy.

Expand All @@ -821,7 +821,7 @@ config GVFS
the next target as simultaneously as possible.
- When calculating lagged, consider se->avg.util_avg value.
eff_weight_real = eff_load.weight(w/o normalization) * util_avg
>> (SCHED_LOAD_SHIFT - CONFIG_GVFS_LAGGED_WEIGHT_ADDED_BITS)
>> (SCHED_LOAD_SHIFT - CONFIG_GVTS_LAGGED_WEIGHT_ADDED_BITS)
and use eff_weight_real instead of eff_load.weight to calculat lagged.

* New vruntime normalization for slept or throttled tasks
Expand All @@ -840,120 +840,120 @@ config GVFS
since the local group CPUs was balanced at the lower level domain.


config GVFS_BANDWIDTH
bool "Support for bandwidth control in GVFS (EXPERIMENTAL)"
config GVTS_BANDWIDTH
bool "Support for bandwidth control in GVTS (EXPERIMENTAL)"
default y
depends on GVFS && CFS_BANDWIDTH
depends on GVTS && CFS_BANDWIDTH
help
Support for bandwidth control (CFS_BANDWIDTH) in GVFS
Support for bandwidth control (CFS_BANDWIDTH) in GVTS
Currently, this does not work properly for some cases.

config GVFS_DEBUG_NORMALIZATION
config GVTS_DEBUG_NORMALIZATION
bool "Debug normalization of vruntime"
default n
depends on GVFS
depends on GVTS
help
Debug information for virtual time normalization when a task is waking up

config GVFS_AMP
bool "AMP support of GVFS"
config GVTS_AMP
bool "AMP support of GVTS"
default y
depends on GVFS
depends on GVTS
help
GVFS for AMP.
GVTS for AMP.
efficiency (and efficiency modes) for tasks.
define cpu types for each rq.
minimize max(lagged_src, lagged_dst) at targer vruntime balancing.
Try to balance even if only 1 task at source runqueue when source is slower than destination.
faster-core-first for NOHZ of GVFS_AMP
faster-core-first for NOHZ of GVTS_AMP

config GVFS_NUM_CPU_TYPES
config GVTS_NUM_CPU_TYPES
int "Number of CPU types"
range 1 16
default 2
depends on GVFS_AMP
depends on GVTS_AMP
help
The number of CPU types supported by GVFS.
The number of CPU types supported by GVTS.

config GVFS_BASE_CPU_TYPE
config GVTS_BASE_CPU_TYPE
int "CPU type id for the base performance"
range -1 15
depends on GVFS_AMP
depends on GVTS_AMP
default -1
help
The CPU type id used to define the base performance.
This value should be smaller than GVFS_NUM_CPU_TYPES
This value should be smaller than GVTS_NUM_CPU_TYPES
If this says -1, FAIR_SHARE is used.
FAIR_SHARE = SUM(num_type_i_cpus * efficiency[i]) / SUM(num_type_i_cpus)

config GVFS_STATS
bool "Schedstats for GVFS"
config GVTS_STATS
bool "Schedstats for GVTS"
default y
depends on GVFS && SCHEDSTATS
depends on GVTS && SCHEDSTATS
help
Various statistics for debugging GVFS
Various statistics for debugging GVTS

config GVFS_INTERVAL_SMT_SHARED
config GVTS_INTERVAL_SMT_SHARED
int "Target interval for cores sharing pipelines (ms)"
range 1 3000
depends on GVFS
depends on GVTS
default 30

config GVFS_INTERVAL_LLC_SHARED
config GVTS_INTERVAL_LLC_SHARED
int "Target interval for cores sharing a LLC (ms)"
range 1 3000
depends on GVFS
depends on GVTS
default 90

config GVFS_INTERVAL_NUMA
config GVTS_INTERVAL_NUMA
int "Target interval for cores in different nodes (ms)"
range 1 3000
depends on GVFS
depends on GVTS
default 150
help
1000 indicates 1s target interval for local nodes,
and 2s target interval for remote nodes.
interval = value / 10 * numa_distance

config GVFS_TOLERANCE_PERCENT
config GVTS_TOLERANCE_PERCENT
int "Tolerance value as a percentage of target interval."
range 0 100
depends on GVFS
depends on GVTS
default 30

config GVFS_TARGET_DIFF_THRESHOLD
config GVTS_TARGET_DIFF_THRESHOLD
int "Target difference threshold for source activated balancing"
range 2 100
default 3
depends on GVFS
depends on GVTS
help
When difference between cfs_rq->target_vruntime and rq->sd_vruntime->target
is larger than CONFIG_GVFS_TARGET_DIFF_THRESHOLD * sd_vruntime->interval,
is larger than CONFIG_GVTS_TARGET_DIFF_THRESHOLD * sd_vruntime->interval,
the source cpu activated the target vruntime balancing.


config GVFS_TARGET_DIFF_INFEASIBLE_WEIGHT
config GVTS_TARGET_DIFF_INFEASIBLE_WEIGHT
int "Target difference threshold for detecting infeasible weight"
range 2 100
default 10
depends on GVFS
depends on GVTS
help
Target difference threshold for detecting infeasible weight

GVFS detects infeasible weight if
1. target diff >= GVFS_TARGET_DIFF_INFEASIBLE_WEIGHT
GVTS detects infeasible weight if
1. target diff >= GVTS_TARGET_DIFF_INFEASIBLE_WEIGHT
2. nr_running = 1
3. lagged_weight > others' lagged_weight
Then, delete_min_target and do not update min_target for the task

The infeasibility of a CPU will be cleared
1. when the CPU becomes idle.
2. when target diff < GVFS_TARGET_DIFF_INFEASIBLE_WEIGHT
2. when target diff < GVTS_TARGET_DIFF_INFEASIBLE_WEIGHT

config GVFS_LAGGED_WEIGHT_ADDED_BITS
config GVTS_LAGGED_WEIGHT_ADDED_BITS
int 'The number of added bits to improve the accuracy of lagged_weight'
range 0 10
depends on GVFS
depends on GVTS
default 4
help
If this value is 0, the accuracy of lagged_weight is 10.
Expand Down

0 comments on commit a0bc18c

Please sign in to comment.