Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49255c61 authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds
Browse files

page allocator: move check for disabled anti-fragmentation out of fastpath



On low-memory systems, anti-fragmentation gets disabled as there is
nothing it can do and it would just incur overhead shuffling pages between
lists constantly.  Currently the check is made in the free page fast path
for every page.  This patch moves it to a slow path.  On machines with low
memory, there will be small amount of additional overhead as pages get
shuffled between lists but it should quickly settle.

Signed-off-by: default avatarMel Gorman <mel@csn.ul.ie>
Reviewed-by: default avatarChristoph Lameter <cl@linux-foundation.org>
Reviewed-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 11e33f6a
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -50,9 +50,6 @@ extern int page_group_by_mobility_disabled;


static inline int get_pageblock_migratetype(struct page *page)
static inline int get_pageblock_migratetype(struct page *page)
{
{
	if (unlikely(page_group_by_mobility_disabled))
		return MIGRATE_UNMOVABLE;

	return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end);
	return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end);
}
}


+4 −0
Original line number Original line Diff line number Diff line
@@ -168,6 +168,10 @@ int page_group_by_mobility_disabled __read_mostly;


static void set_pageblock_migratetype(struct page *page, int migratetype)
static void set_pageblock_migratetype(struct page *page, int migratetype)
{
{

	if (unlikely(page_group_by_mobility_disabled))
		migratetype = MIGRATE_UNMOVABLE;

	set_pageblock_flags_group(page, (unsigned long)migratetype,
	set_pageblock_flags_group(page, (unsigned long)migratetype,
					PB_migrate, PB_migrate_end);
					PB_migrate, PB_migrate_end);
}
}