Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284413
b: refs/heads/master
c: 1c1c53d
h: refs/heads/master
i:
  284411: ca987fa
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Jan 13, 2012
1 parent 727d10c commit 3c7a305
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 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: 4111304dab198c687bc60f2e235a9f7ee92c47c8
refs/heads/master: 1c1c53d43b387d02174911ecb42ce846577b0ea0
15 changes: 9 additions & 6 deletions trunk/include/linux/mm_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ static inline enum lru_list page_lru_base_type(struct page *page)
return LRU_INACTIVE_ANON;
}

static inline void
del_page_from_lru(struct zone *zone, struct page *page)
/**
* page_off_lru - which LRU list was page on? clearing its lru flags.
* @page: the page to test
*
* Returns the LRU list a page was on, as an index into the array of LRU
* lists; and clears its Unevictable or Active flags, ready for freeing.
*/
static inline enum lru_list page_off_lru(struct page *page)
{
enum lru_list lru;

Expand All @@ -69,9 +75,7 @@ del_page_from_lru(struct zone *zone, struct page *page)
lru += LRU_ACTIVE;
}
}
mem_cgroup_lru_del_list(page, lru);
list_del(&page->lru);
__mod_zone_page_state(zone, NR_LRU_BASE + lru, -hpage_nr_pages(page));
return lru;
}

/**
Expand All @@ -92,7 +96,6 @@ static inline enum lru_list page_lru(struct page *page)
if (PageActive(page))
lru += LRU_ACTIVE;
}

return lru;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void __page_cache_release(struct page *page)
spin_lock_irqsave(&zone->lru_lock, flags);
VM_BUG_ON(!PageLRU(page));
__ClearPageLRU(page);
del_page_from_lru(zone, page);
del_page_from_lru_list(zone, page, page_off_lru(page));
spin_unlock_irqrestore(&zone->lru_lock, flags);
}
}
Expand Down Expand Up @@ -617,7 +617,7 @@ void release_pages(struct page **pages, int nr, int cold)
}
VM_BUG_ON(!PageLRU(page));
__ClearPageLRU(page);
del_page_from_lru(zone, page);
del_page_from_lru_list(zone, page, page_off_lru(page));
}

list_add(&page->lru, &pages_to_free);
Expand Down

0 comments on commit 3c7a305

Please sign in to comment.