[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200812082220.42790.rusty@rustcorp.com.au>
Date: Mon, 8 Dec 2008 22:20:42 +1030
From: Rusty Russell <rusty@...tcorp.com.au>
To: Avi Kivity <avi@...hat.com>
Cc: "kvm-devel" <kvm@...r.kernel.org>, linux-kernel@...r.kernel.org,
Mike Travis <travis@....com>
Subject: Re: [PATCH 2/2] kvm: use cpumask_var_t for cpus_hardware_enabled
On Monday 08 December 2008 20:16:44 Avi Kivity wrote:
> Rusty Russell wrote:
> >> This isn't on stack, so it isn't buying us anything.
> >>
> >
> > It's the CONFIG_NR_CPUS=4096 but nr_cpu_ids=4 case which we win using
> > dynamic allocation. Gotta love distribution kernels.
> >
> >
>
> What does it buy? 4096/8 = 512 bytes statically allocated?
It adds up, and 4096 seems to be only the start of the insanityH^H^Hfun.
> > Not quite. If !CONFIG_CPUMASK_OFFSTACK, cpumask_var_t == cpumask_t[1].
> > Blame Linus :)
> >
>
> Hm, is there a C trick which will error out when allocating something on
> the stack, but work when allocating statically? I can think of
> something to do the reverse, but that doesn't help.
We also need to prevent assignment, eg:
*foo = *bar;
Because when we allocate them, we'll cut them to size.
Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists