Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933301AbcLSX3o (ORCPT ); Mon, 19 Dec 2016 18:29:44 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:36238 "EHLO hera.aquilenet.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932659AbcLSX33 (ORCPT ); Mon, 19 Dec 2016 18:29:29 -0500 Date: Tue, 20 Dec 2016 00:29:26 +0100 From: Samuel Thibault To: Paul Turner Cc: LKML , Peter Zijlstra , Thomas Gleixner , Ingo Molnar Subject: Re: [PATCH] sched/fair: fix calc_cfs_shares fixed point arithmetics Message-ID: <20161219232926.GH2895@var.home> Mail-Followup-To: Samuel Thibault , Paul Turner , LKML , Peter Zijlstra , Thomas Gleixner , Ingo Molnar References: <20161219224014.GA28238@var.home> <20161219230713.GD2895@var.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 633 Lines: 17 Paul Turner, on Mon 19 Dec 2016 15:26:19 -0800, wrote: > >> > - if (shares < MIN_SHARES) > >> > - shares = MIN_SHARES; > > ... > >> > return shares; > > > > This will only make sure that the returned shares is 2, not 2048. > > This is intentional. The MIN_SHARES you are seeing here is overloaded. > Every "1" unit of share is "SCHED_LOAD_RESOLUTION" bits internally. I'm not talking about the SCHED_LOAD_RESOLUTION scaling, but about the SCHED_FIXEDPOINT_SHIFT scaling, which is what 2159197d6677 ("sched/core: Enable increased load resolution on 64-bit kernels") modified on 64bit platforms. Samuel