-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtbulmkd.h
43 lines (35 loc) · 1.07 KB
/
tbulmkd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Copyright (C) 2012 Samsung Electronics Co., Ltd.
* Author: Bartlomiej Zolnierkiewicz <[email protected]>
*
* heavily based on Userspace low memory killer daemon:
* Copyright 2012 Linaro Limited
* Author: Anton Vorontsov <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef __TBULMKD_H
#define __TBULMKD_H
struct mem_threshold {
long long mem_limit;
int mfd;
int cfd;
int efd;
};
extern struct mem_threshold mem_thresholds[2];
struct pollfd;
int apps_mem_percent;
int daemons_mem_percent;
void free_cgroups(void);
void init_cgroups(void);
void add_pid_to_daemons_cgroup(pid_t pid);
void add_pid_to_apps_cgroup(pid_t pid);
int setup_events(struct pollfd *pollfds, int idx);
void cleanup_events(int idx);
void process_event(int idx);
int check_pid_in_cgroup(pid_t pid, int idx);
long long get_mem_usage(int idx);
#endif