blob: fabc50adc46a4f9447466861883e1b3601b261a1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * arch/s390/mm/cmm.c
3 *
4 * S390 version
5 * Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
7 *
8 * Collaborative memory management interface.
9 */
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <linux/errno.h>
12#include <linux/fs.h>
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/sched.h>
16#include <linux/sysctl.h>
17#include <linux/ctype.h>
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070018#include <linux/swap.h>
Heiko Carstense8216de2006-09-25 23:33:11 -070019#include <linux/kthread.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
21#include <asm/pgalloc.h>
22#include <asm/uaccess.h>
Michael Holzheu0a87c5c2007-08-22 13:51:40 +020023#include <asm/diag.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
Martin Schwidefsky15439d72005-05-01 08:58:58 -070025static char *sender = "VMRMSVM";
Heiko Carstens447570c2005-06-21 17:16:29 -070026module_param(sender, charp, 0400);
Martin Schwidefsky15439d72005-05-01 08:58:58 -070027MODULE_PARM_DESC(sender,
28 "Guest name that may send SMSG messages (default VMRMSVM)");
29
Linus Torvalds1da177e2005-04-16 15:20:36 -070030#include "../../../drivers/s390/net/smsgiucv.h"
31
32#define CMM_NR_PAGES ((PAGE_SIZE / sizeof(unsigned long)) - 2)
33
34struct cmm_page_array {
35 struct cmm_page_array *next;
36 unsigned long index;
37 unsigned long pages[CMM_NR_PAGES];
38};
39
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070040static long cmm_pages;
41static long cmm_timed_pages;
42static volatile long cmm_pages_target;
43static volatile long cmm_timed_pages_target;
44static long cmm_timeout_pages;
45static long cmm_timeout_seconds;
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070047static struct cmm_page_array *cmm_page_list;
48static struct cmm_page_array *cmm_timed_page_list;
49static DEFINE_SPINLOCK(cmm_lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
Heiko Carstense8216de2006-09-25 23:33:11 -070051static struct task_struct *cmm_thread_ptr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052static wait_queue_head_t cmm_thread_wait;
53static struct timer_list cmm_timer;
54
55static void cmm_timer_fn(unsigned long);
56static void cmm_set_timer(void);
57
58static long
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070059cmm_alloc_pages(long nr, long *counter, struct cmm_page_array **list)
Linus Torvalds1da177e2005-04-16 15:20:36 -070060{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070061 struct cmm_page_array *pa, *npa;
62 unsigned long addr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070064 while (nr) {
65 addr = __get_free_page(GFP_NOIO);
66 if (!addr)
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 break;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070068 spin_lock(&cmm_lock);
69 pa = *list;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 if (!pa || pa->index >= CMM_NR_PAGES) {
71 /* Need a new page for the page list. */
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070072 spin_unlock(&cmm_lock);
73 npa = (struct cmm_page_array *)
Linus Torvalds1da177e2005-04-16 15:20:36 -070074 __get_free_page(GFP_NOIO);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070075 if (!npa) {
76 free_page(addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070077 break;
78 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070079 spin_lock(&cmm_lock);
80 pa = *list;
81 if (!pa || pa->index >= CMM_NR_PAGES) {
82 npa->next = pa;
83 npa->index = 0;
84 pa = npa;
85 *list = pa;
86 } else
87 free_page((unsigned long) npa);
Linus Torvalds1da177e2005-04-16 15:20:36 -070088 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070089 diag10(addr);
90 pa->pages[pa->index++] = addr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070091 (*counter)++;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070092 spin_unlock(&cmm_lock);
93 nr--;
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070095 return nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070096}
97
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070098static long
99cmm_free_pages(long nr, long *counter, struct cmm_page_array **list)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100{
101 struct cmm_page_array *pa;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700102 unsigned long addr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700104 spin_lock(&cmm_lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 pa = *list;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700106 while (nr) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107 if (!pa || pa->index <= 0)
108 break;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700109 addr = pa->pages[--pa->index];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 if (pa->index == 0) {
111 pa = pa->next;
112 free_page((unsigned long) *list);
113 *list = pa;
114 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700115 free_page(addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 (*counter)--;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700117 nr--;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700119 spin_unlock(&cmm_lock);
120 return nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121}
122
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700123static int cmm_oom_notify(struct notifier_block *self,
124 unsigned long dummy, void *parm)
125{
126 unsigned long *freed = parm;
127 long nr = 256;
128
129 nr = cmm_free_pages(nr, &cmm_timed_pages, &cmm_timed_page_list);
130 if (nr > 0)
131 nr = cmm_free_pages(nr, &cmm_pages, &cmm_page_list);
132 cmm_pages_target = cmm_pages;
133 cmm_timed_pages_target = cmm_timed_pages;
134 *freed += 256 - nr;
135 return NOTIFY_OK;
136}
137
138static struct notifier_block cmm_oom_nb = {
139 .notifier_call = cmm_oom_notify
140};
141
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142static int
143cmm_thread(void *dummy)
144{
145 int rc;
146
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147 while (1) {
148 rc = wait_event_interruptible(cmm_thread_wait,
149 (cmm_pages != cmm_pages_target ||
Heiko Carstense8216de2006-09-25 23:33:11 -0700150 cmm_timed_pages != cmm_timed_pages_target ||
151 kthread_should_stop()));
152 if (kthread_should_stop() || rc == -ERESTARTSYS) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 cmm_pages_target = cmm_pages;
154 cmm_timed_pages_target = cmm_timed_pages;
155 break;
156 }
157 if (cmm_pages_target > cmm_pages) {
158 if (cmm_alloc_pages(1, &cmm_pages, &cmm_page_list))
159 cmm_pages_target = cmm_pages;
160 } else if (cmm_pages_target < cmm_pages) {
161 cmm_free_pages(1, &cmm_pages, &cmm_page_list);
162 }
163 if (cmm_timed_pages_target > cmm_timed_pages) {
164 if (cmm_alloc_pages(1, &cmm_timed_pages,
165 &cmm_timed_page_list))
166 cmm_timed_pages_target = cmm_timed_pages;
167 } else if (cmm_timed_pages_target < cmm_timed_pages) {
168 cmm_free_pages(1, &cmm_timed_pages,
169 &cmm_timed_page_list);
170 }
171 if (cmm_timed_pages > 0 && !timer_pending(&cmm_timer))
172 cmm_set_timer();
173 }
174 return 0;
175}
176
177static void
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178cmm_kick_thread(void)
179{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180 wake_up(&cmm_thread_wait);
181}
182
183static void
184cmm_set_timer(void)
185{
186 if (cmm_timed_pages_target <= 0 || cmm_timeout_seconds <= 0) {
187 if (timer_pending(&cmm_timer))
188 del_timer(&cmm_timer);
189 return;
190 }
191 if (timer_pending(&cmm_timer)) {
192 if (mod_timer(&cmm_timer, jiffies + cmm_timeout_seconds*HZ))
193 return;
194 }
195 cmm_timer.function = cmm_timer_fn;
196 cmm_timer.data = 0;
197 cmm_timer.expires = jiffies + cmm_timeout_seconds*HZ;
198 add_timer(&cmm_timer);
199}
200
201static void
202cmm_timer_fn(unsigned long ignored)
203{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700204 long nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700206 nr = cmm_timed_pages_target - cmm_timeout_pages;
207 if (nr < 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208 cmm_timed_pages_target = 0;
209 else
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700210 cmm_timed_pages_target = nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211 cmm_kick_thread();
212 cmm_set_timer();
213}
214
215void
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700216cmm_set_pages(long nr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700218 cmm_pages_target = nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219 cmm_kick_thread();
220}
221
222long
223cmm_get_pages(void)
224{
225 return cmm_pages;
226}
227
228void
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700229cmm_add_timed_pages(long nr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700231 cmm_timed_pages_target += nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232 cmm_kick_thread();
233}
234
235long
236cmm_get_timed_pages(void)
237{
238 return cmm_timed_pages;
239}
240
241void
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700242cmm_set_timeout(long nr, long seconds)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700244 cmm_timeout_pages = nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245 cmm_timeout_seconds = seconds;
246 cmm_set_timer();
247}
248
Heiko Carstens4d284ca2007-02-05 21:18:53 +0100249static int
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250cmm_skip_blanks(char *cp, char **endp)
251{
252 char *str;
253
254 for (str = cp; *str == ' ' || *str == '\t'; str++);
255 *endp = str;
256 return str != cp;
257}
258
259#ifdef CONFIG_CMM_PROC
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
261static struct ctl_table cmm_table[];
262
263static int
264cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
Al Viroaaedd942006-02-01 06:29:14 -0500265 void __user *buffer, size_t *lenp, loff_t *ppos)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266{
267 char buf[16], *p;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700268 long nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269 int len;
270
271 if (!*lenp || (*ppos && !write)) {
272 *lenp = 0;
273 return 0;
274 }
275
276 if (write) {
277 len = *lenp;
278 if (copy_from_user(buf, buffer,
279 len > sizeof(buf) ? sizeof(buf) : len))
280 return -EFAULT;
281 buf[sizeof(buf) - 1] = '\0';
282 cmm_skip_blanks(buf, &p);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700283 nr = simple_strtoul(p, &p, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284 if (ctl == &cmm_table[0])
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700285 cmm_set_pages(nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286 else
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700287 cmm_add_timed_pages(nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288 } else {
289 if (ctl == &cmm_table[0])
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700290 nr = cmm_get_pages();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291 else
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700292 nr = cmm_get_timed_pages();
293 len = sprintf(buf, "%ld\n", nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294 if (len > *lenp)
295 len = *lenp;
296 if (copy_to_user(buffer, buf, len))
297 return -EFAULT;
298 }
299 *lenp = len;
300 *ppos += len;
301 return 0;
302}
303
304static int
305cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
Al Viroaaedd942006-02-01 06:29:14 -0500306 void __user *buffer, size_t *lenp, loff_t *ppos)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307{
308 char buf[64], *p;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700309 long nr, seconds;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310 int len;
311
312 if (!*lenp || (*ppos && !write)) {
313 *lenp = 0;
314 return 0;
315 }
316
317 if (write) {
318 len = *lenp;
319 if (copy_from_user(buf, buffer,
320 len > sizeof(buf) ? sizeof(buf) : len))
321 return -EFAULT;
322 buf[sizeof(buf) - 1] = '\0';
323 cmm_skip_blanks(buf, &p);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700324 nr = simple_strtoul(p, &p, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325 cmm_skip_blanks(p, &p);
Heiko Carstens7d5d6882006-09-20 15:59:00 +0200326 seconds = simple_strtoul(p, &p, 0);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700327 cmm_set_timeout(nr, seconds);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328 } else {
329 len = sprintf(buf, "%ld %ld\n",
330 cmm_timeout_pages, cmm_timeout_seconds);
331 if (len > *lenp)
332 len = *lenp;
333 if (copy_to_user(buffer, buf, len))
334 return -EFAULT;
335 }
336 *lenp = len;
337 *ppos += len;
338 return 0;
339}
340
341static struct ctl_table cmm_table[] = {
342 {
343 .ctl_name = VM_CMM_PAGES,
344 .procname = "cmm_pages",
Martin Schwidefsky5e8b1c42006-03-24 03:15:16 -0800345 .mode = 0644,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346 .proc_handler = &cmm_pages_handler,
347 },
348 {
349 .ctl_name = VM_CMM_TIMED_PAGES,
350 .procname = "cmm_timed_pages",
Martin Schwidefsky5e8b1c42006-03-24 03:15:16 -0800351 .mode = 0644,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 .proc_handler = &cmm_pages_handler,
353 },
354 {
355 .ctl_name = VM_CMM_TIMEOUT,
356 .procname = "cmm_timeout",
Martin Schwidefsky5e8b1c42006-03-24 03:15:16 -0800357 .mode = 0644,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358 .proc_handler = &cmm_timeout_handler,
359 },
360 { .ctl_name = 0 }
361};
362
363static struct ctl_table cmm_dir_table[] = {
364 {
365 .ctl_name = CTL_VM,
366 .procname = "vm",
367 .maxlen = 0,
368 .mode = 0555,
369 .child = cmm_table,
370 },
371 { .ctl_name = 0 }
372};
373#endif
374
375#ifdef CONFIG_CMM_IUCV
376#define SMSG_PREFIX "CMM"
377static void
Martin Schwidefsky15439d72005-05-01 08:58:58 -0700378cmm_smsg_target(char *from, char *msg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700380 long nr, seconds;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381
Martin Schwidefsky15439d72005-05-01 08:58:58 -0700382 if (strlen(sender) > 0 && strcmp(from, sender) != 0)
383 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384 if (!cmm_skip_blanks(msg + strlen(SMSG_PREFIX), &msg))
385 return;
386 if (strncmp(msg, "SHRINK", 6) == 0) {
387 if (!cmm_skip_blanks(msg + 6, &msg))
388 return;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700389 nr = simple_strtoul(msg, &msg, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390 cmm_skip_blanks(msg, &msg);
391 if (*msg == '\0')
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700392 cmm_set_pages(nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700393 } else if (strncmp(msg, "RELEASE", 7) == 0) {
394 if (!cmm_skip_blanks(msg + 7, &msg))
395 return;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700396 nr = simple_strtoul(msg, &msg, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397 cmm_skip_blanks(msg, &msg);
398 if (*msg == '\0')
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700399 cmm_add_timed_pages(nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 } else if (strncmp(msg, "REUSE", 5) == 0) {
401 if (!cmm_skip_blanks(msg + 5, &msg))
402 return;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700403 nr = simple_strtoul(msg, &msg, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404 if (!cmm_skip_blanks(msg, &msg))
405 return;
Heiko Carstens7d5d6882006-09-20 15:59:00 +0200406 seconds = simple_strtoul(msg, &msg, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407 cmm_skip_blanks(msg, &msg);
408 if (*msg == '\0')
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700409 cmm_set_timeout(nr, seconds);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410 }
411}
412#endif
413
Heiko Carstens2b67fc42007-02-05 21:16:47 +0100414static struct ctl_table_header *cmm_sysctl_header;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700415
416static int
417cmm_init (void)
418{
Heiko Carstense8216de2006-09-25 23:33:11 -0700419 int rc = -ENOMEM;
420
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421#ifdef CONFIG_CMM_PROC
Eric W. Biederman0b4d4142007-02-14 00:34:09 -0800422 cmm_sysctl_header = register_sysctl_table(cmm_dir_table);
Heiko Carstense8216de2006-09-25 23:33:11 -0700423 if (!cmm_sysctl_header)
424 goto out;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425#endif
426#ifdef CONFIG_CMM_IUCV
Heiko Carstense8216de2006-09-25 23:33:11 -0700427 rc = smsg_register_callback(SMSG_PREFIX, cmm_smsg_target);
428 if (rc < 0)
429 goto out_smsg;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430#endif
Heiko Carstense8216de2006-09-25 23:33:11 -0700431 rc = register_oom_notifier(&cmm_oom_nb);
432 if (rc < 0)
433 goto out_oom_notify;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434 init_waitqueue_head(&cmm_thread_wait);
435 init_timer(&cmm_timer);
Heiko Carstense8216de2006-09-25 23:33:11 -0700436 cmm_thread_ptr = kthread_run(cmm_thread, NULL, "cmmthread");
437 rc = IS_ERR(cmm_thread_ptr) ? PTR_ERR(cmm_thread_ptr) : 0;
438 if (!rc)
439 goto out;
440 /*
441 * kthread_create failed. undo all the stuff from above again.
442 */
443 unregister_oom_notifier(&cmm_oom_nb);
444
445out_oom_notify:
446#ifdef CONFIG_CMM_IUCV
447 smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target);
448out_smsg:
449#endif
450#ifdef CONFIG_CMM_PROC
451 unregister_sysctl_table(cmm_sysctl_header);
452#endif
453out:
454 return rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455}
456
457static void
458cmm_exit(void)
459{
Heiko Carstense8216de2006-09-25 23:33:11 -0700460 kthread_stop(cmm_thread_ptr);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700461 unregister_oom_notifier(&cmm_oom_nb);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700462 cmm_free_pages(cmm_pages, &cmm_pages, &cmm_page_list);
463 cmm_free_pages(cmm_timed_pages, &cmm_timed_pages, &cmm_timed_page_list);
464#ifdef CONFIG_CMM_PROC
465 unregister_sysctl_table(cmm_sysctl_header);
466#endif
467#ifdef CONFIG_CMM_IUCV
468 smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target);
469#endif
470}
471
472module_init(cmm_init);
473module_exit(cmm_exit);
474
475EXPORT_SYMBOL(cmm_set_pages);
476EXPORT_SYMBOL(cmm_get_pages);
477EXPORT_SYMBOL(cmm_add_timed_pages);
478EXPORT_SYMBOL(cmm_get_timed_pages);
479EXPORT_SYMBOL(cmm_set_timeout);
480
481MODULE_LICENSE("GPL");