From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74AC1C433B4 for ; Tue, 13 Apr 2021 10:59:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59E9B61242 for ; Tue, 13 Apr 2021 10:59:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344762AbhDMK7t (ORCPT ); Tue, 13 Apr 2021 06:59:49 -0400 Received: from foss.arm.com ([217.140.110.172]:40372 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344499AbhDMK7R (ORCPT ); Tue, 13 Apr 2021 06:59:17 -0400 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 2971611B3; Tue, 13 Apr 2021 03:58:58 -0700 (PDT) Received: from [10.57.29.116] (unknown [10.57.29.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A29E03F73B; Tue, 13 Apr 2021 03:58:54 -0700 (PDT) From: Pierre Gondois Subject: Re: [PATCH] sched/fair: use signed long when compute energy delta in eas To: Xuewen Yan Cc: Dietmar Eggemann , Quentin Perret , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Benjamin Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel , Chunyan Zhang , Ryan Y References: <20210330052154.26861-1-xuewen.yan94@gmail.com> <34ce11ad-9c20-7ba7-90d8-4830725bf38a@arm.com> <1ebddd33-4666-1e6e-7788-a3fe28c9e99c@arm.com> Message-ID: Date: Tue, 13 Apr 2021 11:58:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-2022-jp; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > > > > In fair.c:select_task_rq_fair(), if feec() returns a error (< 0), then > > prev_cpu is selected. I think it's better to still let feec() signal > > that something happened and let select_task_rq_fair() select prev_cpu by > > itself. > In fair.c:select_task_rq_fair(), when feec() returns a error (< 0), > the new_cpu = find_idlest_cpu() or select_idle_sibling(). > In your patch, you should return prev_cpu instead of -1 if you want to > select the prev_cpu. Having a negative delta doesn't imply that prev_cpu is still available. E.g.: If prev_cpu cannot receive the task (and is skipped), and a negative delta appears when evaluating the other CPUs. In such case feec() cannot select prev_cpu. dst_cpu must be selected by another function. > > Are you planning to submit a V2 with the bail out mechanism ? > Maybe it would be better if you submitted the V2 ? I just check the > patch and raised some questions. I m ok to send a V2. I will submit it once we agreed. Regards