Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933450AbcLSXcw (ORCPT ); Mon, 19 Dec 2016 18:32:52 -0500 Received: from mail.kernel.org ([198.145.29.136]:45428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932155AbcLSXcu (ORCPT ); Mon, 19 Dec 2016 18:32:50 -0500 MIME-Version: 1.0 In-Reply-To: <20161219232926.GH2895@var.home> References: <20161219224014.GA28238@var.home> <20161219230713.GD2895@var.home> <20161219232926.GH2895@var.home> From: Paul Turner Date: Mon, 19 Dec 2016 15:32:15 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] sched/fair: fix calc_cfs_shares fixed point arithmetics To: Samuel Thibault , Paul Turner , LKML , Peter Zijlstra , Thomas Gleixner , Ingo Molnar Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1104 Lines: 31 On Mon, Dec 19, 2016 at 3:29 PM, Samuel Thibault wrote: > 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. .... From that commit: """ -#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load */ +#ifdef CONFIG_64BIT # define SCHED_LOAD_RESOLUTION 10 # define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION) # define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION) """ Please take a deeper look at the scale_load() interactions.