X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Flinux%2Fenergy_model.h;h=1834752c56175983c3775cb42af35772b4618671;hb=7fcc17d0cb12938d2b3507973a6f93fc9ed2c7a1;hp=3f221dbf5f95d9f75b47d4758aede461fba22ad8;hpb=c500bee1c5b2f1d59b1081ac879d73268ab0ff17;p=platform%2Fkernel%2Flinux-starfive.git diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h index 3f221db..1834752 100644 --- a/include/linux/energy_model.h +++ b/include/linux/energy_model.h @@ -53,6 +53,22 @@ struct em_perf_domain { #ifdef CONFIG_ENERGY_MODEL #define EM_MAX_POWER 0xFFFF +/* + * Increase resolution of energy estimation calculations for 64-bit + * architectures. The extra resolution improves decision made by EAS for the + * task placement when two Performance Domains might provide similar energy + * estimation values (w/o better resolution the values could be equal). + * + * We increase resolution only if we have enough bits to allow this increased + * resolution (i.e. 64-bit). The costs for increasing resolution when 32-bit + * are pretty high and the returns do not justify the increased costs. + */ +#ifdef CONFIG_64BIT +#define em_scale_power(p) ((p) * 1000) +#else +#define em_scale_power(p) (p) +#endif + struct em_data_callback { /** * active_power() - Provide power at the next performance state of