From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754666Ab1EBBTv (ORCPT ); Sun, 1 May 2011 21:19:51 -0400 Received: from smtp-out.google.com ([216.239.44.51]:54511 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754303Ab1EBBTn (ORCPT ); Sun, 1 May 2011 21:19:43 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=m63N4214atfS2IX4PUx8/MmCwC18DpoWLLPd16oZyI3und2mLGnaC9Yz594pqsKWT DQv9PO2RZLfkEhRitw4ng== From: Nikhil Rao To: Ingo Molnar , Peter Zijlstra , Mike Galbraith Cc: linux-kernel@vger.kernel.org, "Nikunj A. Dadhania" , Srivatsa Vaddagiri , Stephan Barwolf , Nikhil Rao Subject: [PATCH v1 03/19] sched: use u64 for load_weight fields Date: Sun, 1 May 2011 18:19:01 -0700 Message-Id: <1304299157-25769-4-git-send-email-ncrao@google.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1304299157-25769-1-git-send-email-ncrao@google.com> References: <1304299157-25769-1-git-send-email-ncrao@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch converts load_weight fields to use u64 instead of unsigned long. This is effectively a no-op for 64-bit where unsigned long is 64-bit wide anyway. On 32-bit architectures, it is required to ensure the rq load weight does not overflow in the presence of multiple large weight entities. Also increase MAX_SHARES to 2^28 (from 2^18). Signed-off-by: Nikhil Rao --- include/linux/sched.h | 2 +- kernel/sched_debug.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index d2c3bab..6d88be1 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1104,7 +1104,7 @@ struct sched_class { }; struct load_weight { - unsigned long weight, inv_weight; + u64 weight, inv_weight; }; #ifdef CONFIG_SCHEDSTATS diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c index 7bacd83..d22b666 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched_debug.c @@ -201,7 +201,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) SEQ_printf(m, " .%-30s: %d\n", "nr_spread_over", cfs_rq->nr_spread_over); SEQ_printf(m, " .%-30s: %ld\n", "nr_running", cfs_rq->nr_running); - SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight); + SEQ_printf(m, " .%-30s: %lld\n", "load", cfs_rq->load.weight); #ifdef CONFIG_FAIR_GROUP_SCHED #ifdef CONFIG_SMP SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "load_avg", @@ -264,7 +264,7 @@ static void print_cpu(struct seq_file *m, int cpu) SEQ_printf(m, " .%-30s: %Ld.%06ld\n", #x, SPLIT_NS(rq->x)) P(nr_running); - SEQ_printf(m, " .%-30s: %lu\n", "load", + SEQ_printf(m, " .%-30s: %llu\n", "load", rq->load.weight); P(nr_switches); P(nr_load_updates); -- 1.7.3.1