Re: [PATCH 2/2] Add a thread cpu time implementation to vDSO

From: Eric Dumazet
Date: Mon Dec 12 2011 - 16:27:30 EST


Le lundi 12 dÃcembre 2011 Ã 13:19 -0800, Arun Sharma a Ãcrit :
> On 12/12/11 12:13 PM, Eric Dumazet wrote:
>
> >> +
> >> +struct vcpu_data {
> >> + struct vpercpu_data vpercpu[NR_CPUS];
> >> + unsigned int tsc_khz;
> >> + unsigned int tsc_unstable;
> >> +};
> >
> > Thats a showstopper.
> >
> > Try to compile the thing with NR_CPUS=4096 ?
> >
>
> I get a link time error:
>
> ld: section .data..percpu [0000000001ac2000 -> 0000000001ad48ff]
> overlaps section .vvar [0000000001ac0000 -> 0000000001b0083f]
>
> which I consider better than runtime memory corruption :)
>
> I could add a BUILD_BUG_ON() that tries to catch this earlier in the
> compile process.
>
> Re: Fixing the build for NR_CPUS > 64
>
> How about something along the lines of the following:
>
> From: Arun Sharma <asharma@xxxxxx>
> Date: Mon, 12 Dec 2011 13:13:43 -0800
> Subject: [PATCH] Handle NR_CPUS > 64
>
> ---

This only works if CONFIG_X86_L1_CACHE_SHIFT=6

Some configurations have 128 bytes cache lines

But really most modern distros have NR_CPUS > 64



--
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/