Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7728784imu; Fri, 28 Dec 2018 03:57:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN7rS2VR5dv6RohRoVrDx5guuP8AesxTamQ4UOpMdRroI8t5G+/j+v11XvX8iQG+1acIqjox X-Received: by 2002:a63:2222:: with SMTP id i34mr24185369pgi.83.1545998269843; Fri, 28 Dec 2018 03:57:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545998269; cv=none; d=google.com; s=arc-20160816; b=d311n0qv5QoVS+j7Zqq+z6EGqkHfFzDWsVmBNfiPjyRE+nH7ZfrR1gR6S+lsXluGxu 9izGFl5B+TLJF45I29+Y2OPhs+hj1XS2lWNNwg36ebRNXJlMd3QrpKKYk2FDh5HEjZVK j3zFtD7/7gFwOhQkCc/M1Cv/98Znxur/KjqB7GLnS/1gNtBTTHAjQkaEWGpbngkrKASb Cf/SYvAwZ+tva0Ydonccs4j6OhCA1nsE0Ny0iYRLCxijrnYR7V9GxHqaHPEAdbNca7wb Qkyxl5zWFa7iL/Dvg9Fp7d+8iwzTDBC2OVOuNZeAmv7aGDX/YiMbjNDUlFw0za/J0H1h Kt5g== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=CYKKxS8Eeo9xrEeuhsd+8B8H5LdxJF7ofgclzxTHU+o=; b=rCkORavKMIYvPg6jT//Z4EDEC/RcMxhY3WwYEh9d7EBu/pGiHjgb6PEIPgAr6vjNcO dGic9Ks+pmJDZj1+q4t6Se+E+jpP3msl47MFjjOB45GbHM+hOaGYV6rlT0VWOaeu9Wua so2XGAAFECaJ4QbqAGBUxNn3J9gyjyonYSHX21meKJvPEYVcffz0AWCP/5/n+S1hiu6W KZDkR0tda+3IMmpjld7dpW9NqQ1qfrLCDuy0jdKQPtGz+VLlJR0dlo2KknUHCr6ZBjVe Uc2AM7EubUBfdzAZdIJA4J2AQ4Uuy+oXy+jSpcIc/Qrban0IWsOlTqDrpXgv2MT49aaN SZeQ== ARC-Authentication-Results: i=1; mx.google.com; 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 e126si22893538pfh.185.2018.12.28.03.57.34; Fri, 28 Dec 2018 03:57:49 -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; 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 S1727472AbeL1Cas (ORCPT + 99 others); Thu, 27 Dec 2018 21:30:48 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:39643 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727253AbeL1Cas (ORCPT ); Thu, 27 Dec 2018 21:30:48 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 83BADE006AE0D; Fri, 28 Dec 2018 10:30:42 +0800 (CST) Received: from [127.0.0.1] (10.177.19.210) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.408.0; Fri, 28 Dec 2018 10:30:35 +0800 Subject: Re: [PATCH] sched: fix infinity loop in update_blocked_averages To: Tejun Heo , Linus Torvalds References: <1545879866-27809-1-git-send-email-xiexiuqi@huawei.com> <20181227102107.GA21156@linaro.org> <20181228011524.GF2509588@devbig004.ftw2.facebook.com> <20181228015352.GG2509588@devbig004.ftw2.facebook.com> <20181228020243.GH2509588@devbig004.ftw2.facebook.com> CC: Vincent Guittot , Sargun Dhillon , Ingo Molnar , Peter Zijlstra , , , linux-kernel , Dmitry Adamushko , Rik van Riel From: Xie XiuQi Message-ID: <5ed559eb-f169-ecd0-0f1a-65786422b9ac@huawei.com> Date: Fri, 28 Dec 2018 10:30:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20181228020243.GH2509588@devbig004.ftw2.facebook.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.210] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tejun, On 2018/12/28 10:02, Tejun Heo wrote: > On Thu, Dec 27, 2018 at 05:53:52PM -0800, Tejun Heo wrote: >> Vincent knows that part way better than me but I think the safest way >> would be doing the optimization removal iff tmp_alone_branch is >> already pointing to leaf_cfs_rq_list. IIUC, it's pointing to >> something else only while a branch is being built and deferring >> optimization removal by an avg update cycle isn't gonna make any >> difference anyway. > > So, something like the following. Xie, can you see whether the > following patch resolves the problem? Zhipeng is preparing to test it, thanks. > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index d1907506318a..88b9118b5191 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -7698,7 +7698,8 @@ static void update_blocked_averages(int cpu) > * There can be a lot of idle CPU cgroups. Don't let fully > * decayed cfs_rqs linger on the list. > */ > - if (cfs_rq_is_decayed(cfs_rq)) > + if (cfs_rq_is_decayed(cfs_rq) && > + rq->tmp_alone_branch == &rq->leaf_cfs_rq_list) > list_del_leaf_cfs_rq(cfs_rq); > > /* Don't need periodic decay once load/util_avg are null */ > > . > -- Thanks, Xie XiuQi