From patchwork Thu Jan 17 17:44:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 155857 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2247403jaa; Thu, 17 Jan 2019 09:44:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN5IIQ8jKPCpDKCrYirQxB860uHrwSnLQE6ZuprNxzNMFw/Zmz4o4YpzaLgSlIYhJe+bExf2 X-Received: by 2002:a17:902:8346:: with SMTP id z6mr15881224pln.340.1547747061213; Thu, 17 Jan 2019 09:44:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547747061; cv=none; d=google.com; s=arc-20160816; b=CjmaldZ4YtUmqoptkJUHVwFYry6Noag0TvnrKWBOHB2WbO/R0EMKBeYe+YE0mvhzcE zXl0l6ywN1cU8NOydKICS/cloziHEi94WkCqAO9HgX1F1rFK1wqBuhZCzUGoV9bACB3m ZO8QGw9qwu+E6Yty4f46brGEqg2fVPVKupZLGiDlUScWNOI6e5PUtwYppiz2Pe6ohuhd HT1TPr5CD+ViISU0gCrKJuFGB9p/hKLWUxy7gnF4+u5vxThFgek0aLX5w8cVTyIujhfr l5xh5RsypfUsRUYCx3iEi534ca5u5VVs2TLIc/QXVV07MaqALfZa67JxNuDd3rzxCGyI HK7g== 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=1aBp5LxJH6+t5l6K90aaA3r7dWGab6glXC9WTdCKErQ=; b=M6TVDHrQfdzMWOJTCqaaEzV40H/IcT37VI9JO7b9PkKdl6XHcEcZvwSBtBYIza956E 9M55ajkU0t55z+MXwYkdNK5y9BYknaJ5647hsmWb8edN9qeJcyT58wlQq6YW60ApqClI myeLCZDSqcVYo8gEX9R0y0FwDvs2sQS9cS6RGHTYbauzas/hIEDx85JqjDRArnx4tzWL 3Cm8vTtZv08/eWvbMbIDDVsfE6DXZvt2nXPktgHbzbYipUImVvsv/r5hMXMDnTQPzShI BOjR5t8tnLo+l6vfAKmR50Ws6gRD9TfaUrsQKPSywO32I9Q5gJ1ZNL22AE8tgQq0zwW2 rSaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="RG19avk/"; 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 m3si2140924pfh.58.2019.01.17.09.44.20; Thu, 17 Jan 2019 09:44:21 -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; dkim=pass header.i=@linaro.org header.s=google header.b="RG19avk/"; 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 S1728971AbfAQRoT (ORCPT + 21 others); Thu, 17 Jan 2019 12:44:19 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35632 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbfAQRoR (ORCPT ); Thu, 17 Jan 2019 12:44:17 -0500 Received: by mail-wr1-f68.google.com with SMTP id 96so12005247wrb.2 for ; Thu, 17 Jan 2019 09:44:16 -0800 (PST) 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=1aBp5LxJH6+t5l6K90aaA3r7dWGab6glXC9WTdCKErQ=; b=RG19avk/WOOK4DVDnChRNWLFFkb3g7VMzvivOx9FiYXAkGhigIri2RY0JDIvS4iqPH oBNk0tBjxL0azQ/01eaBFZF+EMaTL8APlcLVdeqMir1kKJwXNr+26CCRmGDzCeG90qGd 0/1EApEPEWLkrqxdcilfYsDG1NFYM824NgJ8E= 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=1aBp5LxJH6+t5l6K90aaA3r7dWGab6glXC9WTdCKErQ=; b=QFkFPnjcYRCKDzQC1MjKvfRVms5AL5Don62mqE9Ds5DrPp9vbpWJdyeT/c2SRyV1R/ +CW+/dr16WroFt8ebEKUBlEMMzzcWBVLdqPP4UY9JIqjgcxAvkwFBLwc6iwGmM8hQwUH k0QZtnItiWbzYtpmxZHvrSUvz4AOMW+fwCIT8u/J8XXRYn2JWb2WAwLfVjmv5yORAM9t vrJVQEQylpsjZ7KOUXME6UlQKauGjm0XBe+GJaVAHmoYQdpAjfmOujYi6x9cHEiKLi/Q cbNHphwSeoT6tkbjw+N3hb3tepVUT8RmyTrIpJx37U4qgS2HlBBFDsCRbZvrUpH98cgd iWKw== X-Gm-Message-State: AJcUukdSpMjI8iN6OwIva9AXgAKAP9elFdzGfb+PFjCYRspmixixTAyz BrfDSZmfWuvIfZiP8E2eRYtmcuguEF/WvQ== X-Received: by 2002:a5d:4ac7:: with SMTP id y7mr12301851wrs.196.1547747056158; Thu, 17 Jan 2019 09:44:16 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:f:6020:8435:96d6:e03:9e78]) by smtp.gmail.com with ESMTPSA id i186sm47583622wmd.19.2019.01.17.09.44.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Jan 2019 09:44:15 -0800 (PST) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org Cc: valentin.schneider@arm.com, Morten.Rasmussen@arm.com, Vincent Guittot Subject: [PATCH v4 1/3] sched/fair: fix rounding issue for asym packing Date: Thu, 17 Jan 2019 18:44:07 +0100 Message-Id: <1547747049-6320-2-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547747049-6320-1-git-send-email-vincent.guittot@linaro.org> References: <1547747049-6320-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 When check_asym_packing() is triggered, the imbalance is set to : busiest_stat.avg_load * busiest_stat.group_capacity / SCHED_CAPACITY_SCALE But busiest_stat.avg_load equals : sgs->group_load *SCHED_CAPACITY_SCALE / sgs->group_capacity These divisions can generate a rounding that will make imbalance slightly lower than the weighted load of the cfs_rq. But this is enough to skip the rq in find_busiest_queue and prevents asym migration to happen. Directly set imbalance to busiest's sgs->group_load to remove the rounding. Signed-off-by: Vincent Guittot Reviewed-by: Valentin Schneider --- kernel/sched/fair.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.7.4 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ca46964..1e4bed4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8476,9 +8476,7 @@ static int check_asym_packing(struct lb_env *env, struct sd_lb_stats *sds) if (sched_asym_prefer(busiest_cpu, env->dst_cpu)) return 0; - env->imbalance = DIV_ROUND_CLOSEST( - sds->busiest_stat.avg_load * sds->busiest_stat.group_capacity, - SCHED_CAPACITY_SCALE); + env->imbalance = sds->busiest_stat.group_load; return 1; }