Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308898
b: refs/heads/master
c: f3fd4a6
h: refs/heads/master
v: v3
  • Loading branch information
Konstantin Khlebnikov authored and Linus Torvalds committed May 29, 2012
1 parent 71b385c commit 3807ccc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 30 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: 014483bcccc5edbf861d89dc1a6f7cdc02f9f4c0
refs/heads/master: f3fd4a61928a5edf5b033a417e761b488b43e203
10 changes: 3 additions & 7 deletions trunk/include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,12 @@ struct lruvec {
#define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON)
#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)

/* Isolate inactive pages */
#define ISOLATE_INACTIVE ((__force isolate_mode_t)0x1)
/* Isolate active pages */
#define ISOLATE_ACTIVE ((__force isolate_mode_t)0x2)
/* Isolate clean file */
#define ISOLATE_CLEAN ((__force isolate_mode_t)0x4)
#define ISOLATE_CLEAN ((__force isolate_mode_t)0x1)
/* Isolate unmapped file */
#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8)
#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x2)
/* Isolate for asynchronous migration */
#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x10)
#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x4)

/* LRU Isolation modes. */
typedef unsigned __bitwise__ isolate_mode_t;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static inline void lru_cache_add_file(struct page *page)
/* linux/mm/vmscan.c */
extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
gfp_t gfp_mask, nodemask_t *mask);
extern int __isolate_lru_page(struct page *page, isolate_mode_t mode, int file);
extern int __isolate_lru_page(struct page *page, isolate_mode_t mode);
extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
gfp_t gfp_mask, bool noswap);
extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
unsigned long last_pageblock_nr = 0, pageblock_nr;
unsigned long nr_scanned = 0, nr_isolated = 0;
struct list_head *migratelist = &cc->migratepages;
isolate_mode_t mode = ISOLATE_ACTIVE|ISOLATE_INACTIVE;
isolate_mode_t mode = 0;

/*
* Ensure that there are not too many pages isolated from the LRU
Expand Down Expand Up @@ -329,7 +329,7 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
mode |= ISOLATE_ASYNC_MIGRATE;

/* Try isolate the page */
if (__isolate_lru_page(page, mode, 0) != 0)
if (__isolate_lru_page(page, mode) != 0)
continue;

VM_BUG_ON(PageTransCompound(page));
Expand Down
23 changes: 4 additions & 19 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,29 +949,14 @@ static unsigned long shrink_page_list(struct list_head *page_list,
*
* returns 0 on success, -ve errno on failure.
*/
int __isolate_lru_page(struct page *page, isolate_mode_t mode, int file)
int __isolate_lru_page(struct page *page, isolate_mode_t mode)
{
bool all_lru_mode;
int ret = -EINVAL;

/* Only take pages on the LRU. */
if (!PageLRU(page))
return ret;

all_lru_mode = (mode & (ISOLATE_ACTIVE|ISOLATE_INACTIVE)) ==
(ISOLATE_ACTIVE|ISOLATE_INACTIVE);

/*
* When checking the active state, we need to be sure we are
* dealing with comparible boolean values. Take the logical not
* of each.
*/
if (!all_lru_mode && !PageActive(page) != !(mode & ISOLATE_ACTIVE))
return ret;

if (!all_lru_mode && !!page_is_file_cache(page) != file)
return ret;

/* Do not give back unevictable pages for compaction */
if (PageUnevictable(page))
return ret;
Expand Down Expand Up @@ -1070,7 +1055,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,

VM_BUG_ON(!PageLRU(page));

switch (__isolate_lru_page(page, mode, file)) {
switch (__isolate_lru_page(page, mode)) {
case 0:
mem_cgroup_lru_del(page);
list_move(&page->lru, dst);
Expand Down Expand Up @@ -1282,7 +1267,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz,
unsigned long nr_file;
unsigned long nr_dirty = 0;
unsigned long nr_writeback = 0;
isolate_mode_t isolate_mode = ISOLATE_INACTIVE;
isolate_mode_t isolate_mode = 0;
int file = is_file_lru(lru);
struct zone *zone = mz->zone;
struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(mz);
Expand Down Expand Up @@ -1452,7 +1437,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
struct page *page;
struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(mz);
unsigned long nr_rotated = 0;
isolate_mode_t isolate_mode = ISOLATE_ACTIVE;
isolate_mode_t isolate_mode = 0;
int file = is_file_lru(lru);
struct zone *zone = mz->zone;

Expand Down

0 comments on commit 3807ccc

Please sign in to comment.