Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936203AbdCVT3o (ORCPT ); Wed, 22 Mar 2017 15:29:44 -0400 Received: from mail-vk0-f46.google.com ([209.85.213.46]:34189 "EHLO mail-vk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934716AbdCVT2N (ORCPT ); Wed, 22 Mar 2017 15:28:13 -0400 MIME-Version: 1.0 In-Reply-To: <20170322175541.culjydvydyzy4dza@hirez.programming.kicks-ass.net> References: <20170310204743.12872-1-joelaf@google.com> <20170322141808.icah4ygikteqbqdo@hirez.programming.kicks-ass.net> <20170322175541.culjydvydyzy4dza@hirez.programming.kicks-ass.net> From: Joel Fernandes Date: Wed, 22 Mar 2017 12:28:01 -0700 Message-ID: Subject: Re: [PATCH] sched: write better comments for weight calculations To: Peter Zijlstra Cc: LKML , Juri Lelli , Patrick Bellasi , Dietmar Eggemann , 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: 1706 Lines: 43 On Wed, Mar 22, 2017 at 10:55 AM, Peter Zijlstra wrote: > On Wed, Mar 22, 2017 at 09:25:02AM -0700, Joel Fernandes wrote: >> On Wed, Mar 22, 2017 at 7:18 AM, Peter Zijlstra wrote: >> > On Fri, Mar 10, 2017 at 12:47:43PM -0800, Joel Fernandes wrote: >> >> This patch rewrites comments related task priorities and CPU usage >> >> along with an example to show how it works. >> > >> > To what purpose? Bigger word count? >> >> The intention is to improve the comments to make it more >> understandable (the weight calculations, factor of 1.25 etc). >> >> On reading through the comments the first time, I felt they could be >> improved. Is your concern more about the addition of an example >> increasing the word-count? Perhaps you'd rather this be added to >> Documentation/ instead? > > It might just be verbiage; I sometimes have trouble condensing text. > That is; some people need repetition, I get stuck trying to figure out > if its saying the same or not. > > In any case; if you want to clarify where the 1.25 comes from, maybe do > an abstract example, instead of an explicit one? > > -10% = .9, +10% = 1.1 -> 1.1/.9 = 1.(2) ~ 1.25 > > Or, starting with the weight thing: > > .45 = wa / (wa+wb) -> .45 (wa+wb) = wa -> > .45wa + .45wb = wa -> > .45wb = .55wa -> > wb/wa = .55/.45 = 1.(2) ~ 1.25 > > That's actually simpler to follow no? > > Now IIRC the whole thing is backwards anyway, we started with 1.25 and > got the ~10% from there. Yes we could condense it further and explain it without using an explicit example. I will work on a better patch along these lines. Thanks, Joel