Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753821Ab3FGJHe (ORCPT ); Fri, 7 Jun 2013 05:07:34 -0400 Received: from mail-ob0-f182.google.com ([209.85.214.182]:58741 "EHLO mail-ob0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751391Ab3FGJH2 (ORCPT ); Fri, 7 Jun 2013 05:07:28 -0400 MIME-Version: 1.0 In-Reply-To: <1370590169-24804-2-git-send-email-alex.shi@intel.com> References: <1370590169-24804-1-git-send-email-alex.shi@intel.com> <1370590169-24804-2-git-send-email-alex.shi@intel.com> Date: Fri, 7 Jun 2013 11:07:28 +0200 Message-ID: Subject: Re: [RFC patch 1/4] sched: change cfs_rq load avg to unsigned long From: Vincent Guittot To: Alex Shi Cc: "mingo@redhat.com" , Peter Zijlstra , Thomas Gleixner , Andrew Morton , Borislav Petkov , Paul Turner , Namhyung Kim , Mike Galbraith , Morten Rasmussen , Preeti U Murthy , Viresh Kumar , linux-kernel , Mel Gorman , riel@redhat.com, Michael Wang , Jason Low Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2387 Lines: 59 On 7 June 2013 09:29, Alex Shi wrote: > Since the 'u64 runnable_load_avg, blocked_load_avg' in cfs_rq struct are > smaller than 'unsigned long' cfs_rq->load.weight. We don't need u64 > vaiables to describe them. unsigned long is more efficient and convenience. > Hi Alex, I just want to point out that we can't have more than 48388 tasks with highest priority on a runqueue with an unsigned long on a 32 bits system. I don't know if we can reach such kind of limit on a 32bits machine ? For sure, not on an embedded system. Regards, Vincent > Signed-off-by: Alex Shi > --- > kernel/sched/debug.c | 4 ++-- > kernel/sched/sched.h | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c > index 75024a6..160afdc 100644 > --- a/kernel/sched/debug.c > +++ b/kernel/sched/debug.c > @@ -211,9 +211,9 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) > SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight); > #ifdef CONFIG_FAIR_GROUP_SCHED > #ifdef CONFIG_SMP > - SEQ_printf(m, " .%-30s: %lld\n", "runnable_load_avg", > + SEQ_printf(m, " .%-30s: %ld\n", "runnable_load_avg", > cfs_rq->runnable_load_avg); > - SEQ_printf(m, " .%-30s: %lld\n", "blocked_load_avg", > + SEQ_printf(m, " .%-30s: %ld\n", "blocked_load_avg", > cfs_rq->blocked_load_avg); > SEQ_printf(m, " .%-30s: %lld\n", "tg_load_avg", > (unsigned long long)atomic64_read(&cfs_rq->tg->load_avg)); > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > index 8bc66c6..5a80943 100644 > --- a/kernel/sched/sched.h > +++ b/kernel/sched/sched.h > @@ -277,7 +277,7 @@ struct cfs_rq { > * This allows for the description of both thread and group usage (in > * the FAIR_GROUP_SCHED case). > */ > - u64 runnable_load_avg, blocked_load_avg; > + unsigned long runnable_load_avg, blocked_load_avg; > atomic64_t decay_counter, removed_load; > u64 last_decay; > > -- > 1.7.12 > -- 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/