Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c207c88 authored by Guanglei Li's avatar Guanglei Li Committed by Todd Kjos
Browse files

ANDROID: sched/fair: correct pelt load information in sched-pelt.h



With the following commit:

cb22d915 ("sched/fair: add support to tune PELT ramp/decay timings)

PELT introduced 16ms/8ms for load/utilization half-life decayed.
Precomputed load information inclued in sched-pelt.h is generated by
Documentation/scheduler/sched-pelt.c.

With this commit, runnable_avg_yN_sum[]/LOAD_AVG_MAX/LOAD_AVG_MAX_N is
precomputed wrong for 16ms/8ms half-life.

Bug: 120440300
Change-Id: I83d90963b714449ec8036423ce8bc25f0b4cd6b9
Signed-off-by: default avatarGuanglei Li <guanglei.li@unisoc.com>
Signed-off-by: default avatarKe Wang <ke.wang@unisoc.com>
parent 3bdeffc4
Loading
Loading
Loading
Loading
+16 −9
Original line number Original line Diff line number Diff line
@@ -30,7 +30,7 @@ void calc_runnable_avg_yN_inv(const int halflife)
	printf("\n};\n\n");
	printf("\n};\n\n");
}
}


int sum = 1024;
int sum;


void calc_runnable_avg_yN_sum(const int halflife)
void calc_runnable_avg_yN_sum(const int halflife)
{
{
@@ -51,9 +51,8 @@ void calc_runnable_avg_yN_sum(const int halflife)
	printf("\n};\n\n");
	printf("\n};\n\n");
}
}


int n = -1;
int n;
/* first period */
long max;
long max = 1024;


void calc_converged_max(const int halflife)
void calc_converged_max(const int halflife)
{
{
@@ -101,18 +100,26 @@ void main(void)
	int hl_count = sizeof(hl_value) / sizeof(int);
	int hl_count = sizeof(hl_value) / sizeof(int);
	int hl_idx, halflife;
	int hl_idx, halflife;


	printf("/* Generated by Documentation/scheduler/sched-pelt; do not modify. */\n\n");
	printf("/* SPDX-License-Identifier: GPL-2.0 */\n");
	printf("/* Generated by Documentation/scheduler/sched-pelt; do not modify. */\n");


	for (hl_idx = 0; hl_idx < hl_count; ++hl_idx) {
	for (hl_idx = 0; hl_idx < hl_count; ++hl_idx) {
		halflife = hl_value[hl_idx];
		halflife = hl_value[hl_idx];


		y = pow(0.5, 1/(double)halflife);
		y = pow(0.5, 1/(double)halflife);
		sum = 1024;
		/* first period */
		max = 1024;
		n = -1;


		printf("#if CONFIG_PELT_UTIL_HALFLIFE_%d\n", halflife);
		printf("\n#ifdef CONFIG_PELT_UTIL_HALFLIFE_%d\n", halflife);
		calc_runnable_avg_yN_inv(halflife);
		calc_runnable_avg_yN_inv(halflife);
		calc_runnable_avg_yN_sum(halflife);
		calc_runnable_avg_yN_sum(halflife);
		calc_converged_max(halflife);
		calc_converged_max(halflife);
		calc_accumulated_sum_32(halflife);
		/*
		printf("#endif\n\n");
		 * calc_accumulated_sum_32(halflife) precomputed load sum table of half-life,
		 * not used yet.
		 */
		printf("#endif\n");
	}
	}
}
}
+7 −8
Original line number Original line Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/* SPDX-License-Identifier: GPL-2.0 */
/* Generated by Documentation/scheduler/sched-pelt; do not modify. */
/* Generated by Documentation/scheduler/sched-pelt; do not modify. */



#ifdef CONFIG_PELT_UTIL_HALFLIFE_32
#ifdef CONFIG_PELT_UTIL_HALFLIFE_32
static const u32 runnable_avg_yN_inv[] = {
static const u32 runnable_avg_yN_inv[] = {
	0xffffffff,0xfa83b2da,0xf5257d14,0xefe4b99a,
	0xffffffff,0xfa83b2da,0xf5257d14,0xefe4b99a,
@@ -35,13 +34,13 @@ static const u32 runnable_avg_yN_inv[] = {
};
};


static const u32 runnable_avg_yN_sum[] = {
static const u32 runnable_avg_yN_sum[] = {
	    0,22380,22411,22441,22470,22497,22523,22548,22572,22595,22617,
	    0,  980, 1919, 2818, 3679, 4503, 5292, 6048, 6772, 7465, 8129,
	22638,22658,22677,22696,22714,22731,
	 8764, 9373, 9956,10514,11048,11560,
};
};


#define LOAD_AVG_PERIOD 16
#define LOAD_AVG_PERIOD 16
#define LOAD_AVG_MAX 24152
#define LOAD_AVG_MAX 24130
#define LOAD_AVG_MAX_N 517
#define LOAD_AVG_MAX_N 172


#endif
#endif


@@ -52,11 +51,11 @@ static const u32 runnable_avg_yN_inv[] = {
};
};


static const u32 runnable_avg_yN_sum[] = {
static const u32 runnable_avg_yN_sum[] = {
	    0,20844,20053,19327,18661,18051,17491,16978,16507,
	    0,  939, 1800, 2589, 3313, 3977, 4585, 5143, 5655,
};
};


#define LOAD_AVG_PERIOD 8
#define LOAD_AVG_PERIOD 8
#define LOAD_AVG_MAX 12337
#define LOAD_AVG_MAX 12326
#define LOAD_AVG_MAX_N 603
#define LOAD_AVG_MAX_N 85


#endif
#endif