From: Vlastimil Babka <vbabka@suse.cz>
To: Reza Arbab <arbab@linux.vnet.ibm.com>,
Arnd Bergmann <arnd@arndb.de>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Rik van Riel <riel@redhat.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Mel Gorman <mgorman@techsingularity.net>,
David Rientjes <rientjes@google.com>,
Michal Hocko <mhocko@suse.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Hugh Dickins <hughd@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: kcompactd hang during memory offlining
Date: Wed, 4 May 2016 00:16:42 +0200 [thread overview]
Message-ID: <5729234A.1080502@suse.cz> (raw)
In-Reply-To: <20160503170247.GA4239@arbab-laptop.austin.ibm.com>
On 05/03/2016 07:02 PM, Reza Arbab wrote:
> Assume memory47 is the last online block left in node1. This will hang:
>
> # echo offline > /sys/devices/system/node/node1/memory47/state
>
> After a couple of minutes, the following pops up in dmesg:
>
> INFO: task bash:957 blocked for more than 120 seconds.
Damn, can you test this patch? I hope it's just the simple mistake and kcompactd is
waiting for the kcompactd_max_order > 0 when it's woken up to actually exit.
No idea what happens if memory actually gets offlined during compaction's pfn scan...
but that wouldn't be new or specific to kcompactd...
----8<----
diff --git a/mm/compaction.c b/mm/compaction.c
index 481004c73c90..0e28981d4510 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1852,7 +1852,7 @@ void compaction_unregister_node(struct node *node)
static inline bool kcompactd_work_requested(pg_data_t *pgdat)
{
- return pgdat->kcompactd_max_order > 0;
+ return pgdat->kcompactd_max_order > 0 || kthread_should_stop();
}
static bool kcompactd_node_suitable(pg_data_t *pgdat)
@@ -1916,6 +1916,8 @@ static void kcompactd_do_work(pg_data_t *pgdat)
INIT_LIST_HEAD(&cc.freepages);
INIT_LIST_HEAD(&cc.migratepages);
+ if (kthread_should_stop())
+ return;
status = compact_zone(zone, &cc);
if (zone_watermark_ok(zone, cc.order, low_wmark_pages(zone),
--
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:[~2016-05-03 22:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-03 17:02 Reza Arbab
2016-05-03 22:16 ` Vlastimil Babka [this message]
2016-05-04 18:09 ` Reza Arbab
2016-05-04 21:23 ` Vlastimil Babka
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=5729234A.1080502@suse.cz \
--to=vbabka@suse.cz \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arbab@linux.vnet.ibm.com \
--cc=arnd@arndb.de \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=paul.gortmaker@windriver.com \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
/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