From patchwork Thu Dec 20 14:54:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 154339 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6279935ljp; Thu, 20 Dec 2018 06:54:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/U4E2tDnTF1YTjziw8mA6ITFd9YN7RXUcHTP9v76YWRxuaG4jTk+6tPBp4E8YgBSFuuvHo3 X-Received: by 2002:a63:4384:: with SMTP id q126mr23134406pga.160.1545317679654; Thu, 20 Dec 2018 06:54:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545317679; cv=none; d=google.com; s=arc-20160816; b=r32cGwwO6PU3rpkjnU49LX37n5EVX2o40GLwIBuq4PUGF7vKfhn1golidC3plshW6C Hm97mlRGUS6E3WnaRaqxTJRaEerDLysG7ZqQehBu//+2+q4jwh0TW2j8knAt05/WP4vF SadcNAHQZSiXk/XVfUC9rXS0Nm7UCc6CrF9K1kpwX48DGmZJABQXleo7LnVVPmk9M9V+ 3NTq1Wls43Yg/X74MdAprK5GsT0W4C7kYzvq8kymp1Q4pFyy+gPBTOZyrJRos7ywaErf 58SSYQoA8cqqOLmdeorKr7zn5yAOMxrRQpzeXD/68QMd8LECcYGvLA3LlE0lDy0gFgTr ezHw== 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=U6zmW9lsH1Bj7d8pIUCWSJlEBNW74VD5OKfSZ7ZVFaDzdDrozT8SEcjB7YSqme7vf5 ZaD8BBn1rPrnd7obefFhDlK6hyh4F4SeQZEJ9lS0enwPt2bXkARYIsSKkOfDEatUG/x6 qcHoGJ9YyL+V+HWo42lMFXOeYoO269de0yTBkDEhpWrjt+HIP/LWxa1RVQhdnO68oUDQ sbZ9XBgKrWK6pZmyzz7CxRDGfqtDpKH3qIcMzSXghX9ShUy5rYTHb0XaiAkOdAMtQZJq Pca41fKi88gNV2BR2lAPykEUppF9ja19i9G5IcR0IRaLDWJRXdDIcPwwp9h6csFqkWcL pZ5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Iqjwx8o+; 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 cc17si19730857plb.265.2018.12.20.06.54.39; Thu, 20 Dec 2018 06:54:39 -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=Iqjwx8o+; 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 S1730562AbeLTOyi (ORCPT + 31 others); Thu, 20 Dec 2018 09:54:38 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52161 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729217AbeLTOyi (ORCPT ); Thu, 20 Dec 2018 09:54:38 -0500 Received: by mail-wm1-f68.google.com with SMTP id b11so2355058wmj.1 for ; Thu, 20 Dec 2018 06:54:36 -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=Iqjwx8o+MdK/BIDth34Ad0ep1dkGMIQo4l5cJ1CxpXzUu9Vfro1MiOM1ySk615h0Wo a1yfcwPgyQcGiyryN+hPY38b7+JhXKO8nahSpUn97lFvSWm15md/Dx6c6JjcgErPmN3V oHT40nKHZXpaMFnZzZ1aZvTCpsMkQGi2gzY9I= 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=mR9gVY1enOQKUyqHjQwl889ifFmGxiCMvvJcV5x6sEwe/gnNIcwgm6K4e7mdMrXcgZ lVJ5hWEojf4Ge4eFU9nO38SMNydLtZiqi1J26i9RcMC36kuRf+JEGSYoV/7Z9UeQCLoF dIPysZRXvHljn8J7CmLaNKcNX+3xx4TX3sLraHMAECSDXp+JjQii73k7kP+VlDe55ZjU HU9kuhS4VS2oBnAC/SE8gsyAvflKJ0KDEntoBCbHphsWX17DBrG6CgFNw53jzTWaGTHe S4ItsIdgC8seE0NOunA6G+SF7kbl+jMEQRYr7JpP3ZDDAhqUZS3Oo6lXedg6BCNSqC/w bYAQ== X-Gm-Message-State: AA+aEWYjlPETq6vukyBY0i4o3JxZBVmT3KV+1F9JRGEF+nFbwrGXyC4C sWm4Dc9aZmbcYP+WPIT8c/62y4fHSj42KQ== X-Received: by 2002:a1c:c60e:: with SMTP id w14mr12555103wmf.18.1545317676000; Thu, 20 Dec 2018 06:54:36 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:f:6020:f9b3:37c1:b11a:64ce]) by smtp.gmail.com with ESMTPSA id h131sm10118802wmd.17.2018.12.20.06.54.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Dec 2018 06:54:35 -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, 20 Dec 2018 15:54:30 +0100 Message-Id: <1545317670-10490-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545292547-18770-2-git-send-email-vincent.guittot@linaro.org> References: <1545292547-18770-2-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; }