Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11792817pjo; Thu, 2 Jan 2020 14:22:17 -0800 (PST) X-Google-Smtp-Source: APXvYqynt/+f4hamIn40Sv7XR+HZ158ZyIvDUltGWcLQpnl0NpHvE57/yl+jNYUkacXp3Dd/azlo X-Received: by 2002:a05:6808:64e:: with SMTP id z14mr2951084oih.79.1578003737024; Thu, 02 Jan 2020 14:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003737; cv=none; d=google.com; s=arc-20160816; b=hc5NEwioITfe3rmgQtzSIx1I+idqgnuyQrJZpDS8j370sxmXORvNbFSJ0dqWrdKd3h T3yNj5km+GYT8jv7zClc4jSzeJZEI/BIdxQ1Eb8ASYo+T0G/zsbxsaWj4zm+G0a1XRJA CX6zNeacQiYVZrS07VoDndKTO1pgP0E14riHxqNCx4ppFc19UIIGUGG2WqjEo6IVC4tQ V3V8L0ImWwfKeHlRDp+p613gv2srZlxX1JdSpQmpImwzoVv82q/vmhlA54c9oBtikg6a vOKthfR3BWyyD3uMeHENCioaXbjZYMjgBY1Q9ESY2MmoUzu6alpa82VT8k2DHp4Hy13Y 04gQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5LT4akAkShFFlAFXSUH2GmDUnbwgFgOex3ki8BuOTwk=; b=MzCDmGZm63MLqZTcJtk76QRupQPv82lBdmnXdmnRCS1u0Lz/PmnIo8xd4hlaEe++CG I7Ib5YSMmo6KrMNqbHab6ExQg+m74KyazY192Vh2OBERjUe8mhq2qxxWPLsKp9WdYHCa TA9hAnQYde8Sus6QRWt2jNpxU0tif5knuJGvBHh75lQR3ToCgaHvJZD3O4Xyk511oFY2 d82d1BJ5ICr7Ll5akkWquMEgJBBEb884fnvclSLovq7zr15ixWMpq5gXHXXcjozHcB+X FSItMwEbtemWs5NcGjDPaM9fUwA1X2od8Sjj01f5qxtBXqGj8JjMTxTth2V38PSNwdU6 kjpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aT8wR0Ok; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si19063579oic.108.2020.01.02.14.22.05; Thu, 02 Jan 2020 14:22:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b=aT8wR0Ok; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728798AbgABWU3 (ORCPT + 99 others); Thu, 2 Jan 2020 17:20:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:37954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728781AbgABWU2 (ORCPT ); Thu, 2 Jan 2020 17:20:28 -0500 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 212832464E; Thu, 2 Jan 2020 22:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003627; bh=eXnTnmnhVCqMyRx8waH5bwhHQpaSIJzWg053aMxiaOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aT8wR0Okd5e60NS2XVnAcvYBnPSZ6PpMKMAg+lpd8KSYmOh193aI+lGU383X+jla1 qnCpINCRZjcwyhPazMDyN54OVnaS55giUKQZTuCsxJkyrW8Du5qFN9d7rAY/enj60S BCE9zqjHwSST6Fo0kE60zG8qw6aymptiacWegD88= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Aneesh Kumar K.V" , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 021/114] powerpc/book3s64/hash: Add cond_resched to avoid soft lockup warning Date: Thu, 2 Jan 2020 23:06:33 +0100 Message-Id: <20200102220031.284196786@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aneesh Kumar K.V [ Upstream commit 16f6b67cf03cb43db7104acb2ca877bdc2606c92 ] With large memory (8TB and more) hotplug, we can get soft lockup warnings as below. These were caused by a long loop without any explicit cond_resched which is a problem for !PREEMPT kernels. Avoid this using cond_resched() while inserting hash page table entries. We already do similar cond_resched() in __add_pages(), see commit f64ac5e6e306 ("mm, memory_hotplug: add scheduling point to __add_pages"). rcu: 3-....: (24002 ticks this GP) idle=13e/1/0x4000000000000002 softirq=722/722 fqs=12001 (t=24003 jiffies g=4285 q=2002) NMI backtrace for cpu 3 CPU: 3 PID: 3870 Comm: ndctl Not tainted 5.3.0-197.18-default+ #2 Call Trace: dump_stack+0xb0/0xf4 (unreliable) nmi_cpu_backtrace+0x124/0x130 nmi_trigger_cpumask_backtrace+0x1ac/0x1f0 arch_trigger_cpumask_backtrace+0x28/0x3c rcu_dump_cpu_stacks+0xf8/0x154 rcu_sched_clock_irq+0x878/0xb40 update_process_times+0x48/0x90 tick_sched_handle.isra.16+0x4c/0x80 tick_sched_timer+0x68/0xe0 __hrtimer_run_queues+0x180/0x430 hrtimer_interrupt+0x110/0x300 timer_interrupt+0x108/0x2f0 decrementer_common+0x114/0x120 --- interrupt: 901 at arch_add_memory+0xc0/0x130 LR = arch_add_memory+0x74/0x130 memremap_pages+0x494/0x650 devm_memremap_pages+0x3c/0xa0 pmem_attach_disk+0x188/0x750 nvdimm_bus_probe+0xac/0x2c0 really_probe+0x148/0x570 driver_probe_device+0x19c/0x1d0 device_driver_attach+0xcc/0x100 bind_store+0x134/0x1c0 drv_attr_store+0x44/0x60 sysfs_kf_write+0x64/0x90 kernfs_fop_write+0x1a0/0x270 __vfs_write+0x3c/0x70 vfs_write+0xd0/0x260 ksys_write+0xdc/0x130 system_call+0x5c/0x68 Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20191001084656.31277-1-aneesh.kumar@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/mm/hash_utils_64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 11b41383e167..8894c8f300ea 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c @@ -307,6 +307,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, if (ret < 0) break; + cond_resched(); #ifdef CONFIG_DEBUG_PAGEALLOC if (debug_pagealloc_enabled() && (paddr >> PAGE_SHIFT) < linear_map_hash_count) -- 2.20.1