4 * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 * @file lowmem_handler.h
22 * @desc handler function for setting memcgroup memory controller and
26 #ifndef __LOWMEM_HANDLER_H__
27 #define __LOWMEM_HANDLER_H__
29 void lowmem_dbus_init(void);
30 int lowmem_oom_killer_cb(int memcg_idx, int flags);
31 void lowmem_dynamic_process_killer(int type);
32 unsigned int get_available(void);
33 void change_memory_state(int state, int force);
35 void set_threshold(int level, int thres);
36 void set_leave_threshold(int thres);
38 #define NUM_FOREGROUND 3
42 MEMCG_BACKGROUND = MEMCG_FOREGROUND + NUM_FOREGROUND,
54 enum oom_killer_cb_flags {
55 OOM_NONE = 0x00000000, /* for main oom killer thread */
56 OOM_FORCE = 0x00000001, /* for forced kill */
57 OOM_TIMER_CHECK = 0x00000002, /* for timer oom killer cb */
58 OOM_NOMEMORY_CHECK = 0x00000004, /* check victims' memory */
62 DYNAMIC_KILL_LARGEHEAP,
67 #endif /*__LOWMEM_HANDLER_H__*/