Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126211
b: refs/heads/master
c: b962716
h: refs/heads/master
i:
  126209: d034607
  126207: 430159b
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Jan 6, 2009
1 parent 903f9ed commit c025b1f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 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: 60371d971a3d01afd102f0bbf2681f32ecc31d78
refs/heads/master: b962716b459505a8d83aea313fea0abe76749f42
5 changes: 3 additions & 2 deletions trunk/include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ struct swap_list_t {
/* linux/mm/page_alloc.c */
extern unsigned long totalram_pages;
extern unsigned long totalreserve_pages;
extern long nr_swap_pages;
extern unsigned int nr_free_buffer_pages(void);
extern unsigned int nr_free_pagecache_pages(void);

Expand Down Expand Up @@ -291,6 +290,7 @@ extern struct page *swapin_readahead(swp_entry_t, gfp_t,
struct vm_area_struct *vma, unsigned long addr);

/* linux/mm/swapfile.c */
extern long nr_swap_pages;
extern long total_swap_pages;
extern void si_swapinfo(struct sysinfo *);
extern swp_entry_t get_swap_page(void);
Expand Down Expand Up @@ -331,7 +331,8 @@ static inline void disable_swap_token(void)

#else /* CONFIG_SWAP */

#define total_swap_pages 0
#define nr_swap_pages 0L
#define total_swap_pages 0L
#define total_swapcache_pages 0UL

#define si_swapinfo(val) \
Expand Down
1 change: 0 additions & 1 deletion trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ EXPORT_SYMBOL(node_states);

unsigned long totalram_pages __read_mostly;
unsigned long totalreserve_pages __read_mostly;
long nr_swap_pages;
int percpu_pagelist_fraction;

#ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
Expand Down
1 change: 1 addition & 0 deletions trunk/mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

static DEFINE_SPINLOCK(swap_lock);
static unsigned int nr_swapfiles;
long nr_swap_pages;
long total_swap_pages;
static int swap_overflow;
static int least_priority;
Expand Down
12 changes: 6 additions & 6 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1327,19 +1327,19 @@ static void get_scan_ratio(struct zone *zone, struct scan_control *sc,
unsigned long anon_prio, file_prio;
unsigned long ap, fp;

anon = zone_page_state(zone, NR_ACTIVE_ANON) +
zone_page_state(zone, NR_INACTIVE_ANON);
file = zone_page_state(zone, NR_ACTIVE_FILE) +
zone_page_state(zone, NR_INACTIVE_FILE);
free = zone_page_state(zone, NR_FREE_PAGES);

/* If we have no swap space, do not bother scanning anon pages. */
if (nr_swap_pages <= 0) {
percent[0] = 0;
percent[1] = 100;
return;
}

anon = zone_page_state(zone, NR_ACTIVE_ANON) +
zone_page_state(zone, NR_INACTIVE_ANON);
file = zone_page_state(zone, NR_ACTIVE_FILE) +
zone_page_state(zone, NR_INACTIVE_FILE);
free = zone_page_state(zone, NR_FREE_PAGES);

/* If we have very few page cache pages, force-scan anon pages. */
if (unlikely(file + free <= zone->pages_high)) {
percent[0] = 100;
Expand Down

0 comments on commit c025b1f

Please sign in to comment.