From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg KH <gregkh@linuxfoundation.org>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk, Mel Gorman <mgorman@suse.de>
Subject: [ 09/41] mm: reduce the amount of work done when updating min_free_kbytes
Date: Mon, 30 Jul 2012 10:31:08 -0700 [thread overview]
Message-ID: <20120730172902.043408198@linuxfoundation.org> (raw)
In-Reply-To: <20120730172901.306897424@linuxfoundation.org>
From: Greg KH <gregkh@linuxfoundation.org>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mel Gorman <mgorman@suse.de>
commit 938929f14cb595f43cd1a4e63e22d36cab1e4a1f upstream.
Stable note: Fixes https://bugzilla.novell.com/show_bug.cgi?id=726210 .
Large machines with 1TB or more of RAM take a long time to boot
without this patch and may spew out soft lockup warnings.
When min_free_kbytes is updated, some pageblocks are marked
MIGRATE_RESERVE. Ordinarily, this work is unnoticable as it happens early
in boot but on large machines with 1TB of memory, this has been reported
to delay boot times, probably due to the NUMA distances involved.
The bulk of the work is due to calling calling pageblock_is_reserved() an
unnecessary amount of times and accessing far more struct page metadata
than is necessary. This patch significantly reduces the amount of work
done by setup_zone_migrate_reserve() improving boot times on 1TB machines.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 40 ++++++++++++++++++++++++----------------
1 file changed, 24 insertions(+), 16 deletions(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3418,25 +3418,33 @@ static void setup_zone_migrate_reserve(s
if (page_to_nid(page) != zone_to_nid(zone))
continue;
- /* Blocks with reserved pages will never free, skip them. */
- block_end_pfn = min(pfn + pageblock_nr_pages, end_pfn);
- if (pageblock_is_reserved(pfn, block_end_pfn))
- continue;
-
block_migratetype = get_pageblock_migratetype(page);
- /* If this block is reserved, account for it */
- if (reserve > 0 && block_migratetype == MIGRATE_RESERVE) {
- reserve--;
- continue;
- }
+ /* Only test what is necessary when the reserves are not met */
+ if (reserve > 0) {
+ /*
+ * Blocks with reserved pages will never free, skip
+ * them.
+ */
+ block_end_pfn = min(pfn + pageblock_nr_pages, end_pfn);
+ if (pageblock_is_reserved(pfn, block_end_pfn))
+ continue;
- /* Suitable for reserving if this block is movable */
- if (reserve > 0 && block_migratetype == MIGRATE_MOVABLE) {
- set_pageblock_migratetype(page, MIGRATE_RESERVE);
- move_freepages_block(zone, page, MIGRATE_RESERVE);
- reserve--;
- continue;
+ /* If this block is reserved, account for it */
+ if (block_migratetype == MIGRATE_RESERVE) {
+ reserve--;
+ continue;
+ }
+
+ /* Suitable for reserving if this block is movable */
+ if (block_migratetype == MIGRATE_MOVABLE) {
+ set_pageblock_migratetype(page,
+ MIGRATE_RESERVE);
+ move_freepages_block(zone, page,
+ MIGRATE_RESERVE);
+ reserve--;
+ continue;
+ }
}
/*
next prev parent reply other threads:[~2012-07-30 17:32 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-30 17:30 [ 00/41] 3.0.39-rc2 stable review Greg Kroah-Hartman
2012-07-30 17:31 ` [ 01/41] cifs: always update the inode cache with the results from a FIND_* Greg Kroah-Hartman
2012-07-30 17:31 ` [ 02/41] ntp: Fix STA_INS/DEL clearing bug Greg Kroah-Hartman
2012-07-30 17:31 ` [ 03/41] mm: fix lost kswapd wakeup in kswapd_stop() Greg Kroah-Hartman
2012-07-30 17:31 ` [ 04/41] MIPS: Properly align the .data..init_task section Greg Kroah-Hartman
2012-07-30 17:31 ` [ 05/41] UBIFS: fix a bug in empty space fix-up Greg Kroah-Hartman
2012-07-30 17:31 ` [ 06/41] dm raid1: fix crash with mirror recovery and discard Greg Kroah-Hartman
2012-07-30 17:31 ` [ 07/41] mm/vmstat.c: cache align vm_stat Greg Kroah-Hartman
2012-07-30 17:31 ` [ 08/41] mm: memory hotplug: Check if pages are correctly reserved on a per-section basis Greg Kroah-Hartman
2012-07-30 17:31 ` Greg Kroah-Hartman [this message]
2012-07-30 17:31 ` [ 10/41] mm: vmscan: fix force-scanning small targets without swap Greg Kroah-Hartman
2012-07-30 17:31 ` [ 11/41] vmscan: clear ZONE_CONGESTED for zone with good watermark Greg Kroah-Hartman
2012-07-30 17:31 ` [ 12/41] vmscan: add shrink_slab tracepoints Greg Kroah-Hartman
2012-07-30 17:31 ` [ 13/41] vmscan: shrinker->nr updates race and go wrong Greg Kroah-Hartman
2012-07-30 17:31 ` [ 14/41] vmscan: reduce wind up shrinker->nr when shrinker cant do work Greg Kroah-Hartman
2012-07-30 17:31 ` [ 15/41] vmscan: limit direct reclaim for higher order allocations Greg Kroah-Hartman
2012-07-30 17:31 ` [ 16/41] vmscan: abort reclaim/compaction if compaction can proceed Greg Kroah-Hartman
2012-07-30 17:31 ` [ 17/41] mm: compaction: trivial clean up in acct_isolated() Greg Kroah-Hartman
2012-07-30 17:31 ` [ 18/41] mm: change isolate mode from #define to bitwise type Greg Kroah-Hartman
2012-07-30 17:31 ` [ 19/41] mm: compaction: make isolate_lru_page() filter-aware Greg Kroah-Hartman
2012-07-30 17:31 ` [ 20/41] mm: zone_reclaim: " Greg Kroah-Hartman
2012-07-30 17:31 ` [ 21/41] mm: migration: clean up unmap_and_move() Greg Kroah-Hartman
2012-07-30 17:31 ` [ 22/41] mm: compaction: allow compaction to isolate dirty pages Greg Kroah-Hartman
2012-07-30 17:31 ` [ 23/41] mm: compaction: determine if dirty pages can be migrated without blocking within ->migratepage Greg Kroah-Hartman
2012-07-30 17:31 ` [ 24/41] mm: page allocator: do not call direct reclaim for THP allocations while compaction is deferred Greg Kroah-Hartman
2012-07-30 17:31 ` [ 25/41] mm: compaction: make isolate_lru_page() filter-aware again Greg Kroah-Hartman
2012-07-30 17:31 ` [ 26/41] kswapd: avoid unnecessary rebalance after an unsuccessful balancing Greg Kroah-Hartman
2012-07-30 17:31 ` [ 27/41] kswapd: assign new_order and new_classzone_idx after wakeup in sleeping Greg Kroah-Hartman
2012-07-30 17:31 ` [ 28/41] mm: compaction: introduce sync-light migration for use by compaction Greg Kroah-Hartman
2012-07-31 16:43 ` Herton Ronaldo Krzesinski
2012-07-31 17:00 ` Greg Kroah-Hartman
2012-07-30 17:31 ` [ 29/41] mm: vmscan: when reclaiming for compaction, ensure there are sufficient free pages available Greg Kroah-Hartman
2012-07-30 17:31 ` [ 30/41] mm: vmscan: do not OOM if aborting reclaim to start compaction Greg Kroah-Hartman
2012-07-30 17:31 ` [ 31/41] mm: vmscan: check if reclaim should really abort even if compaction_ready() is true for one zone Greg Kroah-Hartman
2012-07-30 17:31 ` [ 32/41] vmscan: promote shared file mapped pages Greg Kroah-Hartman
2012-07-30 17:31 ` [ 33/41] vmscan: activate executable pages after first usage Greg Kroah-Hartman
2012-07-30 17:31 ` [ 34/41] mm/vmscan.c: consider swap space when deciding whether to continue reclaim Greg Kroah-Hartman
2012-07-30 17:31 ` [ 35/41] mm: test PageSwapBacked in lumpy reclaim Greg Kroah-Hartman
2012-07-30 17:31 ` [ 36/41] mm: vmscan: convert global reclaim to per-memcg LRU lists Greg Kroah-Hartman
2012-07-30 17:31 ` [ 37/41] cpusets: avoid looping when storing to mems_allowed if one node remains set Greg Kroah-Hartman
2012-07-30 17:31 ` [ 38/41] cpusets: stall when updating mems_allowed for mempolicy or disjoint nodemask Greg Kroah-Hartman
2012-07-30 17:31 ` [ 39/41] cpuset: mm: reduce large amounts of memory barrier related damage v3 Greg Kroah-Hartman
2012-07-30 17:31 ` [ 40/41] mm/hugetlb: fix warning in alloc_huge_page/dequeue_huge_page_vma Greg Kroah-Hartman
2012-07-30 17:31 ` [ 41/41] vmscan: fix initial shrinker size handling Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120730172902.043408198@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox