Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3392765ybp; Sun, 6 Oct 2019 10:57:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHbVeaCSBoQ+cwmd837n63fR65HB1mCnjhn/Xr+Pq095+84LzW365uVLRmVGxdQSOLsgXQ X-Received: by 2002:a17:906:c822:: with SMTP id dd2mr20248670ejb.165.1570384620488; Sun, 06 Oct 2019 10:57:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384620; cv=none; d=google.com; s=arc-20160816; b=jpE+vxkomSFlVAK/SItYiCiG1zy6sH802cFemngrKsDJN64cPIgPvyaHSk1nNt9m+A 5uKurTWFxOF3cLLIV9se1zb5i66+FW1f1wJRwMoLun3xfWqibSGn6vU2Icp7uLnSusuz MZPzmgZuSctufd3Z0VPKB+54eNIUEbKQtXF8c76oscXdt/acpg5b3UHUDrdmh33jSk9w nZ8PF+DIy89QH+Aaerly3LHwOdp6xw3DmUdH1pz3+fawRzNB+cjy3C639GNAfgk/gheA 1lGWX7pBwXASqha+kjqG6j5MPfDmg2T40Chh/vmZ9eS+gHwIolJR1ReLrZW3qP9xaGFU 8uLQ== 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=T1Al1vN2XsnSJAa/+zHoPKIVYW/fqlrKiGwlexSXYoo=; b=d/ugre+iOCGsVFn+Uq0B3Mfm1Y6IbN28M+EjmVSUht/qwE7DsS8RHMfFvc+Z1MA6M3 YZffMdoIDdqMAjgo1Jn/wkW+tdW/DMNq2YA2S1W2ov0y49oipRtCV4eibu8RsodE2Q1Z aIw/+MB8xTg0x6IjGmghOHlsD1gx7BNT0z0jWydNXDn2vG5UERGBCO5yEPrcZV5vD5Rj ek9df5YhFi0oEbGaZZB3n59aGNfI708h/Ynju3JyrGHbKaw0z6JxCxoK+ofMuY6Y/LvK sBJGHSjL1YDxtDjJdSdBGw51+hsSt8L4G4R1/yLxJeVFk1vSldn6BC5VvH9QeuHj1kUa jhxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RZd62t4w; 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 g5si5728671ejp.350.2019.10.06.10.56.37; Sun, 06 Oct 2019 10:57:00 -0700 (PDT) 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=RZd62t4w; 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 S1728946AbfJFR41 (ORCPT + 99 others); Sun, 6 Oct 2019 13:56:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:33894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730037AbfJFRfP (ORCPT ); Sun, 6 Oct 2019 13:35:15 -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 846402080F; Sun, 6 Oct 2019 17:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383314; bh=jjrzKsPr4QB3Win3ST87QOgsLpfVIDjcJppIFbo8cC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RZd62t4wf/XCIh+yj9fZMrX/9mEl7MwmbWp2Z7AsDYVNr0UEFEJFNBtWERv+QgU2k upyt6B/X4pWKu0PcpYDUfq+hR4uJiP5lJS7SiXqG84IlQxspt86sK+B4jwcSGqCraG rfr+UZMMCbjGFPaKdQ58+8KcJfX2cSjtm9yECP9k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Lynch , Michael Ellerman , Sasha Levin Subject: [PATCH 5.2 058/137] powerpc/pseries/mobility: use cond_resched when updating device tree Date: Sun, 6 Oct 2019 19:20:42 +0200 Message-Id: <20191006171213.448417258@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171209.403038733@linuxfoundation.org> References: <20191006171209.403038733@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: Nathan Lynch [ Upstream commit ccfb5bd71d3d1228090a8633800ae7cdf42a94ac ] After a partition migration, pseries_devicetree_update() processes changes to the device tree communicated from the platform to Linux. This is a relatively heavyweight operation, with multiple device tree searches, memory allocations, and conversations with partition firmware. There's a few levels of nested loops which are bounded only by decisions made by the platform, outside of Linux's control, and indeed we have seen RCU stalls on large systems while executing this call graph. Use cond_resched() in these loops so that the cpu is yielded when needed. Signed-off-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20190802192926.19277-4-nathanl@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/pseries/mobility.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index 50e7aee3c7f37..accb732dcfac7 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -206,7 +207,11 @@ static int update_dt_node(__be32 phandle, s32 scope) prop_data += vd; } + + cond_resched(); } + + cond_resched(); } while (rtas_rc == 1); of_node_put(dn); @@ -309,8 +314,12 @@ int pseries_devicetree_update(s32 scope) add_dt_node(phandle, drc_index); break; } + + cond_resched(); } } + + cond_resched(); } while (rc == 1); kfree(rtas_buf); -- 2.20.1