From: Chanwoo Choi Date: Thu, 2 Feb 2017 10:48:14 +0000 (+0900) Subject: pass: gov: Add new pass_gov_dummy governor for unmonitored resources X-Git-Tag: submit/tizen/20170328.004502~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=869d41ef922ca99401ecd1721833c4eb73752b7f;p=platform%2Fcore%2Fsystem%2Fpass.git pass: gov: Add new pass_gov_dummy governor for unmonitored resources This patchs add the new 'pass_gov_dummy' governor which doesn't contain the govenory policy to decide the next level. Some resource don't need to monitor the resource status peridically and to decide the next level according to the utilization. This dummy governor just initialize the resource. Change-Id: Icdf25902e9656ebb6587f430b30ee8c21475de47 Signed-off-by: Chanwoo Choi --- diff --git a/src/pass/pass-gov.c b/src/pass/pass-gov.c index 2b62584..d8ecab0 100644 --- a/src/pass/pass-gov.c +++ b/src/pass/pass-gov.c @@ -189,6 +189,8 @@ struct pass_hotplug* pass_get_hotplug(struct pass_policy *policy, struct pass_hotplug *hotplug; switch (type) { + case PASS_GOV_DUMMY: + return NULL; case PASS_GOV_STEP: case PASS_GOV_RADIATION: hotplug = calloc(1, sizeof(struct pass_hotplug)); @@ -649,6 +651,14 @@ int pass_governor_change_level_scope(struct pass_policy *policy, * - Step governor * - Radiation governor */ +static struct pass_governor pass_gov_dummy = { + .name = "pass_dummy", + .init = __pass_governor_init, + .exit = __pass_governor_exit, + .update = __pass_governor_update, + .governor = NULL, +}; + static struct pass_governor pass_gov_step = { .name = "pass_step", .init = __pass_governor_init, @@ -676,6 +686,8 @@ struct pass_governor* pass_get_governor(struct pass_policy *policy, enum pass_gov_type type) { switch (type) { + case PASS_GOV_DUMMY: + return &pass_gov_dummy; case PASS_GOV_STEP: return &pass_gov_step; case PASS_GOV_RADIATION: diff --git a/src/pass/pass.h b/src/pass/pass.h index 7c74536..b30a79e 100644 --- a/src/pass/pass.h +++ b/src/pass/pass.h @@ -51,8 +51,9 @@ enum pass_state { * PASS Governor type */ enum pass_gov_type { - PASS_GOV_STEP, - PASS_GOV_RADIATION, + PASS_GOV_DUMMY = 0, + PASS_GOV_STEP = 1, + PASS_GOV_RADIATION = 2, PASS_GOV_END, };