Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp873498rwn; Thu, 15 Sep 2022 07:36:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5n36wP8o0U8xWWPDt2CskqMRR+P18R5jEFKQ+SqTuxFNhjj2RBU0UBdDyYny44XK12ryk6 X-Received: by 2002:a17:906:6a14:b0:774:a998:d9a2 with SMTP id qw20-20020a1709066a1400b00774a998d9a2mr212063ejc.496.1663252578747; Thu, 15 Sep 2022 07:36:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663252578; cv=none; d=google.com; s=arc-20160816; b=zIK1osEk0fYhPCww6vDKSrqs7CBrIA8o492UOziwR8p76VPnPWQm3JdnO77Ez5yJGp lZSx2b32wJaVNJJ8zloURUQEo+MYlObEXZijQoMjV6/Y3wZdTRQ61rw8TTUvvjivIAx3 5EDikY63QbzyWs9LcV3w2WDXu0T9tafJwklKU39KSD6bC2Ij9NMilutGpSd+3CDwsz80 POSwTJYjAPGiheueOzw3RW/BKeVgrXkcGul3HtIihmMUy4UV0Z7qc3qFlkwDqQh+rTqK 8uCc7kAUSsXJGqYhrLbMH0MeAf/uSBv9fV1iCtD0YlR1OX5HOjUvJ3ftCcUtKhk8lFot k31w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=EvLHKuejWzRszAiwt0EF9ZYaqKXPmd8jt6upfMrSOUM=; b=FsRnSSPUtB2n6LKBYOr2OHS1Nl4/rXo/iLCxMA6zva4QGyasTGzdiORWMBvrzP383z mZjSLoaKFCFaH3sG4Zf8PaG3prHGBeoezz6rB2Q4iOYwnIn1WLURBBax0UOesFjpId8w rZnWgIZFV6dozn7FsyncqIBvOk7x69yZxytOCHUp6WBx/iO5KgXnEV0p6jPWfHO+IeIT hzjcEdl+knyiL05rQY+Db1+xl31r/Qu86Akln/Hdg/Yl0Mh2gFDOeyvL3piOqeqdMBKB WrCvedLXfexFJ6Tp0T1SkaBxpgfK/ZUwrui5TfraaeMw/IBrs2SB9AjsrZDQFgp1e/lg fk6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UUvjwo9R; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne19-20020a1709077b9300b0077951929341si17826031ejc.312.2022.09.15.07.35.42; Thu, 15 Sep 2022 07:36:18 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UUvjwo9R; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229572AbiIOOYW (ORCPT + 99 others); Thu, 15 Sep 2022 10:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbiIOOYR (ORCPT ); Thu, 15 Sep 2022 10:24:17 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CF5D9C8E2; Thu, 15 Sep 2022 07:24:12 -0700 (PDT) Date: Thu, 15 Sep 2022 14:24:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1663251851; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EvLHKuejWzRszAiwt0EF9ZYaqKXPmd8jt6upfMrSOUM=; b=UUvjwo9RJ4SuNZev/VOGuKpXIpZ5QZy5kBDyaIzjwt3CfNU4v82dzNThp770/zBexY/6jh 7zjhw/kPXz5R3szv+CYKVRhZp2N7oNKA00O5lr9XupPw29H3tePAvwrTSsMBAHt4qWiocq IhVNVcRkDaRP4TzaSB0hr93zPvdXm5Ky7fegcb+IXpw8GXmqj+HnxcXRwQBQY6AxUrn7gV ZpA8OYraJ3YJ84ExZ2bfsQ7czx8XqmJh8Z8OTyHhVz/aKxeDPbEb5ZmM+Yk7C/MQluCMid YYrq3fbB0LZDNZ4JSgwY7rzGSoy5mhC5LBj3KeUNKYzN961Oec9XWSs8S+sSSA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1663251851; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EvLHKuejWzRszAiwt0EF9ZYaqKXPmd8jt6upfMrSOUM=; b=MUCAWpYl7VPsTxv/cZMUxrZy7giC9eHYA1jUyIQzMtdYu59ImubukgGUn61LH3mn1vO7f3 2XP+C47ytHHzWqAQ== From: "tip-bot2 for Vincent Guittot" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/fair: Move call to list_last_entry() in detach_tasks Cc: Vincent Guittot , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220825122726.20819-4-vincent.guittot@linaro.org> References: <20220825122726.20819-4-vincent.guittot@linaro.org> MIME-Version: 1.0 Message-ID: <166325184995.401.17589955355834278252.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 The following commit has been merged into the sched/core branch of tip: Commit-ID: 7e9518baed4cef76dbfa07cbffbae1e6dbc87be6 Gitweb: https://git.kernel.org/tip/7e9518baed4cef76dbfa07cbffbae1e6dbc87be6 Author: Vincent Guittot AuthorDate: Thu, 25 Aug 2022 14:27:25 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 15 Sep 2022 16:13:52 +02:00 sched/fair: Move call to list_last_entry() in detach_tasks Move the call to list_last_entry() in detach_tasks() after testing loop_max and loop_break. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220825122726.20819-4-vincent.guittot@linaro.org --- 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 7b3a58f..5ffec43 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8044,8 +8044,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 @@ -8062,6 +8060,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;