Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp406526ybl; Fri, 10 Jan 2020 00:26:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxTg1TkV5Sf0g4UTdTfn/kqdviJKl0GX3TE+DbfMKmrbH+4X4tumO27BOPCtJefE8Z+Y6YR X-Received: by 2002:a9d:3e16:: with SMTP id a22mr1725617otd.259.1578644811479; Fri, 10 Jan 2020 00:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578644811; cv=none; d=google.com; s=arc-20160816; b=XUzeDdEA/NEY6v/Jurse/GV0F48p2BDgP9LjA2AqPICAN6sGLQKFL0sk7aSNi7etpL KUgDg6SATH71lYNdr6Shwyit6xAPkcn4L1L1d5dK97drBZTA1yPc/V5LxUnamqacVyS+ ZxCPW66tAjs5nbjFoi8oXm8E5m8l5zS2X3iVr5/YgdM/Pd7LUR2Cx4ugl/osvZzZzzHV bi0qNWhxaq6U6bzjngCIv8V0f7eeHsQdjzt5HP/l+eG6irFFrK7Ov87uHj0ScvkHe3IP 75os/oH+MEV5Wges+h/QNg7MHezQfCWjWiqzJckYkSPOx80m+NbE/xmi3OjSfA3mT9g5 PAuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=seDKdNCfeovo+u5Kw+DN8QDbugIRMYdbob46vvYtqHU=; b=a2ielJ3MIgD3tBbmAaoPD1D0GNTe/5T7It7TBhMsX3sCYGD4qez3NhhjCmIiaskOyV D+9X2TJj9C9/wfNkKuGA3QZD24EL3xXvOD2Rb9Vh2w4x8SJhQm5Q5n1e2CGTlPMJciHM TN3ta9kSbGjqNRU7PqxTQDSxbEs0DkKCKELyA1AZNoSnLxSi+yPXL7G2SN26nBOFmrvQ 1eku6nQedxRIJgFRAH4V6WrabpIzbo8VLcRJU8+rx3ZZa8hZPmhgaLEpXFoGeatK4xRF 8DdUtJ0T1KHsUf0AZW/F2fbPs+JfnvepsaIU27lOLnShYCwxhQ/oVowyfWIuvnonTFCE ixmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h28si952441otg.63.2020.01.10.00.26.40; Fri, 10 Jan 2020 00:26:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726940AbgAJIZZ (ORCPT + 99 others); Fri, 10 Jan 2020 03:25:25 -0500 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:47157 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbgAJIZY (ORCPT ); Fri, 10 Jan 2020 03:25:24 -0500 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: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 <= 2. In this case, the 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_hotplug.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 != 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 != 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) -- 2.24.0.rc2