pass: gov: Add new pass_gov_dummy governor for unmonitored resources
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 2 Feb 2017 10:48:14 +0000 (19:48 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 2 Feb 2017 23:43:19 +0000 (08:43 +0900)
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 <cw00.choi@samsung.com>
src/pass/pass-gov.c
src/pass/pass.h

index 2b62584ce4a3ed76fb01894185d4416f86cd9e3f..d8ecab0de305a6e674d20d8c43811f8d508a9f6a 100644 (file)
@@ -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:
index 7c7453625f8f57a003f66915a765ac69b326accf..b30a79e586a13e97103992c8b77da6205fe6b6de 100644 (file)
@@ -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,
 };