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.4 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 136FDC4363A for ; Fri, 23 Oct 2020 17:15:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C40BD24641 for ; Fri, 23 Oct 2020 17:15:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753256AbgJWRO7 (ORCPT ); Fri, 23 Oct 2020 13:14:59 -0400 Received: from foss.arm.com ([217.140.110.172]:57074 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S465533AbgJWRO7 (ORCPT ); Fri, 23 Oct 2020 13:14:59 -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 8A2EE1FB; Fri, 23 Oct 2020 10:14:58 -0700 (PDT) Received: from [192.168.178.2] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 605163F719; Fri, 23 Oct 2020 10:14:56 -0700 (PDT) Subject: Re: [PATCH] sched/fair: prefer prev cpu in asymmetric wakeup path To: Vincent Guittot , Valentin Schneider Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel , Morten Rasmussen References: <20201022134354.3485-1-vincent.guittot@linaro.org> From: Dietmar Eggemann Message-ID: <2a2699ee-e62f-1590-c846-009af0478c59@arm.com> Date: Fri, 23 Oct 2020 19:14:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/10/2020 17:33, Vincent Guittot wrote: > On Thu, 22 Oct 2020 at 16:53, Valentin Schneider > wrote: >> >> >> Hi Vincent, >> >> On 22/10/20 14:43, Vincent Guittot wrote: [...] >>> static int >>> -select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target) >>> +select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int prev, int target) >>> { >>> unsigned long best_cap = 0; >>> int cpu, best_cpu = -1; >>> @@ -6178,9 +6178,22 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target) >>> >>> sync_entity_load_avg(&p->se); >>> >>> + if ((available_idle_cpu(target) || sched_idle_cpu(target)) && >>> + task_fits_capacity(p, capacity_of(target))) >>> + return target; >>> + >> >> I think we still need to check for CPU affinity here. > > yes good point We don't check CPU affinity on target and prev in the symmetric case. I always thought that since we: (1) check 'want_affine = ... && cpumask_test_cpu(cpu, p->cpus_ptr);' in select_task_rq_fair() and (2) we have the select_fallback_rq() in select_task_rq() for prev that this would be sufficient? [...]