--- /dev/null
+/*
+ * resourced
+ *
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdbool.h>
+#include "memory-common.h"
+
+static bool lmk_governor_post_wss_enabled = false;
+
+void lmk_governor_post_enable_wss(void)
+{
+ lmk_governor_post_wss_enabled = true;
+}
+
+bool lmk_governor_post_is_enabled_of_wss(void)
+{
+ return lmk_governor_post_wss_enabled;
+}
--- /dev/null
+/*
+ * resourced
+ *
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __MEMORY_COMMON_H__
+#define __MEMORY_COMMON_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+void lmk_governor_post_enable_wss(void);
+bool lmk_governor_post_is_enabled_of_wss(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __MEMORY_COMMON_H__ */
#include "resourced-helper-worker.h"
#include "dedup-common.h"
#include "const.h"
+#include "memory-common.h"
#define MAX_PROACTIVE_HIGH_VICTIMS 4
#define FOREGROUND_VICTIMS 1
goto leave;
}
- ret = syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_wss(
+ if (lmk_governor_post_is_enabled_of_wss()) {
+ ret = syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_wss(
lowmem_kill_candidates);
- if (ret < 0) {
- status = LOWMEM_RECLAIM_NEXT_TYPE;
- goto leave;
+ if (ret < 0) {
+ status = LOWMEM_RECLAIM_NEXT_TYPE;
+ goto leave;
+ }
}
ret = syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_foreground(