Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756495AbbGFNeX (ORCPT ); Mon, 6 Jul 2015 09:34:23 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33582 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755868AbbGFNeS (ORCPT ); Mon, 6 Jul 2015 09:34:18 -0400 Date: Mon, 6 Jul 2015 19:04:07 +0530 From: Afzal Mohammed To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH] sched,fair: Remove > u32 weight handling for delta Message-ID: <20150706133407.GA5861@afzalpc> References: <1436150677-1818-1-git-send-email-afzal.mohd.ma@gmail.com> <20150706114430.GE3644@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150706114430.GE3644@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2168 Lines: 57 Hi, On Mon, Jul 06, 2015 at 01:44:30PM +0200, Peter Zijlstra wrote: > On Mon, Jul 06, 2015 at 08:14:37AM +0530, Afzal Mohammed wrote: > > scaled down weight 'fact' would not be > u32 rather than unlikely as the > > values being passed for delta is either NICE_O_LOAD or the weight of the > > 'se' which would be a value that can be accomodated in a u32. > > This needs a bit more on why se->load.weight must fit u32 (its true, but > not evident from this text). Okay, I will add an equivalent of the below to the log, "se->load.weight can have either the values in prio_to_weight[] for cases where 'se' is a task or capped to MAX_SHARES (1 << 18) when it is a group. And these values can be accomodated in a u32.", and send the patch, unless a negative opinion on the above. > Now as long as we never call __calc_delta() on a rq weight -- which is a > sum of weights and can indeed be larger than u32, we can indeed remove > this. My understanding is that we do not call __calc_delta() on rq weight. > And I think we already assume such, see this story on why shift will > remain positive. ok > > The hunk being removed here > > would not make a difference to it as this is on scaled weight > u32. > > And pre-"9dbdb15553239" doesn't seem to have logical equivalent of hunk > > removed here either. > > -ENOPARSE. Reading 9dbdb15553239 ("sched/fair: Rework sched_fair time accounting") again, realized that I am wrong on this, that was referring to the below statement removed in that commit, if (likely(weight > (1UL << SCHED_LOAD_RESOLUTION))) tmp = (u64)delta_exec * scale_load_down(weight); earlier came to a reasoning that as scale_load_down(weight) was not separately typecasted, value above u32 would be discarded, that non parsable statement meant that weight > u32 was not considered. Since cast has precedence over multiply, that statement of mine was wrong. Regards Afzal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/