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=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 8A369CA90AF for ; Wed, 13 May 2020 09:58:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6352620575 for ; Wed, 13 May 2020 09:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363914; bh=h8SEZHcxjevCrV+7KP1HulgHGIYU8bJnnCg8YvMO62M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pDwGVhL/kL02wdyXbIVZGqFIyOa39eO5TFsgEWftfzPRQCW2uivQK9MRDDujhkaqW pyfeTH5R/IvbY1mPVDyEEdQgNIrWYTd1TZKnCpew++kVbNTpVboK75zV1MyNlwTxKd A9ts2ZBnNfiMwZXJ2RjDtW+FCkcUE1dytQiSp2UI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733136AbgEMJyr (ORCPT ); Wed, 13 May 2020 05:54:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:57376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733274AbgEMJyq (ORCPT ); Wed, 13 May 2020 05:54:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 19BF22176D; Wed, 13 May 2020 09:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363685; bh=h8SEZHcxjevCrV+7KP1HulgHGIYU8bJnnCg8YvMO62M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZDxc3J3Ea+O0fLvuKY04N/YwJGB5zzWH/ZrmoH1xUTB/qkoHQQN2h0spiFoAaU4zM ggSJRKL86HsHRsjlHFNhfX+igUsFdWfCtBWdHBnzH9SsZWqVI5ld5KT7kDCVUK18cE 8z1TiMGV/bQ3XvDzhAmuOzikcp6O67gd/ixbUgHo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Hildenbrand , Andrew Morton , Pavel Tatashin , Pankaj Gupta , Baoquan He , Shile Zhang , Michal Hocko , Kirill Tkhai , Daniel Jordan , Michal Hocko , Alexander Duyck , Oscar Salvador , Linus Torvalds Subject: [PATCH 5.6 084/118] mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous() Date: Wed, 13 May 2020 11:45:03 +0200 Message-Id: <20200513094424.804010952@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513094417.618129545@linuxfoundation.org> References: <20200513094417.618129545@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Hildenbrand commit e84fe99b68ce353c37ceeecc95dce9696c976556 upstream. Without CONFIG_PREEMPT, it can happen that we get soft lockups detected, e.g., while booting up. watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.6.0-next-20200331+ #4 Hardware name: Red Hat KVM, BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 04/01/2014 RIP: __pageblock_pfn_to_page+0x134/0x1c0 Call Trace: set_zone_contiguous+0x56/0x70 page_alloc_init_late+0x166/0x176 kernel_init_freeable+0xfa/0x255 kernel_init+0xa/0x106 ret_from_fork+0x35/0x40 The issue becomes visible when having a lot of memory (e.g., 4TB) assigned to a single NUMA node - a system that can easily be created using QEMU. Inside VMs on a hypervisor with quite some memory overcommit, this is fairly easy to trigger. Signed-off-by: David Hildenbrand Signed-off-by: Andrew Morton Reviewed-by: Pavel Tatashin Reviewed-by: Pankaj Gupta Reviewed-by: Baoquan He Reviewed-by: Shile Zhang Acked-by: Michal Hocko Cc: Kirill Tkhai Cc: Shile Zhang Cc: Pavel Tatashin Cc: Daniel Jordan Cc: Michal Hocko Cc: Alexander Duyck Cc: Baoquan He Cc: Oscar Salvador Cc: Link: http://lkml.kernel.org/r/20200416073417.5003-1-david@redhat.com Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/page_alloc.c | 1 + 1 file changed, 1 insertion(+) --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1555,6 +1555,7 @@ void set_zone_contiguous(struct zone *zo if (!__pageblock_pfn_to_page(block_start_pfn, block_end_pfn, zone)) return; + cond_resched(); } /* We confirm that there is no hole */