From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031616AbdDZW1w (ORCPT ); Wed, 26 Apr 2017 18:27:52 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34258 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031595AbdDZW1r (ORCPT ); Wed, 26 Apr 2017 18:27:47 -0400 Date: Wed, 26 Apr 2017 15:27:44 -0700 From: Tejun Heo To: Vincent Guittot Cc: Ingo Molnar , Peter Zijlstra , linux-kernel , Linus Torvalds , Mike Galbraith , Paul Turner , Chris Mason , kernel-team@fb.com Subject: Re: [PATCH 1/2] sched/fair: Fix how load gets propagated from cfs_rq to its sched_entity Message-ID: <20170426222744.GA9616@wtj.duckdns.org> References: <20170424201344.GA14169@wtj.duckdns.org> <20170424201415.GB14169@wtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Vincent. On Wed, Apr 26, 2017 at 06:14:17PM +0200, Vincent Guittot wrote: > > + if (gcfs_rq->load.weight) { > > + long shares = calc_cfs_shares(gcfs_rq, gcfs_rq->tg); > > > > + load = min(gcfs_rq->runnable_load_avg * > > + shares / gcfs_rq->load.weight, shares); > > There is a unit problem above: > runnable_load_avg and shares are not in the same range but > runnable_load_avg and scale_load_down(gcfs_rq->load.weight) are so > you should use > gcfs_rq->runnable_load_avg * scale_load_down(shares) / > scale_load_down(gcfs_rq->load.weight). But the only difference there is that we lose accuracy in calculation; otherwise, the end results are the same, no? > Hopefully both scale_load_down cancel between them > But the min should be then tested with scale_load_down(shares) and not > only shares Ah, that's right. The min should be against scaled down shares. Thanks. -- tejun