From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F1B2C33CA4 for ; Fri, 10 Jan 2020 08:25:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5E5D02072E for ; Fri, 10 Jan 2020 08:25:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E5D02072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 106AD8E0006; Fri, 10 Jan 2020 03:25:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B6C88E0001; Fri, 10 Jan 2020 03:25:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F11008E0006; Fri, 10 Jan 2020 03:25:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id D1CBB8E0001 for ; Fri, 10 Jan 2020 03:25:28 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 9244E181AC9C6 for ; Fri, 10 Jan 2020 08:25:28 +0000 (UTC) X-FDA: 76361040336.30.ice00_69e7709a81522 X-HE-Tag: ice00_69e7709a81522 X-Filterd-Recvd-Size: 3228 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jan 2020 08:25:27 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R761e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04446;MF=shile.zhang@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0TnJTHE8_1578644713; Received: from e18g09479.et15sqa.tbsite.net(mailfrom:shile.zhang@linux.alibaba.com fp:SMTPD_---0TnJTHE8_1578644713) by smtp.aliyun-inc.com(127.0.0.1); Fri, 10 Jan 2020 16:25:20 +0800 From: Shile Zhang To: Andrew Morton , Pavel Tatashin Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Shile Zhang Subject: [PATCH 1/1] mm: fix tick_sched timer blocked by pgdat_resize_lock Date: Fri, 10 Jan 2020 16:25:10 +0800 Message-Id: <20200110082510.172517-2-shile.zhang@linux.alibaba.com> X-Mailer: git-send-email 2.24.0.rc2 In-Reply-To: <20200110082510.172517-1-shile.zhang@linux.alibaba.com> References: <20200110082510.172517-1-shile.zhang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When 'CONFIG_DEFERRED_STRUCT_PAGE_INIT' is set, 'pgdat_resize_lock' will be called inside 'pgdatinit' kthread to initialise the deferred pages with local interrupts disabled. Which is introduced by commit 3a2d7fa8a3d5 ("mm: disable interrupts while initializing deferred pages"). But 'pgdatinit' kthread is possible be pined on the boot CPU (CPU#0 by default), especially in small system with NRCPUS <=3D 2. In this case, th= e interrupts are disabled on boot CPU during memory initialising, which caused the tick_sched timer be blocked, leading to wall clock stuck. Fixes: commit 3a2d7fa8a3d5 ("mm: disable interrupts while initializing deferred pages") Signed-off-by: Shile Zhang --- include/linux/memory_hotplug.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplu= g.h index ba0dca6aac6e..6ffcb5b704bc 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -282,12 +282,22 @@ static inline bool movable_node_is_enabled(void) static inline void pgdat_resize_lock(struct pglist_data *pgdat, unsigned long *flags) { - spin_lock_irqsave(&pgdat->node_size_lock, *flags); + /* + * Disable local interrupts on boot CPU will stop the tick_sched + * timer, which will block jiffies(wall clock) update. + */ + if (current->cpu !=3D get_boot_cpu_id()) + spin_lock_irqsave(&pgdat->node_size_lock, *flags); + else + spin_lock(&pgdat->node_size_lock); } static inline void pgdat_resize_unlock(struct pglist_data *pgdat, unsigned long *flags= ) { - spin_unlock_irqrestore(&pgdat->node_size_lock, *flags); + if (current->cpu !=3D get_boot_cpu_id()) + spin_unlock_irqrestore(&pgdat->node_size_lock, *flags); + else + spin_unlock(&pgdat->node_size_lock); } static inline void pgdat_resize_init(struct pglist_data *pgdat) --=20 2.24.0.rc2