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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [mmnommu/] [vmscan.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 *  linux/mm/vmscan.c
3
 *
4
 *  Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
5
 *
6
 *  Swap reorganised 29.12.95, Stephen Tweedie.
7
 *  kswapd added: 7.1.96  sct
8
 *  Version: $Id: vmscan.c,v 1.1.1.1 2001-09-10 07:44:46 simons Exp $
9
 */
10
 
11
/*
12
 * uClinux revisions for NO_MM
13
 * Copyright (C) 1998        Kenneth Albanowski <kjahds@kjahds.com>,
14
 *                           The Silver Hammer Group, Ltd.
15
 * Copyright (C) 1998, 1999  D. Jeff Dionne <jeff@uclinux.org>,
16
 *                           Rt-Control, Inc.
17
 */
18
 
19
#include <linux/mm.h>
20
#include <linux/sched.h>
21
#include <linux/head.h>
22
#include <linux/kernel.h>
23
#include <linux/kernel_stat.h>
24
#include <linux/errno.h>
25
#include <linux/string.h>
26
#include <linux/stat.h>
27
#include <linux/swap.h>
28
#include <linux/fs.h>
29
#include <linux/swapctl.h>
30
#include <linux/pagemap.h>
31
#include <linux/smp_lock.h>
32
 
33
/*
34
 * We can't swap, so all we can do is shrink mmap.
35
 */
36
int try_to_free_page(int priority, int dma, int wait)
37
{
38
        int i=6;
39
        int stop, can_do_io;
40
 
41
#ifdef DEBUG
42
        printk("trying to find free page within pid %d...\n", current->pid);
43
#endif
44
        /* we don't try as hard if we're not waiting.. */
45
        stop = 3;
46
        can_do_io = 1;
47
        if (wait)
48
                stop = 0;
49
        if (priority == GFP_IO)
50
                can_do_io = 0;
51
 
52
        do {
53
#ifdef DEBUG
54
                printk("Attempting to shrink_mmap\n");
55
#endif
56
                if (shrink_mmap(i, dma, can_do_io))
57
                        return 1;
58
                i--;
59
        } while ((i - stop) >= 0);
60
 
61
        printk("Failed to free page\n");
62
        return 0;
63
}
64
 
65
/*
66
 * In case someone wants to re-implement swapping...
67
 */
68
 
69
void init_swap_timer(void)
70
{
71
}

powered by: WebSVN 2.1.0

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