Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284402
b: refs/heads/master
c: c824493
h: refs/heads/master
v: v3
  • Loading branch information
Mel Gorman authored and Linus Torvalds committed Jan 13, 2012
1 parent b1f27f5 commit f821942
Show file tree
Hide file tree
Showing 4 changed files with 39 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: b969c4ab9f182a6e1b2a0848be349f99714947b0
refs/heads/master: c82449352854ff09e43062246af86bdeb628f0c3
2 changes: 2 additions & 0 deletions trunk/include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ struct lruvec {
#define ISOLATE_CLEAN ((__force isolate_mode_t)0x4)
/* Isolate unmapped file */
#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8)
/* Isolate for asynchronous migration */
#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x10)

/* LRU Isolation modes. */
typedef unsigned __bitwise__ isolate_mode_t;
Expand Down
3 changes: 3 additions & 0 deletions trunk/mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
continue;
}

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

/* Try isolate the page */
if (__isolate_lru_page(page, mode, 0) != 0)
continue;
Expand Down
35 changes: 33 additions & 2 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,8 +1075,39 @@ 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;
/*
* To minimise LRU disruption, the caller can indicate that it only
* wants to isolate pages it will be able to operate on without
* blocking - clean pages for the most part.
*
* ISOLATE_CLEAN means that only clean pages should be isolated. This
* is used by reclaim when it is cannot write to backing storage
*
* ISOLATE_ASYNC_MIGRATE is used to indicate that it only wants to pages
* that it is possible to migrate without blocking
*/
if (mode & (ISOLATE_CLEAN|ISOLATE_ASYNC_MIGRATE)) {
/* All the caller can do on PageWriteback is block */
if (PageWriteback(page))
return ret;

if (PageDirty(page)) {
struct address_space *mapping;

/* ISOLATE_CLEAN means only clean pages */
if (mode & ISOLATE_CLEAN)
return ret;

/*
* Only pages without mappings or that have a
* ->migratepage callback are possible to migrate
* without blocking
*/
mapping = page_mapping(page);
if (mapping && !mapping->a_ops->migratepage)
return ret;
}
}

if ((mode & ISOLATE_UNMAPPED) && page_mapped(page))
return ret;
Expand Down

0 comments on commit f821942

Please sign in to comment.