Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp735142pxu; Fri, 23 Oct 2020 11:58:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt5h7sKELV9QKvJXNmzWKMU+r3d+ukOEJC5u9oiqnEUeW/WG7BQRHP18MYVUv2NBClujSv X-Received: by 2002:a17:906:110b:: with SMTP id h11mr3558049eja.156.1603479496370; Fri, 23 Oct 2020 11:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603479496; cv=none; d=google.com; s=arc-20160816; b=iG1t5jiQO/UQLX1fy6lfQRX03sjdXz3we6Bh8VbU6RnytORuZr4xeP0F9queKNOO19 SKeMzAlOkf1R+h0Qn2tJpazPf86+fvGNgzJDHXzl5ZzzqYOaoUGh3W7DuzOfHhSPGUAK ZaA4uQtN9UM+9AS+VaYa/V9zPjBMuGpLCUtwdHO4VEyW+PNSDn4j26LGKYQ8Gj78P2pz MD9FHqwZePSQ0/Md6dGsFRxYqZeDfGuo8UMvwsK9j7TkXC5GGR77Plb0dRpHcW407b71 CH3/Ce7VrILklSrUYWAa2GpayQFVv3eMvDDP2gFd1z8lhnxAoqQfCTDMq8PdfZe6VzKu r/Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=//+Xcm0eoemFjFocGLF6iWSlfsd3fOXoelONYmqdYKc=; b=pS6Ljvzv8xo5elKg8G/aEhxArWQZkS8D7RHcrx2aTz+i0qhJU08UB5td64xzGQuoVb bQbTijSSCBpnME/pAuq1TwugDiDX/y78C1vzMzKX4bGkThJOZXz9+eRMnHZXH+oWy3YL o/nIgRku2CJfeR2mTXjN+fVBanBnbzJugz6P/aF4XuSyb2AlR2xTGNgAQsIlTB/XIUPS el3kRKowweJz6wkqIkRAfezu6295vw87uNfqn589a31Ufm1LIH6UL7dg9yLR2JznHBTk ocKtVhfOIpQ9aqbSwsjFppKEXnU1W+k7Z+k7Bu8/c9JjDOGCQWiZvbIrEyqK7LQmA1eH 6+FA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si1306552edr.299.2020.10.23.11.57.54; Fri, 23 Oct 2020 11:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1753252AbgJWRO7 (ORCPT + 99 others); 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? [...]