1 #ifndef __TOOLS_LINUX_SHRINKER_H
2 #define __TOOLS_LINUX_SHRINKER_H
4 #include <linux/list.h>
5 #include <linux/types.h>
7 struct shrink_control {
9 unsigned long nr_to_scan;
12 #define SHRINK_STOP (~0UL)
16 unsigned long (*count_objects)(struct shrinker *,
17 struct shrink_control *sc);
18 unsigned long (*scan_objects)(struct shrinker *,
19 struct shrink_control *sc);
20 void (*to_text)(struct seq_buf *, struct shrinker *);
22 int seeks; /* seeks to recreate an obj */
23 long batch; /* reclaim batch size, 0 = default */
24 struct list_head list;
27 int register_shrinker(struct shrinker *, const char *, ...);
28 void unregister_shrinker(struct shrinker *);
30 void run_shrinkers(gfp_t gfp_mask, bool);
32 #endif /* __TOOLS_LINUX_SHRINKER_H */