From: Hugh Dickins <hughd@google.com>
To: Mel Gorman <mgorman@suse.de>
Cc: Stable <stable@vger.kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 21/34] kswapd: assign new_order and new_classzone_idx after wakeup in sleeping
Date: Sun, 22 Jul 2012 12:25:14 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.00.1207221213100.1896@eggly.anvils> (raw)
In-Reply-To: <1342708604-26540-22-git-send-email-mgorman@suse.de>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2845 bytes --]
On Thu, 19 Jul 2012, Mel Gorman wrote:
> From: "Alex,Shi" <alex.shi@intel.com>
>
> commit d2ebd0f6b89567eb93ead4e2ca0cbe03021f344b upstream.
Thanks for assembling these, Mel: I was checking through to see if
I was missing any, and noticed that this one has the wrong upstream
SHA1: the one you give here is the same as in 20/34, but it should be
commit f0dfcde099453aa4c0dc42473828d15a6d492936 upstream.
I got quite confused by 30/34 too: interesting definition of "partial
backport" :) I've no objection, but "substitute" might be clearer there.
Hugh
>
> Stable note: Fixes https://bugzilla.redhat.com/show_bug.cgi?id=712019. This
> patch reduces kswapd CPU usage.
>
> There 2 places to read pgdat in kswapd. One is return from a successful
> balance, another is waked up from kswapd sleeping. The new_order and
> new_classzone_idx represent the balance input order and classzone_idx.
>
> But current new_order and new_classzone_idx are not assigned after
> kswapd_try_to_sleep(), that will cause a bug in the following scenario.
>
> 1: after a successful balance, kswapd goes to sleep, and new_order = 0;
> new_classzone_idx = __MAX_NR_ZONES - 1;
>
> 2: kswapd waked up with order = 3 and classzone_idx = ZONE_NORMAL
>
> 3: in the balance_pgdat() running, a new balance wakeup happened with
> order = 5, and classzone_idx = ZONE_NORMAL
>
> 4: the first wakeup(order = 3) finished successufly, return order = 3
> but, the new_order is still 0, so, this balancing will be treated as a
> failed balance. And then the second tighter balancing will be missed.
>
> So, to avoid the above problem, the new_order and new_classzone_idx need
> to be assigned for later successful comparison.
>
> Signed-off-by: Alex Shi <alex.shi@intel.com>
> Acked-by: Mel Gorman <mgorman@suse.de>
> Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
> Tested-by: Pádraig Brady <P@draigBrady.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Mel Gorman <mgorman@suse.de>
> ---
> mm/vmscan.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index bf85e4d..b8c1fc0 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2905,6 +2905,8 @@ static int kswapd(void *p)
> balanced_classzone_idx);
> order = pgdat->kswapd_max_order;
> classzone_idx = pgdat->classzone_idx;
> + new_order = order;
> + new_classzone_idx = classzone_idx;
> pgdat->kswapd_max_order = 0;
> pgdat->classzone_idx = pgdat->nr_zones - 1;
> }
> --
> 1.7.9.2
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
next prev parent reply other threads:[~2012-07-22 19:25 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 14:36 [PATCH 00/34] Memory management performance backports for -stable Mel Gorman
2012-07-19 14:36 ` [PATCH 01/34] mm: vmstat: cache align vm_stat Mel Gorman
2012-07-19 14:36 ` [PATCH 02/34] mm: memory hotplug: Check if pages are correctly reserved on a per-section basis Mel Gorman
2012-07-19 14:36 ` [PATCH 03/34] mm: Reduce the amount of work done when updating min_free_kbytes Mel Gorman
2012-07-19 14:36 ` [PATCH 04/34] mm: vmscan: fix force-scanning small targets without swap Mel Gorman
2012-07-19 14:36 ` [PATCH 05/34] vmscan: clear ZONE_CONGESTED for zone with good watermark Mel Gorman
2012-07-19 14:36 ` [PATCH 06/34] vmscan: add shrink_slab tracepoints Mel Gorman
2012-07-19 14:36 ` [PATCH 07/34] vmscan: shrinker->nr updates race and go wrong Mel Gorman
2012-07-19 14:36 ` [PATCH 08/34] vmscan: reduce wind up shrinker->nr when shrinker can't do work Mel Gorman
2012-07-19 14:36 ` [PATCH 09/34] mm: limit direct reclaim for higher order allocations Mel Gorman
2012-07-19 14:36 ` [PATCH 10/34] mm: Abort reclaim/compaction if compaction can proceed Mel Gorman
2012-07-19 14:36 ` [PATCH 11/34] mm: compaction: trivial clean up in acct_isolated() Mel Gorman
2012-07-19 14:36 ` [PATCH 12/34] mm: change isolate mode from #define to bitwise type Mel Gorman
2012-07-19 14:36 ` [PATCH 13/34] mm: compaction: make isolate_lru_page() filter-aware Mel Gorman
2012-07-19 14:36 ` [PATCH 14/34] mm: zone_reclaim: " Mel Gorman
2012-07-19 14:36 ` [PATCH 15/34] mm: migration: clean up unmap_and_move() Mel Gorman
2012-07-19 14:36 ` [PATCH 16/34] mm: compaction: Allow compaction to isolate dirty pages Mel Gorman
2012-07-19 14:36 ` [PATCH 17/34] mm: compaction: Determine if dirty pages can be migrated without blocking within ->migratepage Mel Gorman
2012-07-19 14:36 ` [PATCH 18/34] mm: page allocator: Do not call direct reclaim for THP allocations while compaction is deferred Mel Gorman
2012-07-19 14:36 ` [PATCH 19/34] mm: compaction: make isolate_lru_page() filter-aware again Mel Gorman
2012-07-19 14:36 ` [PATCH 20/34] kswapd: avoid unnecessary rebalance after an unsuccessful balancing Mel Gorman
2012-07-19 14:36 ` [PATCH 21/34] kswapd: assign new_order and new_classzone_idx after wakeup in sleeping Mel Gorman
2012-07-22 19:25 ` Hugh Dickins [this message]
2012-07-23 9:37 ` Mel Gorman
2012-07-19 14:36 ` [PATCH 22/34] mm: compaction: Introduce sync-light migration for use by compaction Mel Gorman
2012-07-19 14:36 ` [PATCH 23/34] mm: vmscan: When reclaiming for compaction, ensure there are sufficient free pages available Mel Gorman
2012-07-19 14:36 ` [PATCH 24/34] mm: vmscan: Do not OOM if aborting reclaim to start compaction Mel Gorman
2012-07-19 14:36 ` [PATCH 25/34] mm: vmscan: Check if reclaim should really abort even if compaction_ready() is true for one zone Mel Gorman
2012-07-19 14:36 ` [PATCH 26/34] vmscan: promote shared file mapped pages Mel Gorman
2012-07-19 14:36 ` [PATCH 27/34] vmscan: activate executable pages after first usage Mel Gorman
2012-07-19 14:36 ` [PATCH 28/34] mm/vmscan.c: consider swap space when deciding whether to continue reclaim Mel Gorman
2012-07-19 14:36 ` [PATCH 29/34] mm: test PageSwapBacked in lumpy reclaim Mel Gorman
2012-07-19 14:36 ` [PATCH 30/34] mm: vmscan: Do not force kswapd to scan small targets Mel Gorman
2012-07-19 14:36 ` [PATCH 31/34] cpusets: avoid looping when storing to mems_allowed if one node remains set Mel Gorman
2012-07-19 14:36 ` [PATCH 32/34] cpusets: stall when updating mems_allowed for mempolicy or disjoint nodemask Mel Gorman
2012-07-19 14:36 ` [PATCH 33/34] cpuset: mm: Reduce large amounts of memory barrier related damage v3 Mel Gorman
2012-07-19 14:36 ` [PATCH 34/34] mm/hugetlb: fix warning in alloc_huge_page/dequeue_huge_page_vma Mel Gorman
2012-07-22 22:58 ` [PATCH 00/34] Memory management performance backports for -stable Ben Hutchings
2012-07-23 9:16 ` Mel Gorman
2012-07-23 13:38 [PATCH 00/34] Memory management performance backports for -stable V2 Mel Gorman
2012-07-23 13:38 ` [PATCH 21/34] kswapd: assign new_order and new_classzone_idx after wakeup in sleeping Mel Gorman
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=alpine.LSU.2.00.1207221213100.1896@eggly.anvils \
--to=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=stable@vger.kernel.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