Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4960530rwn; Mon, 12 Sep 2022 01:58:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR7KOmQH8RcIs9+ByL1LQI24exPJtnzP9HutlZGOScFpYg0j0WASqf2sa/35kkb6CHsLfV24 X-Received: by 2002:a05:6402:5192:b0:43d:cc0d:6ea4 with SMTP id q18-20020a056402519200b0043dcc0d6ea4mr21250653edd.111.1662973102913; Mon, 12 Sep 2022 01:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662973102; cv=none; d=google.com; s=arc-20160816; b=SpqPc0/YXd56spatV5ZlGF6URwr7rEWemjFkxosf2YBuyyxHt1wpIHmb1p5mkaB6yW QP5Gjljns1QrJcWrlXku1bWEBz6XJJXAdisuGEHShUg+rYDwio9DdAvkjEeWH6NoIQIn IotI6qW8HQFDfURTWtk+xz9Lfvm0mbYKDYstrBoQXVO9V6S5sZhfZl9Ut/wFgQUy2ueE Cf8E1wvhwsUl+s/SHzybct3av2SdAsEkcwC2vcMUSVneuqm9KZMbf+PalEwiTbNz6Fo3 gFT+oDJFTQroKigHWcQry7+n4BBDoeqVrrEoNAF/edkqcYPqJOvEJroOdtqSLMr5kaFO F4hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=3WrSEnzLFgPBbEZUvGnGarj5gHhRTTNdxYD+rSMPuJs=; b=j5knJScTz5aQHo4UlRgav+3rsFBUd1aKuonlc22/7cWatZhKGfqOgq3qOSYx7+p17S 034PZUKXriZmBO87Epdf/1Eq4Cw7Ax9/TmrlCWnmpWBHVFwldSADUndqciFMEyU7FTYc Va1JxDOwHlzhaa+XSDL0ccwpBfndP5X2MLuSExXuRkywB10CC+Abw2iEx72W9fLUwhPd 5kX+1yUP+Am/jz/Usk/EtzZ+G6aZXXXTK49lJIZ8Le78t0rB0V3zvYTkYttC5ViojcNq XqJokjbX1YOFcuFIFwfR9IClRbyxVMbJhjJz3iSTkU9V3f6OrE0UIJTrCF28jmtWit36 WSLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn5-20020a1709070d0500b0077cc5693fe3si3472600ejc.682.2022.09.12.01.57.57; Mon, 12 Sep 2022 01:58:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229825AbiILIqd (ORCPT + 99 others); Mon, 12 Sep 2022 04:46:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbiILIqa (ORCPT ); Mon, 12 Sep 2022 04:46:30 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C9052A70D for ; Mon, 12 Sep 2022 01:46:29 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2645F113E; Mon, 12 Sep 2022 01:46:35 -0700 (PDT) Received: from [172.16.16.241] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1EFB33F73D; Mon, 12 Sep 2022 01:46:26 -0700 (PDT) Message-ID: <1138228c-f26a-d968-4c92-9ea9c8c85c6f@arm.com> Date: Mon, 12 Sep 2022 10:46:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 3/4] sched/fair: move call to list_last_entry() in detach_tasks Content-Language: en-US To: Vincent Guittot , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org Cc: zhangqiao22@huawei.com References: <20220825122726.20819-1-vincent.guittot@linaro.org> <20220825122726.20819-4-vincent.guittot@linaro.org> From: Dietmar Eggemann In-Reply-To: <20220825122726.20819-4-vincent.guittot@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/08/2022 14:27, Vincent Guittot wrote: s/sched/fair: move/sched/fair: Move s/detach_tasks/detach_tasks() > Move the call to list_last_entry() in detach_tasks() after testing > loop_max and loop_break. > > Signed-off-by: Vincent Guittot > --- > kernel/sched/fair.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 6972a1a29a48..260a55ac462f 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -8047,8 +8047,6 @@ static int detach_tasks(struct lb_env *env) > if (env->idle != CPU_NOT_IDLE && env->src_rq->nr_running <= 1) > break; > > - p = list_last_entry(tasks, struct task_struct, se.group_node); > - > env->loop++; > /* > * We've more or less seen every task there is, call it quits > @@ -8065,6 +8063,8 @@ static int detach_tasks(struct lb_env *env) > break; > } > > + p = list_last_entry(tasks, struct task_struct, se.group_node); > + > if (!can_migrate_task(p, env)) > goto next; > Reviewed-by: Dietmar Eggemann