Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3367681ybp; Sun, 6 Oct 2019 10:23:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9n3IlR7Pdb2gmCh/kGe2ossKs970UrTzyKvMzsfzwYnOPPMe7D0GkDHh8WYqRmMe0UwK8 X-Received: by 2002:aa7:d718:: with SMTP id t24mr24905159edq.300.1570382592251; Sun, 06 Oct 2019 10:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570382592; cv=none; d=google.com; s=arc-20160816; b=FRv/DoPb9vSFfpR0bLEYi0E/DcdTTeuOrEoso9mOZKh3l35EHLU2Y6yiFtX90RFciR 1kdo1+f2p2G8/oa50MpEJ75VYnUYp0J2VPsEO2SzlndzVp1LCMa+vnyclOwf+bBHlghq ShtP1dVEBcBfKeKAqkmv9r8u8OtxB7oFphQ6iXwHBxuvtx7pvIrQesgqCg+7CrVcBqYs 4sakziRDIJGhalow+4NJNQMaCjEKmNxMwJl1GDBt818pJZpMkmYlly+00ALo2BUWGg5p kr4BGvq2T9ufgvIs7dtbfoItZ3Un7mhab+uKKKki+1WmCpeJoQH5TMSfsp46DHcXct6t x/Rw== 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=V42xTYLhqFnHqrgvDylAApOdbGUd5Jiv7p8BQJxeWvs=; b=S85uKeXW24Qaxp3pm+XdvOF6sSv4reSDoRByScf86/hwhgGxlJWwr3wY3TrfOIjwS4 ZbJvY16BLG66v39px5kZQSwZ5uBOCjCmZ4mAcah+PYZ8MJsD1OnSF3kwk3FFIshU8bPH 4qfpWW0aDcRq8b3EI5Jr5YwtZ9uvso406ebmaF106vSrRExM46Cl2p+MAALS7hVolSal JjwOCZNol7sC2GvuIcpUh/eqjmP/BNwkFkpYQ+YsU2H9EUhPuCPOMm11EUSCjeN8IaO0 XCp/TcP2O03r4aovl+b1N+MkW0OXqGVgpwkFYamfKKJ9mJUlQfUC526ZQjQLOmAJyRSB pVcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oKg6nEod; 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 n6si5857402ejj.232.2019.10.06.10.22.48; Sun, 06 Oct 2019 10:23:12 -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=oKg6nEod; 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 S1727448AbfJFRVL (ORCPT + 99 others); Sun, 6 Oct 2019 13:21:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:46294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbfJFRVJ (ORCPT ); Sun, 6 Oct 2019 13:21:09 -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 17AC72077B; Sun, 6 Oct 2019 17:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570382468; bh=LuGaAk8dxLEJhNh5nwVA5StYwKCJHKTuddQbelm7ZxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oKg6nEodhEW0iL9NEd78Wu7lbMHkteL4jyp2Nrexybaxut6ixBeaAwxMdard7tcph OrqKtFCcSfK6yY7e3SnjUdYD5Xzrc4w2P6Xnz0eovvB2xLavLiInHdCNOBKx3i7Azo DMi4RbRSlC87NEckt6xvKwALfCZCfv2UwBIsblwo= 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.4 08/36] powerpc/pseries/mobility: use cond_resched when updating device tree Date: Sun, 6 Oct 2019 19:18:50 +0200 Message-Id: <20191006171045.639649064@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171038.266461022@linuxfoundation.org> References: <20191006171038.266461022@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 c773396d0969b..8d30a425a88ab 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -11,6 +11,7 @@ #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); @@ -282,8 +287,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