Initialize Tizen 2.3
[kernel/api/system-resource.git] / src / memory / lowmem-process.h
1 /*
2  *  resourced
3  *
4  * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  *
18  */
19
20 /**
21  * @file lowmem_process.h
22  * @desc grouping process and setting oom adj value
23  **/
24
25 #ifndef __LOWMEM_PROCESS_H__
26 #define __LOWMEM_PROCESS_H__
27
28 #include <proc_stat.h>
29
30 #define OOMADJ_SU                   (0)
31 #define OOMADJ_INIT                 (100)
32 #define OOMADJ_FOREGRD_LOCKED       (150)
33 #define OOMADJ_FOREGRD_UNLOCKED     (200)
34 #define OOMADJ_BACKGRD_LOCKED       (250)
35 #define OOMADJ_BACKGRD_UNLOCKED     (300)
36 #define OOMADJ_APP_LIMIT            OOMADJ_INIT
37 #define OOMADJ_APP_MAX              (990)
38 #define OOMADJ_APP_INCREASE         (30)
39
40 int lowmem_get_proc_cmdline(pid_t pid, char *cmdline);
41 int lowmem_sweep_memory(int callpid);
42
43 int get_proc_oom_score_adj(int pid, int *oom_score_adj);
44 int set_proc_oom_score_adj(int pid, int oom_score_adj);
45
46 int lowmem_set_foregrd(int pid, int oom_score_adj);
47 int lowmem_set_backgrd(int pid, int oom_score_adj);
48
49 int lowmem_set_active(int pid, int oom_score_adj);
50 int lowmem_set_inactive(int pid, int oom_score_adj);
51
52 int lowmem_get_candidate_pid(void);
53
54 #endif /*__LOWMEM_PROCESS_H__*/