devfreq: wmark: active: introduce freq_boost_en knob

There is a freq. boost mechanism in wmark_active governor,
when current loading exceed load_max, directly set target
freq. to fmax.

Introduce 'freq_boost_en' knob to support enable/disable
freq. boost. If performance does not regressed, freq. boost
can be disabled to let DFS smoothly and save power.

Bug 200501949

Change-Id: I6ec7b7079a22a8d974743d766cfd0cc7d0e2dcd4
Signed-off-by: Aaron Tian <atian@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2255082
(cherry picked from commit 30c0d8332a9a36f88c4ba809b94cf5b0669e9b55)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2263228
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Aaron Tian
2019-12-04 18:07:47 +08:00
committed by Laxman Dewangan
parent 410b58af61
commit b2ef349be6

View File

@@ -35,6 +35,7 @@ struct wmark_gov_info {
unsigned int p_load_target; unsigned int p_load_target;
unsigned int p_load_max; unsigned int p_load_max;
unsigned int p_smooth; unsigned int p_smooth;
bool p_freq_boost_en;
/* common data */ /* common data */
struct devfreq *df; struct devfreq *df;
@@ -166,7 +167,7 @@ static int devfreq_watermark_target_freq(struct devfreq *df,
load = (dev_stat.busy_time * 1000) / dev_stat.total_time; load = (dev_stat.busy_time * 1000) / dev_stat.total_time;
/* if we cross load max... */ /* if we cross load max... */
if (load >= wmarkinfo->p_load_max) { if (wmarkinfo->p_freq_boost_en && load >= wmarkinfo->p_load_max) {
/* we go directly to the highest frequency. depending /* we go directly to the highest frequency. depending
* on frequency table we might never go higher than * on frequency table we might never go higher than
* the current frequency (i.e. load should be over 100% * the current frequency (i.e. load should be over 100%
@@ -223,9 +224,9 @@ static void devfreq_watermark_debug_start(struct devfreq *df)
return; return;
} }
#define CREATE_DBG_FILE(fname) \ #define CREATE_DBG_FILE(type, fname) \
do {\ do {\
f = debugfs_create_u32(#fname, S_IRUGO | S_IWUSR, \ f = debugfs_create_##type(#fname, S_IRUGO | S_IWUSR, \
wmarkinfo->debugdir, &wmarkinfo->p_##fname); \ wmarkinfo->debugdir, &wmarkinfo->p_##fname); \
if (NULL == f) { \ if (NULL == f) { \
pr_warn("cannot create debug entry " #fname "\n"); \ pr_warn("cannot create debug entry " #fname "\n"); \
@@ -233,10 +234,17 @@ static void devfreq_watermark_debug_start(struct devfreq *df)
} \ } \
} while (0) } while (0)
CREATE_DBG_FILE(load_target); #define CREATE_DBG_FILE_BOOL(fname) CREATE_DBG_FILE(bool, fname)
CREATE_DBG_FILE(load_max); #define CREATE_DBG_FILE_U32(fname) CREATE_DBG_FILE(u32, fname)
CREATE_DBG_FILE(block_window);
CREATE_DBG_FILE(smooth); CREATE_DBG_FILE_U32(load_target);
CREATE_DBG_FILE_U32(load_max);
CREATE_DBG_FILE_U32(block_window);
CREATE_DBG_FILE_U32(smooth);
CREATE_DBG_FILE_BOOL(freq_boost_en);
#undef CREATE_DBG_FILE_U32
#undef CREATE_DBG_FILE_BOOL
#undef CREATE_DBG_FILE #undef CREATE_DBG_FILE
} }
@@ -268,6 +276,7 @@ static int devfreq_watermark_start(struct devfreq *df)
wmarkinfo->p_load_max = 900; wmarkinfo->p_load_max = 900;
wmarkinfo->p_smooth = 10; wmarkinfo->p_smooth = 10;
wmarkinfo->p_block_window = 50000; wmarkinfo->p_block_window = 50000;
wmarkinfo->p_freq_boost_en = true;
wmarkinfo->df = df; wmarkinfo->df = df;
wmarkinfo->pdev = pdev; wmarkinfo->pdev = pdev;