From patchwork Thu Sep 19 07:33:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 174043 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp664294ill; Thu, 19 Sep 2019 00:34:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwInXEaYFIRye0ul6D4PlFEs1jjyO2SwtBC7iH3HA02OX3/LG/XaZs0HDFlwCNgAUQzKYJh X-Received: by 2002:a17:906:19d3:: with SMTP id h19mr13326173ejd.121.1568878460910; Thu, 19 Sep 2019 00:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568878460; cv=none; d=google.com; s=arc-20160816; b=ypkrI1ZQTUcOBZb8duHUKDx26BjxKWTLgoOiVG0OWm6LKxIkaBe34xOX+hje345I6U cmSNwkzVXvhXJqAhkB4PKDartFqv3hCTT1YygcNkCNlQd0Sn1QS/fR7khBgES0o8EOu0 WdxDiZHimEvhnG5r8gEOgec27JblwA3p1GuKiTBQggFIX2L3aRm0xqvcDsfq51mYY8bZ pqbEk3e5NUnwrj1CGtY9AlJb19MhoDh78UR9V0jU/K38RyowHsRukf/csXf6R8Gvuwny JsX8/2AXAfzSn86rsUvXrZIvQqFMsAJ6W8DAJCSGGt5BZnhiRhS98HqxetFXtWgZcv3S 5BcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=AbILMuuDKN55sODbN+TLyTtglr3cL8J1sJ9BIBcXt6A=; b=UYqSN1QbPNkTaFigajlb8JET6IIDqZEVPZCtLgvlfuAHc1llP9DO6E8IqxE+w7q59X mkTtyOy8bzid/pveWoDyMg854P0gPlK+bP/dAc45nphFl+eRkra5YTmWh6cR5vBfuCIq //Ip+1v3TYRqc0Ows1r6sQOAQQrfos645fw6qktb8tdOYUC9PP7aATw46kW3byeiciBZ QzdU9eGIXnVUD/jOlDkCzQlSqtlrxO4H3cRlANjyl6KDERSPGrphKsycRFM8FIU20yt9 95tb353EYipO8cRM97hV8F4CJPaqkZeQMSZ9yL6vLKlzPGWYKBEDP+fEfJWayo6SM/5b yQww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=otw9vtrw; 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 z11si4857911edl.1.2019.09.19.00.34.20; Thu, 19 Sep 2019 00:34:20 -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=otw9vtrw; 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 S2388693AbfISHeQ (ORCPT + 26 others); Thu, 19 Sep 2019 03:34:16 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54676 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388671AbfISHeN (ORCPT ); Thu, 19 Sep 2019 03:34:13 -0400 Received: by mail-wm1-f65.google.com with SMTP id p7so3063087wmp.4 for ; Thu, 19 Sep 2019 00:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AbILMuuDKN55sODbN+TLyTtglr3cL8J1sJ9BIBcXt6A=; b=otw9vtrwhhPK8FHKTcBk1J76bXEWX0hh4qd3KHNz4DE/4ogtL5vjwN8cGO7gpWGqns m3+31f30t6LakblwZJig06N4cS+FBHSap9q6xCdZto7aJKF3yZmmR1vb8EuScHhUJSjr fBYdoTeaqZLSinNRy1KJ8hgTCrTgxIX/3WvqqWvoHXlBVwtcAU5YfRMgOY+uFrubEIIs VtdY1+hc6mbIRODCttt/dayg7Nibpiaad1JXUFJgH1Nmfly7s4iMHFU3FoVEbgdWSR+j NydRukRgLiPCJXIQ1w4L0YLvRXncbZFS12/YvxdbLNK2B2Iy4vvTPND4CMk4xvhEz2yL PlRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AbILMuuDKN55sODbN+TLyTtglr3cL8J1sJ9BIBcXt6A=; b=ukFhl6jd7V3+AWbFUNGD1QN6JhVdr060sXLpecoKFEut2wnNZs42gTn4hBSrATRRfo bNp3cyDmFFP5JBzTdTBe34anQM+kEETVK1v+mNdeLR8wy3t5wSGyWLz+wTEgbJ7Ecvjm PjoCcPCaeRGD9WvaVNAt018tC/oDlbYlZ6eTpfmLgMPfm4AUTmHbxRC8XMkg57iL7U6z 759r2uzEumoEwjwBORmlWqpMvnE8d8oHnfarGNINSvru4eKcyRP0CIf2x6p9m4lIsVl9 ibBvM6+MnRhNs/PApf6VpOjRb4BffRIXyFe1YDBDdBOsEVH5ceEqU3RLmdJ3mt1/+KJC YnOw== X-Gm-Message-State: APjAAAUhqNsRENy++qZr9NSDxPiz/0Q6V+XPp0JUw/Ziobfe94v0yXX1 MyYy343wLDP0jMayQd/ybJInDGEPFzQ= X-Received: by 2002:a05:600c:254f:: with SMTP id e15mr1487005wma.163.1568878450982; Thu, 19 Sep 2019 00:34:10 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:d555:8fca:a19c:222c]) by smtp.gmail.com with ESMTPSA id s12sm13300250wra.82.2019.09.19.00.34.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Sep 2019 00:34:09 -0700 (PDT) From: Vincent Guittot To: linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org Cc: pauld@redhat.com, valentin.schneider@arm.com, srikar@linux.vnet.ibm.com, quentin.perret@arm.com, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, hdanton@sina.com, Vincent Guittot Subject: [PATCH v3 08/10] sched/fair: use utilization to select misfit task Date: Thu, 19 Sep 2019 09:33:39 +0200 Message-Id: <1568878421-12301-9-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568878421-12301-1-git-send-email-vincent.guittot@linaro.org> References: <1568878421-12301-1-git-send-email-vincent.guittot@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org utilization is used to detect a misfit task but the load is then used to select the task on the CPU which can lead to select a small task with high weight instead of the task that triggered the misfit migration. Signed-off-by: Vincent Guittot Acked-by: Valentin Schneider --- kernel/sched/fair.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a7c8ee6..acca869 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7429,14 +7429,8 @@ static int detach_tasks(struct lb_env *env) break; case migrate_misfit: - load = task_h_load(p); - - /* - * utilization of misfit task might decrease a bit - * since it has been recorded. Be conservative in the - * condition. - */ - if (load < env->imbalance) + /* This is not a misfit task */ + if (task_fits_capacity(p, capacity_of(env->src_cpu))) goto next; env->imbalance = 0;