Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272109
b: refs/heads/master
c: 39deaf8
h: refs/heads/master
i:
  272107: aeec4a5
v: v3
  • Loading branch information
Minchan Kim authored and Linus Torvalds committed Nov 1, 2011
1 parent 1885866 commit 1ece0a7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 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: 4356f21d09283dc6d39a6f7287a65ddab61e2808
refs/heads/master: 39deaf8585152f1a35c1676d3d7dc6ae0fb65967
2 changes: 2 additions & 0 deletions trunk/include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ static inline int is_unevictable_lru(enum lru_list l)
#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)

/* LRU Isolation modes. */
typedef unsigned __bitwise__ isolate_mode_t;
Expand Down
7 changes: 5 additions & 2 deletions trunk/mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
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;

/* Do not scan outside zone boundaries */
low_pfn = max(cc->migrate_pfn, zone->zone_start_pfn);
Expand Down Expand Up @@ -348,9 +349,11 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
continue;
}

if (!cc->sync)
mode |= ISOLATE_CLEAN;

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

VM_BUG_ON(PageTransCompound(page));
Expand Down
3 changes: 3 additions & 0 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,9 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode, int file)

ret = -EBUSY;

if ((mode & ISOLATE_CLEAN) && (PageDirty(page) || PageWriteback(page)))
return ret;

if (likely(get_page_unless_zero(page))) {
/*
* Be careful not to clear PageLRU until after we're
Expand Down

0 comments on commit 1ece0a7

Please sign in to comment.