Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320793
b: refs/heads/master
c: 8093451
h: refs/heads/master
i:
  320791: 7013e33
v: v3
  • Loading branch information
Minchan Kim authored and Linus Torvalds committed Aug 1, 2012
1 parent 5322cce commit a19dd82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 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: 97d255c816946388bab504122937730d3447c612
refs/heads/master: 80934513b230bfcf70265f2ef0fdae89fb391633
34 changes: 18 additions & 16 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5471,26 +5471,28 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
}

/*
* This is designed as sub function...plz see page_isolation.c also.
* set/clear page block's type to be ISOLATE.
* page allocater never alloc memory from ISOLATE block.
* This function checks whether pageblock includes unmovable pages or not.
* If @count is not zero, it is okay to include less @count unmovable pages
*
* PageLRU check wihtout isolation or lru_lock could race so that
* MIGRATE_MOVABLE block might include unmovable pages. It means you can't
* expect this function should be exact.
*/

static int
__count_immobile_pages(struct zone *zone, struct page *page, int count)
static bool
__has_unmovable_pages(struct zone *zone, struct page *page, int count)
{
unsigned long pfn, iter, found;
int mt;

/*
* For avoiding noise data, lru_add_drain_all() should be called
* If ZONE_MOVABLE, the zone never contains immobile pages
* If ZONE_MOVABLE, the zone never contains unmovable pages
*/
if (zone_idx(zone) == ZONE_MOVABLE)
return true;
return false;
mt = get_pageblock_migratetype(page);
if (mt == MIGRATE_MOVABLE || is_migrate_cma(mt))
return true;
return false;

pfn = page_to_pfn(page);
for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) {
Expand Down Expand Up @@ -5528,9 +5530,9 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count)
* page at boot.
*/
if (found > count)
return false;
return true;
}
return true;
return false;
}

bool is_pageblock_removable_nolock(struct page *page)
Expand All @@ -5554,7 +5556,7 @@ bool is_pageblock_removable_nolock(struct page *page)
zone->zone_start_pfn + zone->spanned_pages <= pfn)
return false;

return __count_immobile_pages(zone, page, 0);
return !__has_unmovable_pages(zone, page, 0);
}

int set_migratetype_isolate(struct page *page)
Expand Down Expand Up @@ -5593,12 +5595,12 @@ int set_migratetype_isolate(struct page *page)
* FIXME: Now, memory hotplug doesn't call shrink_slab() by itself.
* We just check MOVABLE pages.
*/
if (__count_immobile_pages(zone, page, arg.pages_found))
if (!__has_unmovable_pages(zone, page, arg.pages_found))
ret = 0;

/*
* immobile means "not-on-lru" paes. If immobile is larger than
* removable-by-driver pages reported by notifier, we'll fail.
* Unmovable means "not-on-lru" pages. If Unmovable pages are
* larger than removable-by-driver pages reported by notifier,
* we'll fail.
*/

out:
Expand Down

0 comments on commit a19dd82

Please sign in to comment.