Loading include/linux/plist.h +3 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,9 @@ static inline int plist_node_empty(const struct plist_node *node) #define plist_next(pos) \ list_next_entry(pos, node_list) #define plist_next_entry(pos, type, member) \ container_of(plist_next(pos), type, member) /** * plist_prev - get the prev entry in list * @pos: the type * to cursor Loading include/linux/swap.h +5 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ enum { #define SWAP_CLUSTER_MAX 32UL #define COMPACT_CLUSTER_MAX SWAP_CLUSTER_MAX #define SWAPFILE_CLUSTER 256 /* * Ratio between zone->managed_pages and the "gap" that above the per-zone Loading Loading @@ -255,6 +256,8 @@ struct swap_info_struct { struct work_struct discard_work; /* discard worker */ struct swap_cluster_info discard_cluster_head; /* list head of discard clusters */ struct swap_cluster_info discard_cluster_tail; /* list tail of discard clusters */ unsigned int write_pending; unsigned int max_writes; }; /* linux/mm/workingset.c */ Loading Loading @@ -338,6 +341,8 @@ extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, unsigned long *nr_scanned); extern unsigned long shrink_all_memory(unsigned long nr_pages); extern int vm_swappiness; extern int sysctl_swap_ratio; extern int sysctl_swap_ratio_enable; extern int remove_mapping(struct address_space *mapping, struct page *page); extern unsigned long vm_total_pages; Loading include/linux/swapfile.h +5 −0 Original line number Diff line number Diff line Loading @@ -7,7 +7,12 @@ */ extern spinlock_t swap_lock; extern struct plist_head swap_active_head; extern spinlock_t swap_avail_lock; extern struct plist_head swap_avail_head; extern struct swap_info_struct *swap_info[]; extern int try_to_unuse(unsigned int, bool, unsigned long); extern int swap_ratio(struct swap_info_struct **si); extern void setup_swap_ratio(struct swap_info_struct *p, int prio); extern bool is_swap_ratio_group(int prio); #endif /* _LINUX_SWAPFILE_H */ kernel/sysctl.c +16 −0 Original line number Diff line number Diff line Loading @@ -1752,6 +1752,22 @@ static struct ctl_table vm_table[] = { .mode = 0644, .proc_handler = proc_doulongvec_minmax, }, #ifdef CONFIG_SWAP { .procname = "swap_ratio", .data = &sysctl_swap_ratio, .maxlen = sizeof(sysctl_swap_ratio), .mode = 0644, .proc_handler = proc_dointvec_minmax, }, { .procname = "swap_ratio_enable", .data = &sysctl_swap_ratio_enable, .maxlen = sizeof(sysctl_swap_ratio_enable), .mode = 0644, .proc_handler = proc_dointvec_minmax, }, #endif { } }; Loading mm/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ ifdef CONFIG_MMU endif obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o swap_ratio.o obj-$(CONFIG_FRONTSWAP) += frontswap.o obj-$(CONFIG_ZSWAP) += zswap.o obj-$(CONFIG_ZCACHE) += zcache.o Loading Loading
include/linux/plist.h +3 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,9 @@ static inline int plist_node_empty(const struct plist_node *node) #define plist_next(pos) \ list_next_entry(pos, node_list) #define plist_next_entry(pos, type, member) \ container_of(plist_next(pos), type, member) /** * plist_prev - get the prev entry in list * @pos: the type * to cursor Loading
include/linux/swap.h +5 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,7 @@ enum { #define SWAP_CLUSTER_MAX 32UL #define COMPACT_CLUSTER_MAX SWAP_CLUSTER_MAX #define SWAPFILE_CLUSTER 256 /* * Ratio between zone->managed_pages and the "gap" that above the per-zone Loading Loading @@ -255,6 +256,8 @@ struct swap_info_struct { struct work_struct discard_work; /* discard worker */ struct swap_cluster_info discard_cluster_head; /* list head of discard clusters */ struct swap_cluster_info discard_cluster_tail; /* list tail of discard clusters */ unsigned int write_pending; unsigned int max_writes; }; /* linux/mm/workingset.c */ Loading Loading @@ -338,6 +341,8 @@ extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, unsigned long *nr_scanned); extern unsigned long shrink_all_memory(unsigned long nr_pages); extern int vm_swappiness; extern int sysctl_swap_ratio; extern int sysctl_swap_ratio_enable; extern int remove_mapping(struct address_space *mapping, struct page *page); extern unsigned long vm_total_pages; Loading
include/linux/swapfile.h +5 −0 Original line number Diff line number Diff line Loading @@ -7,7 +7,12 @@ */ extern spinlock_t swap_lock; extern struct plist_head swap_active_head; extern spinlock_t swap_avail_lock; extern struct plist_head swap_avail_head; extern struct swap_info_struct *swap_info[]; extern int try_to_unuse(unsigned int, bool, unsigned long); extern int swap_ratio(struct swap_info_struct **si); extern void setup_swap_ratio(struct swap_info_struct *p, int prio); extern bool is_swap_ratio_group(int prio); #endif /* _LINUX_SWAPFILE_H */
kernel/sysctl.c +16 −0 Original line number Diff line number Diff line Loading @@ -1752,6 +1752,22 @@ static struct ctl_table vm_table[] = { .mode = 0644, .proc_handler = proc_doulongvec_minmax, }, #ifdef CONFIG_SWAP { .procname = "swap_ratio", .data = &sysctl_swap_ratio, .maxlen = sizeof(sysctl_swap_ratio), .mode = 0644, .proc_handler = proc_dointvec_minmax, }, { .procname = "swap_ratio_enable", .data = &sysctl_swap_ratio_enable, .maxlen = sizeof(sysctl_swap_ratio_enable), .mode = 0644, .proc_handler = proc_dointvec_minmax, }, #endif { } }; Loading
mm/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ ifdef CONFIG_MMU endif obj-$(CONFIG_HAVE_MEMBLOCK) += memblock.o obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o swap_ratio.o obj-$(CONFIG_FRONTSWAP) += frontswap.o obj-$(CONFIG_ZSWAP) += zswap.o obj-$(CONFIG_ZCACHE) += zcache.o Loading