pass: parser: Add gov_timeout to Level section in resource conf file 87/116787/5
authorWook Song <wook16.song@samsung.com>
Tue, 28 Feb 2017 05:19:07 +0000 (14:19 +0900)
committerWook Song <wook16.song@samsung.com>
Thu, 9 Mar 2017 05:30:12 +0000 (14:30 +0900)
This patch adds a gov_timeout entry to the Level section in the resource
configuration file. Comparing with pass_gov_timeout in the Pass section,
this entry indicates the timer interval for a specific level. If this
entry does not appear in the Level section, the value of
pass_gov_timeout will be assigned to the governor timer interval for
that level by default.

Change-Id: I57ed24f8666711c11c3ceeeeaab9bfcc13c550a1
Signed-off-by: Wook Song <wook16.song@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-parser.c
src/pass/pass.c

index e10ed52122d6f603458d61bd5ab5ff9906d5b577..6e58f22375bb4bb337bc4be59bf6075fe0dd4338 100644 (file)
@@ -157,6 +157,14 @@ static int  pass_parse_level(struct parse_result *result,
                policy->pass_table[level].right_cond[0].nr_running = atoi(result->value);
        else if (MATCH(result->name, "num_right_cond_busy_cpu"))
                policy->pass_table[level].right_cond[0].busy_cpu = atoi(result->value);
+       else if (MATCH(result->name, "gov_timeout")) {
+               double gov_timeout = atof(result->value);
+
+               if (gov_timeout < PASS_MIN_GOV_TIMEOUT)
+                       gov_timeout = PASS_MIN_GOV_TIMEOUT;
+
+               policy->pass_table[level].gov_timeout = gov_timeout;
+       }
 
        return 0;
 }
index 5a7d6e7d67c055a015fa1ea48c00cd084580362d..0fe797d88802222701d458ae31772c67e44c32d6 100644 (file)
@@ -158,6 +158,8 @@ static int pass_resource_init(struct pass_policy *policy)
                        max_freq = policy->pass_table[i].limit_max_freq;
                if (max_cpu < policy->pass_table[i].limit_min_cpu)
                        max_cpu = policy->pass_table[i].limit_min_cpu;
+               if (policy->pass_table[i].gov_timeout == 0)
+                       policy->pass_table[i].gov_timeout = policy->gov_timeout;
        }
        policy->freq.max_freq = max_freq;