OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [mmnommu/] [swap.c] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1634 jcastillo
/*
2
 *  linux/mm/swap.c
3
 *
4
 *  Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
5
 */
6
 
7
/*
8
 * DJD: This file should go away for uClinux...
9
 * Need to look for dependancies.
10
 */
11
 
12
/*
13
 * This file should contain most things doing the swapping from/to disk.
14
 * Started 18.12.91
15
 *
16
 * Swap aging added 23.2.95, Stephen Tweedie.
17
 */
18
 
19
/*
20
 * uClinux revisions for NO_MM
21
 * Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com>,
22
 *                     The Silver Hammer Group, Ltd.
23
 * Copyright (C) 1999  D. Jeff Dionne <jeff@uclinux.org>,
24
 *                     Rt-Control, Inc.
25
 */
26
 
27
#include <linux/mm.h>
28
#include <linux/sched.h>
29
#include <linux/head.h>
30
#include <linux/kernel.h>
31
#include <linux/kernel_stat.h>
32
#include <linux/errno.h>
33
#include <linux/string.h>
34
#include <linux/stat.h>
35
#include <linux/swap.h>
36
#include <linux/fs.h>
37
#include <linux/swapctl.h>
38
#include <linux/pagemap.h>
39
 
40
#include <asm/dma.h>
41
#include <asm/system.h> /* for cli()/sti() */
42
#include <asm/segment.h> /* for memcpy_to/fromfs */
43
#include <asm/bitops.h>
44
#include <asm/pgtable.h>
45
 
46
/*
47
 * We identify three levels of free memory.  We never let free mem
48
 * fall below the min_free_pages except for atomic allocations.  We
49
 * start background swapping if we fall below free_pages_high free
50
 * pages, and we begin intensive swapping below free_pages_low.
51
 *
52
 * Keep these three variables contiguous for sysctl(2).
53
 */
54
int min_free_pages = 20;
55
int free_pages_low = 30;
56
int free_pages_high = 40;
57
 
58
/* We track the number of pages currently being asynchronously swapped
59
   out, so that we don't try to swap TOO many pages out at once */
60
atomic_t nr_async_pages = 0;
61
 
62
/*
63
 * Constants for the page aging mechanism: the maximum age (actually,
64
 * the maximum "youthfulness"); the quanta by which pages rejuvenate
65
 * and age; and the initial age for new pages.
66
 */
67
 
68
swap_control_t swap_control = {
69
        20, 3, 1, 3,            /* Page aging */
70
        10, 2, 2, 4,            /* Buffer aging */
71
        32, 4,                  /* Aging cluster */
72
        8192, 8192,             /* Pageout and bufferout weights */
73
        -200,                   /* Buffer grace */
74
        1, 1,                   /* Buffs/pages to free */
75
        RCL_ROUND_ROBIN         /* Balancing policy */
76
};
77
 
78
swapstat_t swapstats = {0};
79
 
80
/* General swap control */
81
 
82
/* Parse the kernel command line "swap=" option at load time: */
83
void swap_setup(char *str, int *ints)
84
{
85
}
86
 
87
/* Parse the kernel command line "buff=" option at load time: */
88
void buff_setup(char *str, int *ints)
89
{
90
}
91
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.