Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47404
b: refs/heads/master
c: 9617729
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 11, 2007
1 parent aabfa73 commit 33dc855
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51ed4491271be8c56bdb2a03481ed34ea4984bc2
refs/heads/master: 96177299416dbccb73b54e6b344260154a445375
4 changes: 2 additions & 2 deletions trunk/arch/sparc64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ void show_mem(void)
printk("Free swap: %6ldkB\n",
nr_swap_pages << (PAGE_SHIFT-10));
printk("%ld pages of RAM\n", num_physpages);
printk("%d free pages\n", nr_free_pages());
printk("%lu free pages\n", nr_free_pages());
}

void mmu_info(struct seq_file *m)
Expand Down Expand Up @@ -1593,7 +1593,7 @@ void __init mem_init(void)
initpages = (((unsigned long) __init_end) - ((unsigned long) __init_begin));
initpages = PAGE_ALIGN(initpages) >> PAGE_SHIFT;

printk("Memory: %uk available (%ldk kernel code, %ldk data, %ldk init) [%016lx,%016lx]\n",
printk("Memory: %luk available (%ldk kernel code, %ldk data, %ldk init) [%016lx,%016lx]\n",
nr_free_pages() << (PAGE_SHIFT-10),
codepages << (PAGE_SHIFT-10),
datapages << (PAGE_SHIFT-10),
Expand Down
5 changes: 4 additions & 1 deletion trunk/include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,14 @@ extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *
extern unsigned long totalram_pages;
extern unsigned long totalreserve_pages;
extern long nr_swap_pages;
extern unsigned int nr_free_pages(void);
extern unsigned int nr_free_pages_pgdat(pg_data_t *pgdat);
extern unsigned int nr_free_buffer_pages(void);
extern unsigned int nr_free_pagecache_pages(void);

/* Definition of global_page_state not available yet */
#define nr_free_pages() global_page_state(NR_FREE_PAGES)


/* linux/mm/swap.c */
extern void FASTCALL(lru_cache_add(struct page *));
extern void FASTCALL(lru_cache_add_active(struct page *));
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/vmstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <linux/types.h>
#include <linux/percpu.h>
#include <linux/mm.h>
#include <linux/mmzone.h>
#include <asm/atomic.h>

Expand Down
4 changes: 3 additions & 1 deletion trunk/kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/cpu.h>
#include <linux/resume-trace.h>
#include <linux/freezer.h>
#include <linux/vmstat.h>

#include "power.h"

Expand Down Expand Up @@ -72,7 +73,8 @@ static int suspend_prepare(suspend_state_t state)
goto Thaw;
}

if ((free_pages = nr_free_pages()) < FREE_PAGE_NUMBER) {
if ((free_pages = global_page_state(NR_FREE_PAGES))
< FREE_PAGE_NUMBER) {
pr_debug("PM: free some memory\n");
shrink_all_memory(FREE_PAGE_NUMBER - free_pages);
if (nr_free_pages() < FREE_PAGE_NUMBER) {
Expand Down
10 changes: 0 additions & 10 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,16 +1440,6 @@ fastcall void free_pages(unsigned long addr, unsigned int order)

EXPORT_SYMBOL(free_pages);

/*
* Total amount of free (allocatable) RAM:
*/
unsigned int nr_free_pages(void)
{
return global_page_state(NR_FREE_PAGES);
}

EXPORT_SYMBOL(nr_free_pages);

#ifdef CONFIG_NUMA
unsigned int nr_free_pages_pgdat(pg_data_t *pgdat)
{
Expand Down

0 comments on commit 33dc855

Please sign in to comment.