1
2
3
4
5
6
7
8
9
10
11
12
13
14#include <linux/mm.h>
15#include <linux/sched.h>
16#include <linux/head.h>
17#include <linux/kernel.h>
18#include <linux/kernel_stat.h>
19#include <linux/errno.h>
20#include <linux/string.h>
21#include <linux/stat.h>
22#include <linux/swap.h>
23#include <linux/fs.h>
24#include <linux/swapctl.h>
25#include <linux/pagemap.h>
26#include <linux/init.h>
27
28#include <asm/dma.h>
29#include <asm/system.h>
30#include <asm/uaccess.h>
31#include <asm/bitops.h>
32#include <asm/pgtable.h>
33
34
35
36
37
38
39
40
41
42int min_free_pages = 48;
43int free_pages_low = 72;
44int free_pages_high = 96;
45
46
47
48atomic_t nr_async_pages = ATOMIC_INIT(0);
49
50
51
52
53
54
55
56swap_control_t swap_control = {
57 20, 3, 1, 3,
58 10, 2, 2, 4,
59 32, 4,
60 8192, 8192,
61 -200,
62 1, 1,
63 RCL_ROUND_ROBIN
64};
65
66swapstat_t swapstats = {0};
67
68
69
70
71__initfunc(void swap_setup(char *str, int *ints))
72{
73 int * swap_vars[8] = {
74 &MAX_PAGE_AGE,
75 &PAGE_ADVANCE,
76 &PAGE_DECLINE,
77 &PAGE_INITIAL_AGE,
78 &AGE_CLUSTER_FRACT,
79 &AGE_CLUSTER_MIN,
80 &PAGEOUT_WEIGHT,
81 &BUFFEROUT_WEIGHT
82 };
83 int i;
84 for (i=0; i < ints[0] && i < 8; i++) {
85 if (ints[i+1])
86 *(swap_vars[i]) = ints[i+1];
87 }
88}
89
90
91__initfunc(void buff_setup(char *str, int *ints))
92{
93 int * buff_vars[6] = {
94 &MAX_BUFF_AGE,
95 &BUFF_ADVANCE,
96 &BUFF_DECLINE,
97 &BUFF_INITIAL_AGE,
98 &BUFFEROUT_WEIGHT,
99 &BUFFERMEM_GRACE
100 };
101 int i;
102 for (i=0; i < ints[0] && i < 6; i++) {
103 if (ints[i+1])
104 *(buff_vars[i]) = ints[i+1];
105 }
106}
107
108