enum psi_mem_level {
PSI_MEM_LEVEL_UNKNOWN,
- PSI_MEM_LEVEL_LOW,
- PSI_MEM_LEVEL_MEDIUM,
- PSI_MEM_LEVEL_HIGH,
+ PSI_MEM_LEVEL_1,
+ PSI_MEM_LEVEL_2,
+ PSI_MEM_LEVEL_3,
+ PSI_MEM_LEVEL_4,
PSI_MEM_LEVEL_MAX,
};
static void assert_psi_mem_level(int psi_mem_level)
{
switch (psi_mem_level) {
- case PSI_MEM_LEVEL_LOW:
- case PSI_MEM_LEVEL_MEDIUM:
- case PSI_MEM_LEVEL_HIGH:
+ case PSI_MEM_LEVEL_1:
+ case PSI_MEM_LEVEL_2:
+ case PSI_MEM_LEVEL_3:
+ case PSI_MEM_LEVEL_4:
return;
default:
_E("Invalid PSI memory level: %d", psi_mem_level);
int mem_level;
switch (g_current_psi_mem_level) {
- case PSI_MEM_LEVEL_LOW:
- case PSI_MEM_LEVEL_MEDIUM:
- case PSI_MEM_LEVEL_HIGH:
+ case PSI_MEM_LEVEL_1:
+ case PSI_MEM_LEVEL_2:
+ case PSI_MEM_LEVEL_3:
+ case PSI_MEM_LEVEL_4:
break;
default:
return;
}
static struct psi_memory_monitor_info g_psi_memory_monitor_info_list[PSI_MEM_LEVEL_MAX] = {
- [PSI_MEM_LEVEL_LOW] = {
- .psi_mem_level = PSI_MEM_LEVEL_LOW,
- .psi_mem_level_str = "low",
+ [PSI_MEM_LEVEL_1] = {
+ .psi_mem_level = PSI_MEM_LEVEL_1,
+ .psi_mem_level_str = "level1",
+ .psi_type = PSI_TYPE_SOME,
+ .stall_us = 30000,
+ .window_us = 500000,
+ .fd = -1,
+ },
+ [PSI_MEM_LEVEL_2] = {
+ .psi_mem_level = PSI_MEM_LEVEL_2,
+ .psi_mem_level_str = "level2",
.psi_type = PSI_TYPE_SOME,
.stall_us = 70000,
.window_us = 1000000,
.fd = -1,
},
- [PSI_MEM_LEVEL_MEDIUM] = {
- .psi_mem_level = PSI_MEM_LEVEL_MEDIUM,
- .psi_mem_level_str = "medium",
+ [PSI_MEM_LEVEL_3] = {
+ .psi_mem_level = PSI_MEM_LEVEL_3,
+ .psi_mem_level_str = "level3",
.psi_type = PSI_TYPE_SOME,
.stall_us = 100000,
.window_us = 1000000,
.fd = -1,
},
- [PSI_MEM_LEVEL_HIGH] = {
- .psi_mem_level = PSI_MEM_LEVEL_HIGH,
- .psi_mem_level_str = "high",
+ [PSI_MEM_LEVEL_4] = {
+ .psi_mem_level = PSI_MEM_LEVEL_4,
+ .psi_mem_level_str = "level4",
.psi_type = PSI_TYPE_FULL,
.stall_us = 70000,
.window_us = 1000000,
};
static struct epoll_event_data g_psi_event_datas[PSI_MEM_LEVEL_MAX] = {
- [PSI_MEM_LEVEL_LOW] = {
+ [PSI_MEM_LEVEL_1] = {
+ .handler = (epoll_event_handler)psi_memory_monitor_handler,
+ .data = &g_psi_memory_monitor_info_list[PSI_MEM_LEVEL_1],
+ },
+ [PSI_MEM_LEVEL_2] = {
.handler = (epoll_event_handler)psi_memory_monitor_handler,
- .data = &g_psi_memory_monitor_info_list[PSI_MEM_LEVEL_LOW],
+ .data = &g_psi_memory_monitor_info_list[PSI_MEM_LEVEL_2],
},
- [PSI_MEM_LEVEL_MEDIUM] = {
+ [PSI_MEM_LEVEL_3] = {
.handler = (epoll_event_handler)psi_memory_monitor_handler,
- .data = &g_psi_memory_monitor_info_list[PSI_MEM_LEVEL_MEDIUM],
+ .data = &g_psi_memory_monitor_info_list[PSI_MEM_LEVEL_3],
},
- [PSI_MEM_LEVEL_HIGH] = {
+ [PSI_MEM_LEVEL_4] = {
.handler = (epoll_event_handler)psi_memory_monitor_handler,
- .data = &g_psi_memory_monitor_info_list[PSI_MEM_LEVEL_HIGH],
+ .data = &g_psi_memory_monitor_info_list[PSI_MEM_LEVEL_4],
},
};