Re: [PATCH] rudimentary tracing for Classic RCU

From: Paul E. McKenney
Date: Fri Oct 10 2008 - 07:48:25 EST


On Thu, Oct 09, 2008 at 03:05:57PM +0800, Lai Jiangshan wrote:
> Andi Kleen wrote:
> >> In this case, why not define it as:
> >> static char buf[20*NR_CPUS + 100];
> >
> > Actually you should near never use NR_CPUS now but always num_possible_cpus()
> > (or even num_online_cpus()) Using NR_CPUS can lead to extreme waste
> > of memory on kernels which are compiled for 4096 CPUs for example.
> >
> > And with num_possible_cpus() kmalloc is needed.
> >
> > -Andi
>
> I thought the default value of NR_CPUS is 32.
>
> if NR_CPUS is too large, I think using seq_file is good idea,
> and rcuclassic_trace_mutex is not need too.

I never have used seq_file, to be honest. I would welcome a patch from
you applying it to my rcucb and rcudata patch set.

Thanx, Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/