Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3398749ybp; Sun, 6 Oct 2019 11:04:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNru1FGCc1F3R9ry3rHSOKyotCmN6MBuE6B97uMB/tMQU6LwjWgu/4ZezQ2nSobDmP6iyQ X-Received: by 2002:a17:906:e0c2:: with SMTP id gl2mr20507639ejb.157.1570385044673; Sun, 06 Oct 2019 11:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570385044; cv=none; d=google.com; s=arc-20160816; b=UtAN2QUGn+x88V6+G9qYDcp+XNeZJ05n+FGbrEYP5q+Vq3JNGpeSFgLM4ZuKATIXt9 6ivXjgZ8V7b1QWTq2VCxj7fmynCUHXsm3eMC35F9ltN4gacX9x3MKikCBE/5kilwr8Pc fENJOwJio/dMMO/x/0QJ6Z1LGyFHq2BDE0xSEuLqfQw5Dw5cSZPMc10lIfxIN9b6Cg2W dREtdGgZIpK4s+0KLmyQN47rxT6/vtN0/vAkdfDUQBbzPVVx7tBKc94Tce5908eGv7mj 5Zk7nqoiMwPFIiZ8ANyhupte1whaMrTqiE/jKKkgP4HWJzcLVZv82u36KbvzNOxSg2UE Jy8Q== 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=5jXjO47h9jTs4hgB8tT56LzIiAwVy3u+1fHNkPeMfkU=; b=Pn+uwcIFzaY2+d8zNmIAEp8SC0rkN+IIVX6512Jy8eLzICsOhyEoXqqUrfoI8TTHNv 0TJRtc1Exed8ncOkIjZmPpk3QjqupKeYJdRD7GWZtGmEXS0HUdsAUqgPgSZIIn0tPeaV Ujz/OqI5bKpynPnwLfNbms2kPWwF1wB3nl1mhkGQuG8z9hwomAteVJLqaG3NOb8xs/w4 xzycWwkyRBSCM6AJuoVG+0u6xAGQz3tTTIWaD6OkRUbZk7Bkgx80R0RAnWsMPouI1OH0 AjDn9xxVfXbMoaMJQUl2LYNhNMIjYVNS94o1PVhzEomU1RuOYcValwec/Lz68c7JX/tR LPcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gk81U90O; 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 b8si7643647edc.231.2019.10.06.11.03.41; Sun, 06 Oct 2019 11:04:04 -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=gk81U90O; 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 S1728911AbfJFSCw (ORCPT + 99 others); Sun, 6 Oct 2019 14:02:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:50510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727416AbfJFRZ2 (ORCPT ); Sun, 6 Oct 2019 13:25:28 -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 305C320867; Sun, 6 Oct 2019 17:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570382727; bh=7S9cQcW7htV2m9M+uWzsUFrMxQ5slCUenIdT6l0JSu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gk81U90Of6kqSkXG71/IfD9AcfT5AGJkawLHwh15e5JOyL2KzLZBYSYOo3vMQMjr6 Bc+BJvn2/Ya8tm3qECdg9uF1toN4VW0C+u79Vc73SHqeWycpl9AM38l8G41u69yA4d e2i751WkNqb7LepozQxHAqIHBUBhBdTjEZh0AoFI= 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 4.14 18/68] powerpc/pseries/mobility: use cond_resched when updating device tree Date: Sun, 6 Oct 2019 19:20:54 +0200 Message-Id: <20191006171116.817977900@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171108.150129403@linuxfoundation.org> References: <20191006171108.150129403@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 4addc552eb33d..9739a055e5f7b 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -208,7 +209,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); @@ -317,8 +322,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