• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * mm/zswapd_internal.h
4  *
5  * Copyright (c) 2020-2022 Huawei Technologies Co., Ltd.
6  */
7 
8 #ifndef _ZSWAPD_INTERNAL_H
9 #define _ZSWAPD_INTERNAL_H
10 
11 enum zswapd_pressure_level {
12 	LEVEL_LOW = 0,
13 	LEVEL_MEDIUM,
14 	LEVEL_CRITICAL,
15 	LEVEL_COUNT
16 };
17 
18 enum zswapd_eswap_policy {
19 	CHECK_BUFFER_ONLY = 0,
20 	CHECK_BUFFER_ZRAMRATIO_BOTH
21 };
22 
23 void zswapd_pressure_report(enum zswapd_pressure_level level);
24 inline unsigned int get_zram_wm_ratio(void);
25 inline unsigned int get_compress_ratio(void);
26 inline unsigned int get_avail_buffers(void);
27 inline unsigned int get_min_avail_buffers(void);
28 inline unsigned int get_high_avail_buffers(void);
29 inline unsigned int get_zswapd_max_reclaim_size(void);
30 inline unsigned int get_inactive_file_ratio(void);
31 inline unsigned int get_active_file_ratio(void);
32 inline unsigned long long get_area_anon_refault_threshold(void);
33 inline unsigned long long get_anon_refault_snapshot_min_interval(void);
34 inline unsigned long long get_empty_round_skip_interval(void);
35 inline unsigned long long get_max_skip_interval(void);
36 inline unsigned long long get_empty_round_check_threshold(void);
37 inline unsigned long long get_zram_critical_threshold(void);
38 u64 memcg_data_size(struct mem_cgroup *memcg, int type);
39 u64 swapin_memcg(struct mem_cgroup *memcg, u64 req_size);
40 
41 #endif /* MM_ZSWAPD_INTERNAL_H */
42