From patchwork Thu Dec 20 07:55:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 154324 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5858632ljp; Wed, 19 Dec 2018 23:56:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/X/ieoI28B+DtH8sTAp0FK0yhWDQo+VKMJCXT5+6nHdlYjN/SbayHAEqgWrv0vz2DL7AUPM X-Received: by 2002:a63:4187:: with SMTP id o129mr20537812pga.370.1545292575406; Wed, 19 Dec 2018 23:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545292575; cv=none; d=google.com; s=arc-20160816; b=Suu4K2xFFSaSUBQb2JGn8pokL2ftstLu6IyMtauM0Uc0pUN4JNRqYPSSnbmzX92ZZG PfdBnP8L9WK4+Ld4zbzCntzZkYEVj//vDQBuQWlv9CaSnHy9YXXacGHz2BSGM4FRnFiI hAIhueMcHXjPulJ2hqSUa7uzn0eDWXh46VRS/di1ZLfkOWyzsi4a2KDB9vUAAhAlqG7P eTCGCq34kDgUgY3+Js3yRnPel+Eis1H5b3qZtlLHk2ivpawbCrX/6c97S+nPNaZZ0BqR tvphT2FLMSYe8D93A3xwzC6gDG3LkM/6u86v3L8SRsyffoZ1qufVHTrJQNRnvJZWk0ze bqeQ== 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=GFGQxWT3ZkEUOWnk0RCrGbiQU0QOjbOOWUD8Wmo9BcQ=; b=dpnqABw+b0FWR2ByzD3KL6EYtRTRILPukJc9v7aaKbPArriFOJwnAUmTrRaQBzsuSg aPUCr/eZP3itxW/kCBDQj3F8+lcQeGP1Nqief0yBCcfrE4oS/+LdSNsLdSrsmWY792ml K8MHOoYcNLQZVC6BtoIUmtu5bE/DSmmZh6RAzvpw08Lfw8w53l+WQ8meeDWD1L3BcSf2 BT4dsSgYfmuXvPE/mk67Pp4cEAGEuN2iklHBQojRIbjfg8O3+QvVbu1RvOXq6ORnEaHU pqs0xMNk1gddI+ZhdFtB+J4pgDNv8N7wYr3yDg3oynxefIlu8r8RIGtk4rqqh6fuuSwe ZRwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M6QXsA9G; 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 f23si1076903pgv.431.2018.12.19.23.56.15; Wed, 19 Dec 2018 23:56:15 -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=M6QXsA9G; 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 S1730729AbeLTHz5 (ORCPT + 31 others); Thu, 20 Dec 2018 02:55:57 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40356 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730649AbeLTHzx (ORCPT ); Thu, 20 Dec 2018 02:55:53 -0500 Received: by mail-wr1-f68.google.com with SMTP id p4so672204wrt.7 for ; Wed, 19 Dec 2018 23:55:52 -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=GFGQxWT3ZkEUOWnk0RCrGbiQU0QOjbOOWUD8Wmo9BcQ=; b=M6QXsA9GWl6z9aR19FVXi3McuENNUYA2mQI0RT0Wu8F7sLfqbugsdusqdeKEQubqI1 hmoEgkK7yi5g6YMv7TuV3IelnjeUTunVmnIodiPykfacP+69Ii9pk5hrMa7whyGDXMga DI3qV+LXm5IY/DnowtZtFkKSlSCgV0ZvAE9mA= 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=GFGQxWT3ZkEUOWnk0RCrGbiQU0QOjbOOWUD8Wmo9BcQ=; b=QGyt98rOgrvXD/RZPUV0b7bF8himF2Tr2EPUjNNdG0/ziXLk0849xhFL89u+XzHbs3 Tryt2BuWDx63cjTstf1igdriwuCK4BUV4nBBknw0cejOX++u3l39dTl0JKQ29Tad8OMQ 5zwffb2xktjpaDj7IXSLtvfF5mkbTCQHvKlZwhSd2Xmj6fc/63xcV5qJTCphOcuuzI5l bcLEyML5nRB+X3reyRD5FrgwjW4wjER0xcoSExypHUbuJkApkmrlShuDtMUrkMXQTH+Z o6yRyjwuqk/oUgtoumZqVTkIYXIbXHmKHx0dqH5TI2vSwMmf8K+EkzMbqCNQMV06tmi4 M0bQ== X-Gm-Message-State: AA+aEWZYTUqaWcrRhB1/GKzU6gcDJcLEiCiC6EZnTtgt8k7n8yESjKuq ArVdk0IWIY+vhSYwxnxNuFlk4g== X-Received: by 2002:adf:f390:: with SMTP id m16mr20794134wro.71.1545292551921; Wed, 19 Dec 2018 23:55:51 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:f:6020:f9b3:37c1:b11a:64ce]) by smtp.gmail.com with ESMTPSA id c10sm8773299wrw.49.2018.12.19.23.55.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Dec 2018 23:55:51 -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 v3 1/3] sched/fair: fix rounding issue for asym packing Date: Thu, 20 Dec 2018 08:55:45 +0100 Message-Id: <1545292547-18770-2-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545292547-18770-1-git-send-email-vincent.guittot@linaro.org> References: <1545292547-18770-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 sgs->group_load to remove the rounding. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.7.4 Reviewed-by: Valentin Schneider diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ca46964..9b31247 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.avg_load; return 1; }