• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * include/linux/zswapd.h
4  *
5  * Copyright (c) 2020-2022 Huawei Technologies Co., Ltd.
6  */
7 
8 #ifndef _ZSWAPD_H
9 #define _ZSWAPD_H
10 
11 enum {
12 	CACHE_SIZE,
13 	SWAP_SIZE,
14 	CACHE_PAGE,
15 	SWAP_PAGE,
16 	CACHE_FAULT,
17 	SWAP_FAULT,
18 	READ_SIZE,
19 	WRITE_SIZE,
20 };
21 
22 struct group_swap_ops {
23 	u64 (*group_read)(u16 gid, u64 req_size, void *priv);
24 	u64 (*group_write)(u16 gid, u64 req_size, void *priv);
25 	u64 (*group_data_size)(u16 gid, int type, void *priv);
26 };
27 
28 struct group_swap_device {
29 	void *priv;
30 	struct group_swap_ops *ops;
31 	struct list_head list;
32 };
33 
34 #ifdef CONFIG_HYPERHOLD_ZSWAPD
35 extern int zswapd_run(int nid);
36 extern void zswapd_stop(int nid);
37 extern void zswapd_status_show(struct seq_file *m);
38 extern void wake_all_zswapd(void);
39 extern void set_snapshotd_init_flag(unsigned int val);
40 extern pid_t get_zswapd_pid(void);
41 extern unsigned long long get_free_swap_threshold(void);
42 extern struct group_swap_device *register_group_swap(struct group_swap_ops *ops, void *priv);
43 extern void unregister_group_swap(struct group_swap_device *gsdev);
44 
45 #ifdef CONFIG_HYPERHOLD_DEBUG
46 extern void memcg_eswap_info_show(struct seq_file *m);
47 #endif
48 #endif
49 
50 #endif /* _LINUX_ZSWAPD_H */
51