Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1950899ybh; Fri, 13 Mar 2020 10:14:08 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs08U2sQPkfj6AeuGcQbMhrcty71K5Eh/PdZbgIlUXLxC3amegKulDQb3klLVxdFxSH0aQW X-Received: by 2002:a05:6808:906:: with SMTP id w6mr6648574oih.31.1584119648754; Fri, 13 Mar 2020 10:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584119648; cv=none; d=google.com; s=arc-20160816; b=LQjGHT8Or6XuWhbAg+l0EwtKqnxfpgxXEsBCcLyEk19JFnqsaklEN7wY3eXcQk18Ad MKNOQs2lfFYAjhdtGLW7NNb08xvsL0xn2jryXe5ker75Wejyxl5XgOLHqfK6fowyGGOA bCjfRsrKmlFOkllVl3FsXWO5ncb4W3mIB2YQNWbsRR7INH95dHtQOW4yLwWl6rm/O+US cfTJDNjbLCpNWxwL6vOjo9pDQfxPAMhw4ff6162VP9ydLMiZLfj06E67x/Ta76rf3GEf khM+dabFtW0+2uaE4hNXMGbg7ic4uPt6wL0TcAkF7ubODHfB1orpAYm3FgbYIWGrLH1h EYoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9i1VcIGQBKvOT9Yd/IZFWMay3cd+gMILpeCF5u9rNvc=; b=w9sZTLB4d3esh/dfKwlzjBygeRh5vt9dRUlHWw127w7TsG46tOoWDYthnziOlEXQTB YFbKjqmm6OmeHo7CvY8Rh92tQcaEbcl85QLh4Hx7SMnm1SvhXUAx54jZij6wi3WGfYLS +NXlnyYn8hmqLF3unBODQut81ZoVXG8xcFybk3eADHaCWLx8c35RRp7mtC0m3j9YOtf1 d+A5Y6Sg+GXJ6NWlfG9IG+yx6SbgX8qhdi5Sr1XQHA7764SNTmK8zud3krgNfDFrhdgP 8dRwKKjnVc9Rmv5dgjZ49gdBwZ5GgD+cj/mM5bwnurkpIkQcXaBvm5IpoJQxEuu5pS2P TDlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pc7WgZK6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a59si5275596otb.8.2020.03.13.10.13.44; Fri, 13 Mar 2020 10:14:08 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=pc7WgZK6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726882AbgCMRMm (ORCPT + 99 others); Fri, 13 Mar 2020 13:12:42 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:32994 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726414AbgCMRMm (ORCPT ); Fri, 13 Mar 2020 13:12:42 -0400 Received: by mail-lj1-f195.google.com with SMTP id f13so11390594ljp.0 for ; Fri, 13 Mar 2020 10:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9i1VcIGQBKvOT9Yd/IZFWMay3cd+gMILpeCF5u9rNvc=; b=pc7WgZK64lZOBYMpH2huzgvQuSv/xXu5TaxoHrzHo8o4Zu0s/Lw4cUh4rAVRMz2GCG fSo60DMjZCe4GHi59hv7tDNUYWWVoZhx+mrNVLCw4VL+F+4vQurXyb+oY4/H2AtI5JUY 7hlRETqxdxpmDDd6bfpTYYZ/dlQlDWspIaqsmhJ67YvEEPZvSNYNoCF6CodTYpCw5J5s Ok3yl9a3t+9yD+3E9LqBmGzLuTThxR7DJN3Dw3JPtWR2iyWxVkxIB0BdWDCB1iv0T05U iTimEy8E9rwHRilHpum4z2fkh26yNEyxSzqYuVXnzCKL8bh49FOGl67S/o8tcydwDzUI Yxvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9i1VcIGQBKvOT9Yd/IZFWMay3cd+gMILpeCF5u9rNvc=; b=HqBO4CIc0Io4MfLeJ3mF1xALwfJj77SCqyyOLEdDUBNajmm3PDjLJ2sbcKDftle/nV okY45MTumkdn1wGsKzq+TWUv3tEpPOcth7/z0eFugKtAsmlildr7oWVRStsoSUxRJuch 3TMt7bPJu8HzpYRKSajcm4s2I295vI+uYwTAQ8PUr5vQS2Bibh4fqSa+P6LpKjeD3UBe VLfrhUPe1ekN7Xp0enH3c7FC3nEnlqlf+5PCLa8TaTLzNnnthOO5N6nplgR5lSf5x8TH cdUumP9usN3dxS7cFEGhbK0lwC7Ih4o9aaEScE1PYk4BPvQPdX4GCJEgXJ7sh8WG7H/Z SsAg== X-Gm-Message-State: ANhLgQ3jD0rPRLkwIb/acHsyO4TqLCpZDQmPJD6HddC458laMa32WZPv BZW0SBVmvjffIOs3+L1K6PzN36vc/2yBhHVvGMLg3Q== X-Received: by 2002:a2e:b5c3:: with SMTP id g3mr8650818ljn.151.1584119560282; Fri, 13 Mar 2020 10:12:40 -0700 (PDT) MIME-Version: 1.0 References: <20200312165429.990-1-vincent.guittot@linaro.org> In-Reply-To: From: Vincent Guittot Date: Fri, 13 Mar 2020 18:12:28 +0100 Message-ID: Subject: Re: [PATCH] sched/fair: improve spreading of utilization To: Valentin Schneider Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Mar 2020 at 17:57, Valentin Schneider wrote: > > > On Fri, Mar 13 2020, Vincent Guittot wrote: > > >> Good point on the capacity reduction vs group_is_overloaded. > >> > >> That said, can't we also reach this with migrate_task? Say the local > > > > The test has only been added for migrate_util so migrate_task is not impacted > > > >> group is entirely idle, and the busiest group has a few non-idle CPUs > >> but they all have at most 1 running task. AFAICT we would still go to > >> calculate_imbalance(), and try to balance out the number of idle CPUs. > > > > such case is handled by migrate_task when we try to even the number of > > tasks between groups > > > >> > >> If the migration_type is migrate_util, that can't happen because of this > >> change. Since we have this progressive balancing strategy (tasks -> util > >> -> load), it's a bit odd to have this "gap" in the middle where we get > >> one less possibility to trigger active balance, don't you think? That > >> is, providing I didn't say nonsense again :) > > > > Right now, I can't think of a use case that could trigger such > > situation because we use migrate_util when source is overloaded which > > means that there is at least one waiting task and we favor this task > > in priority > > > > Right, what I was trying to say is that AIUI migration_type == > migrate_task with <= 1 running task per CPU in the busiest group can > *currently* lead to a balance attempt, and thus a potential active > balance. > > Consider a local group of 4 idle CPUs, and a busiest group of 3 busy 1 > idle CPUs, each busy having only 1 running task. That busiest group > would be group_has_spare, so we would compute an imbalance of > (4-1) / 2 == 1 task to move. We'll proceed with the load balance, but > we'll only move things if we go through an active_balance. yes because we want to even as much as possible the number of tasks per group > > My point is that if we prevent this for migrate_util, it would make > sense to prevent it for migrate_task, but it's not straightforward since hmm but we don't want to prevent this active balance for migrate_task because of cases like the one you mentioned above. we might consider to finally select a CPU with only 1 running task with migrate_util if there is no other CPU with more than 1 task. But this would complexify the code and I don't think it's possible because migrate_util is used to pull some utilizations from an overloaded group which must have a CPU with a waiting task to be overloaded. > we have things like ASYM_PACKING. > > >> > >> It's not a super big deal, but I think it's nice if we can maintain a > >> consistent / gradual migration policy. > >> > >> >> > >> >> > might be hard to notice in benchmarks.