blob: d4ed93dfb9c7fba3eada5ccbcf4cdf66c39ebc8a [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>
David Rientjes5a3135c22007-10-16 23:25:53 -070020#include <linux/oom.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
22#include <asm/pgalloc.h>
23#include <asm/uaccess.h>
Michael Holzheu0a87c5c2007-08-22 13:51:40 +020024#include <asm/diag.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Martin Schwidefsky15439d72005-05-01 08:58:58 -070026static char *sender = "VMRMSVM";
Heiko Carstens447570c2005-06-21 17:16:29 -070027module_param(sender, charp, 0400);
Martin Schwidefsky15439d72005-05-01 08:58:58 -070028MODULE_PARM_DESC(sender,
29 "Guest name that may send SMSG messages (default VMRMSVM)");
30
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#include "../../../drivers/s390/net/smsgiucv.h"
32
33#define CMM_NR_PAGES ((PAGE_SIZE / sizeof(unsigned long)) - 2)
34
35struct cmm_page_array {
36 struct cmm_page_array *next;
37 unsigned long index;
38 unsigned long pages[CMM_NR_PAGES];
39};
40
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070041static long cmm_pages;
42static long cmm_timed_pages;
43static volatile long cmm_pages_target;
44static volatile long cmm_timed_pages_target;
45static long cmm_timeout_pages;
46static long cmm_timeout_seconds;
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070048static struct cmm_page_array *cmm_page_list;
49static struct cmm_page_array *cmm_timed_page_list;
50static DEFINE_SPINLOCK(cmm_lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Heiko Carstense8216de2006-09-25 23:33:11 -070052static struct task_struct *cmm_thread_ptr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070053static wait_queue_head_t cmm_thread_wait;
54static struct timer_list cmm_timer;
55
56static void cmm_timer_fn(unsigned long);
57static void cmm_set_timer(void);
58
59static long
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070060cmm_alloc_pages(long nr, long *counter, struct cmm_page_array **list)
Linus Torvalds1da177e2005-04-16 15:20:36 -070061{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070062 struct cmm_page_array *pa, *npa;
63 unsigned long addr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070065 while (nr) {
66 addr = __get_free_page(GFP_NOIO);
67 if (!addr)
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 break;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070069 spin_lock(&cmm_lock);
70 pa = *list;
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 if (!pa || pa->index >= CMM_NR_PAGES) {
72 /* Need a new page for the page list. */
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070073 spin_unlock(&cmm_lock);
74 npa = (struct cmm_page_array *)
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 __get_free_page(GFP_NOIO);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070076 if (!npa) {
77 free_page(addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 break;
79 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070080 spin_lock(&cmm_lock);
81 pa = *list;
82 if (!pa || pa->index >= CMM_NR_PAGES) {
83 npa->next = pa;
84 npa->index = 0;
85 pa = npa;
86 *list = pa;
87 } else
88 free_page((unsigned long) npa);
Linus Torvalds1da177e2005-04-16 15:20:36 -070089 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070090 diag10(addr);
91 pa->pages[pa->index++] = addr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 (*counter)++;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070093 spin_unlock(&cmm_lock);
94 nr--;
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070096 return nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070097}
98
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -070099static long
100cmm_free_pages(long nr, long *counter, struct cmm_page_array **list)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101{
102 struct cmm_page_array *pa;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700103 unsigned long addr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700105 spin_lock(&cmm_lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 pa = *list;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700107 while (nr) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 if (!pa || pa->index <= 0)
109 break;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700110 addr = pa->pages[--pa->index];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111 if (pa->index == 0) {
112 pa = pa->next;
113 free_page((unsigned long) *list);
114 *list = pa;
115 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700116 free_page(addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 (*counter)--;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700118 nr--;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 }
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700120 spin_unlock(&cmm_lock);
121 return nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122}
123
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700124static int cmm_oom_notify(struct notifier_block *self,
125 unsigned long dummy, void *parm)
126{
127 unsigned long *freed = parm;
128 long nr = 256;
129
130 nr = cmm_free_pages(nr, &cmm_timed_pages, &cmm_timed_page_list);
131 if (nr > 0)
132 nr = cmm_free_pages(nr, &cmm_pages, &cmm_page_list);
133 cmm_pages_target = cmm_pages;
134 cmm_timed_pages_target = cmm_timed_pages;
135 *freed += 256 - nr;
136 return NOTIFY_OK;
137}
138
139static struct notifier_block cmm_oom_nb = {
140 .notifier_call = cmm_oom_notify
141};
142
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143static int
144cmm_thread(void *dummy)
145{
146 int rc;
147
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 while (1) {
149 rc = wait_event_interruptible(cmm_thread_wait,
150 (cmm_pages != cmm_pages_target ||
Heiko Carstense8216de2006-09-25 23:33:11 -0700151 cmm_timed_pages != cmm_timed_pages_target ||
152 kthread_should_stop()));
153 if (kthread_should_stop() || rc == -ERESTARTSYS) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154 cmm_pages_target = cmm_pages;
155 cmm_timed_pages_target = cmm_timed_pages;
156 break;
157 }
158 if (cmm_pages_target > cmm_pages) {
159 if (cmm_alloc_pages(1, &cmm_pages, &cmm_page_list))
160 cmm_pages_target = cmm_pages;
161 } else if (cmm_pages_target < cmm_pages) {
162 cmm_free_pages(1, &cmm_pages, &cmm_page_list);
163 }
164 if (cmm_timed_pages_target > cmm_timed_pages) {
165 if (cmm_alloc_pages(1, &cmm_timed_pages,
166 &cmm_timed_page_list))
167 cmm_timed_pages_target = cmm_timed_pages;
168 } else if (cmm_timed_pages_target < cmm_timed_pages) {
169 cmm_free_pages(1, &cmm_timed_pages,
170 &cmm_timed_page_list);
171 }
172 if (cmm_timed_pages > 0 && !timer_pending(&cmm_timer))
173 cmm_set_timer();
174 }
175 return 0;
176}
177
178static void
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179cmm_kick_thread(void)
180{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181 wake_up(&cmm_thread_wait);
182}
183
184static void
185cmm_set_timer(void)
186{
187 if (cmm_timed_pages_target <= 0 || cmm_timeout_seconds <= 0) {
188 if (timer_pending(&cmm_timer))
189 del_timer(&cmm_timer);
190 return;
191 }
192 if (timer_pending(&cmm_timer)) {
193 if (mod_timer(&cmm_timer, jiffies + cmm_timeout_seconds*HZ))
194 return;
195 }
196 cmm_timer.function = cmm_timer_fn;
197 cmm_timer.data = 0;
198 cmm_timer.expires = jiffies + cmm_timeout_seconds*HZ;
199 add_timer(&cmm_timer);
200}
201
202static void
203cmm_timer_fn(unsigned long ignored)
204{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700205 long nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700207 nr = cmm_timed_pages_target - cmm_timeout_pages;
208 if (nr < 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209 cmm_timed_pages_target = 0;
210 else
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700211 cmm_timed_pages_target = nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212 cmm_kick_thread();
213 cmm_set_timer();
214}
215
216void
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700217cmm_set_pages(long nr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700219 cmm_pages_target = nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220 cmm_kick_thread();
221}
222
223long
224cmm_get_pages(void)
225{
226 return cmm_pages;
227}
228
229void
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700230cmm_add_timed_pages(long nr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700232 cmm_timed_pages_target += nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233 cmm_kick_thread();
234}
235
236long
237cmm_get_timed_pages(void)
238{
239 return cmm_timed_pages;
240}
241
242void
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700243cmm_set_timeout(long nr, long seconds)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700245 cmm_timeout_pages = nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246 cmm_timeout_seconds = seconds;
247 cmm_set_timer();
248}
249
Heiko Carstens4d284ca2007-02-05 21:18:53 +0100250static int
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251cmm_skip_blanks(char *cp, char **endp)
252{
253 char *str;
254
255 for (str = cp; *str == ' ' || *str == '\t'; str++);
256 *endp = str;
257 return str != cp;
258}
259
260#ifdef CONFIG_CMM_PROC
Linus Torvalds1da177e2005-04-16 15:20:36 -0700261
262static struct ctl_table cmm_table[];
263
264static int
265cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
Al Viroaaedd942006-02-01 06:29:14 -0500266 void __user *buffer, size_t *lenp, loff_t *ppos)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267{
268 char buf[16], *p;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700269 long nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270 int len;
271
272 if (!*lenp || (*ppos && !write)) {
273 *lenp = 0;
274 return 0;
275 }
276
277 if (write) {
278 len = *lenp;
279 if (copy_from_user(buf, buffer,
280 len > sizeof(buf) ? sizeof(buf) : len))
281 return -EFAULT;
282 buf[sizeof(buf) - 1] = '\0';
283 cmm_skip_blanks(buf, &p);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700284 nr = simple_strtoul(p, &p, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285 if (ctl == &cmm_table[0])
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700286 cmm_set_pages(nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287 else
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700288 cmm_add_timed_pages(nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289 } else {
290 if (ctl == &cmm_table[0])
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700291 nr = cmm_get_pages();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292 else
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700293 nr = cmm_get_timed_pages();
294 len = sprintf(buf, "%ld\n", nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295 if (len > *lenp)
296 len = *lenp;
297 if (copy_to_user(buffer, buf, len))
298 return -EFAULT;
299 }
300 *lenp = len;
301 *ppos += len;
302 return 0;
303}
304
305static int
306cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
Al Viroaaedd942006-02-01 06:29:14 -0500307 void __user *buffer, size_t *lenp, loff_t *ppos)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308{
309 char buf[64], *p;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700310 long nr, seconds;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311 int len;
312
313 if (!*lenp || (*ppos && !write)) {
314 *lenp = 0;
315 return 0;
316 }
317
318 if (write) {
319 len = *lenp;
320 if (copy_from_user(buf, buffer,
321 len > sizeof(buf) ? sizeof(buf) : len))
322 return -EFAULT;
323 buf[sizeof(buf) - 1] = '\0';
324 cmm_skip_blanks(buf, &p);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700325 nr = simple_strtoul(p, &p, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326 cmm_skip_blanks(p, &p);
Heiko Carstens7d5d6882006-09-20 15:59:00 +0200327 seconds = simple_strtoul(p, &p, 0);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700328 cmm_set_timeout(nr, seconds);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329 } else {
330 len = sprintf(buf, "%ld %ld\n",
331 cmm_timeout_pages, cmm_timeout_seconds);
332 if (len > *lenp)
333 len = *lenp;
334 if (copy_to_user(buffer, buf, len))
335 return -EFAULT;
336 }
337 *lenp = len;
338 *ppos += len;
339 return 0;
340}
341
342static struct ctl_table cmm_table[] = {
343 {
344 .ctl_name = VM_CMM_PAGES,
345 .procname = "cmm_pages",
Martin Schwidefsky5e8b1c42006-03-24 03:15:16 -0800346 .mode = 0644,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347 .proc_handler = &cmm_pages_handler,
348 },
349 {
350 .ctl_name = VM_CMM_TIMED_PAGES,
351 .procname = "cmm_timed_pages",
Martin Schwidefsky5e8b1c42006-03-24 03:15:16 -0800352 .mode = 0644,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700353 .proc_handler = &cmm_pages_handler,
354 },
355 {
356 .ctl_name = VM_CMM_TIMEOUT,
357 .procname = "cmm_timeout",
Martin Schwidefsky5e8b1c42006-03-24 03:15:16 -0800358 .mode = 0644,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700359 .proc_handler = &cmm_timeout_handler,
360 },
361 { .ctl_name = 0 }
362};
363
364static struct ctl_table cmm_dir_table[] = {
365 {
366 .ctl_name = CTL_VM,
367 .procname = "vm",
368 .maxlen = 0,
369 .mode = 0555,
370 .child = cmm_table,
371 },
372 { .ctl_name = 0 }
373};
374#endif
375
376#ifdef CONFIG_CMM_IUCV
377#define SMSG_PREFIX "CMM"
378static void
Martin Schwidefsky15439d72005-05-01 08:58:58 -0700379cmm_smsg_target(char *from, char *msg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380{
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700381 long nr, seconds;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382
Martin Schwidefsky15439d72005-05-01 08:58:58 -0700383 if (strlen(sender) > 0 && strcmp(from, sender) != 0)
384 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385 if (!cmm_skip_blanks(msg + strlen(SMSG_PREFIX), &msg))
386 return;
387 if (strncmp(msg, "SHRINK", 6) == 0) {
388 if (!cmm_skip_blanks(msg + 6, &msg))
389 return;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700390 nr = simple_strtoul(msg, &msg, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391 cmm_skip_blanks(msg, &msg);
392 if (*msg == '\0')
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700393 cmm_set_pages(nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394 } else if (strncmp(msg, "RELEASE", 7) == 0) {
395 if (!cmm_skip_blanks(msg + 7, &msg))
396 return;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700397 nr = simple_strtoul(msg, &msg, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700398 cmm_skip_blanks(msg, &msg);
399 if (*msg == '\0')
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700400 cmm_add_timed_pages(nr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401 } else if (strncmp(msg, "REUSE", 5) == 0) {
402 if (!cmm_skip_blanks(msg + 5, &msg))
403 return;
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700404 nr = simple_strtoul(msg, &msg, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405 if (!cmm_skip_blanks(msg, &msg))
406 return;
Heiko Carstens7d5d6882006-09-20 15:59:00 +0200407 seconds = simple_strtoul(msg, &msg, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700408 cmm_skip_blanks(msg, &msg);
409 if (*msg == '\0')
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700410 cmm_set_timeout(nr, seconds);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411 }
412}
413#endif
414
Heiko Carstens2b67fc42007-02-05 21:16:47 +0100415static struct ctl_table_header *cmm_sysctl_header;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416
417static int
418cmm_init (void)
419{
Heiko Carstense8216de2006-09-25 23:33:11 -0700420 int rc = -ENOMEM;
421
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422#ifdef CONFIG_CMM_PROC
Eric W. Biederman0b4d4142007-02-14 00:34:09 -0800423 cmm_sysctl_header = register_sysctl_table(cmm_dir_table);
Heiko Carstense8216de2006-09-25 23:33:11 -0700424 if (!cmm_sysctl_header)
425 goto out;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700426#endif
427#ifdef CONFIG_CMM_IUCV
Heiko Carstense8216de2006-09-25 23:33:11 -0700428 rc = smsg_register_callback(SMSG_PREFIX, cmm_smsg_target);
429 if (rc < 0)
430 goto out_smsg;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431#endif
Heiko Carstense8216de2006-09-25 23:33:11 -0700432 rc = register_oom_notifier(&cmm_oom_nb);
433 if (rc < 0)
434 goto out_oom_notify;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700435 init_waitqueue_head(&cmm_thread_wait);
436 init_timer(&cmm_timer);
Heiko Carstense8216de2006-09-25 23:33:11 -0700437 cmm_thread_ptr = kthread_run(cmm_thread, NULL, "cmmthread");
438 rc = IS_ERR(cmm_thread_ptr) ? PTR_ERR(cmm_thread_ptr) : 0;
439 if (!rc)
440 goto out;
441 /*
442 * kthread_create failed. undo all the stuff from above again.
443 */
444 unregister_oom_notifier(&cmm_oom_nb);
445
446out_oom_notify:
447#ifdef CONFIG_CMM_IUCV
448 smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target);
449out_smsg:
450#endif
451#ifdef CONFIG_CMM_PROC
452 unregister_sysctl_table(cmm_sysctl_header);
453#endif
454out:
455 return rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456}
457
458static void
459cmm_exit(void)
460{
Heiko Carstense8216de2006-09-25 23:33:11 -0700461 kthread_stop(cmm_thread_ptr);
Martin Schwidefsky8bc719d2006-09-25 23:31:20 -0700462 unregister_oom_notifier(&cmm_oom_nb);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700463 cmm_free_pages(cmm_pages, &cmm_pages, &cmm_page_list);
464 cmm_free_pages(cmm_timed_pages, &cmm_timed_pages, &cmm_timed_page_list);
465#ifdef CONFIG_CMM_PROC
466 unregister_sysctl_table(cmm_sysctl_header);
467#endif
468#ifdef CONFIG_CMM_IUCV
469 smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target);
470#endif
471}
472
473module_init(cmm_init);
474module_exit(cmm_exit);
475
476EXPORT_SYMBOL(cmm_set_pages);
477EXPORT_SYMBOL(cmm_get_pages);
478EXPORT_SYMBOL(cmm_add_timed_pages);
479EXPORT_SYMBOL(cmm_get_timed_pages);
480EXPORT_SYMBOL(cmm_set_timeout);
481
482MODULE_LICENSE("GPL");