Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1025360ybl; Wed, 4 Dec 2019 15:23:42 -0800 (PST) X-Google-Smtp-Source: APXvYqz9D23hO9qSkvxALMzKPDW3DxBlOfPEopBt02FlIzDPwbBBtX7q1qIrla/E6dfqCjgjYcXD X-Received: by 2002:aca:6144:: with SMTP id v65mr4635329oib.150.1575501822331; Wed, 04 Dec 2019 15:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575501822; cv=none; d=google.com; s=arc-20160816; b=WyMFyOlFg97MyZJIHhivSFo1xOzNwBjbEmpVZ9DRONKd1bTzKxpWy1xMYhEJRRgYny MQCLkCz0tojkYFoetWSp8rKRIN2Kv4Vb67Ek+0c7bciRKWynzJ2mbA73tzdDsFbQhh73 zwOneTzx2ukxVVKXQB2tjqKgh//zvj0UDm0qudwzL+WZndLSY/K3Eni1JFhH1eHZDnH6 wf4MJ+4kmas0EotBA18xb+l6I1nn7jPHibhOuQyO6hePpdC6hBJS2S6rOX32hbM7Wbpa gAO7F3876NHIwqBIfIgSZrHTaxzztwbIzvCQ6ZUuSzNiYdGyWnDuj/tgce56tjgKx2MA 3U/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=3D8MJplXuKv6BHRsJ/AfcpYREqa04uZNYNEGIUVbG3U=; b=DwCSWeyGMyuhH7N4pQmhg7/uhqDdiXuWftyDjMCvKzSV63BnsAO9gWRD0O36R9p8na HUZW0b/6XI0py1Dtxex7YLT0staGyQLfY/nu2o6Gi2LLyIBwNkQ2C5D5cQK0D/kPcGCe WeCWn2KLj1+NnOAQfwOD7ibsFio0d9irdmmORMp4+iEaNdQlD2BMhNaT59cXtscV+8sl F+M73MVqh9aqA9y+8GIRuLBq5Z3vg3/B21irCQ8FD0IJEMNedv/0ufIlR/ZjWNLSV4Rj AFMuuP4ijJ64N/jVTMwIxViqpAkwYkf/znR9qY+T1Nk1DgBSuurhn9jGXgE2K2Q7LmIR G2Gw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k126si4191873oib.43.2019.12.04.15.23.30; Wed, 04 Dec 2019 15:23:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728374AbfLDXW2 (ORCPT + 99 others); Wed, 4 Dec 2019 18:22:28 -0500 Received: from foss.arm.com ([217.140.110.172]:39562 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbfLDXW2 (ORCPT ); Wed, 4 Dec 2019 18:22:28 -0500 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 E7C4D328; Wed, 4 Dec 2019 15:22:27 -0800 (PST) Received: from [10.0.2.15] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 47C243F718; Wed, 4 Dec 2019 15:22:26 -0800 (PST) Subject: Re: [PATCH] sched/fair: fix find_idlest_group() to handle CPU affinity To: Vincent Guittot , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org Cc: john.stultz@linaro.org, qais.yousef@arm.com References: <1575483700-22153-1-git-send-email-vincent.guittot@linaro.org> From: Valentin Schneider Message-ID: <738ad52b-d94e-c31a-3d40-56a0aba64453@arm.com> Date: Wed, 4 Dec 2019 23:22:01 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <1575483700-22153-1-git-send-email-vincent.guittot@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/12/2019 18:21, Vincent Guittot wrote: > Because of CPU affinity, the local group can be skipped which breaks the > assumption that statistics are always collected for local group. With > uninitialized local_sgs, the comparison is meaningless and the behavior > unpredictable. This can even end up to use local pointer which is to > NULL in this case. > > If the local group has been skipped because of CPU affinity, we return > the idlest group. > I stared at find_idlest_group() before the rework out of curiosity and AFAICT the "never visit local group" thing was there already. However, we would only use the load and spare capacity of that group, and the relevant variables where initialized to ULONG_MAX and 0 respectively. This would lead us to return 'idlest' (or 'most_spare_sg', but it's the same as 'idlest' now). So IMO this is just restoring the previous behaviour, which is what we want methinks. Reviewed-by: Valentin Schneider