[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150328114138.GI27490@worktop.programming.kicks-ass.net>
Date: Sat, 28 Mar 2015 12:41:38 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Christoph Lameter <cl@...ux.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Linaro Kernel Mailman List <linaro-kernel@...ts.linaro.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
vinmenon@...eaurora.org, shashim@...eaurora.org,
Michal Hocko <mhocko@...e.cz>, Mel Gorman <mgorman@...e.de>,
dave@...olabs.net, Konstantin Khlebnikov <koct9i@...il.com>,
Linux Memory Management List <linux-mm@...ck.org>,
Suresh Siddha <suresh.b.siddha@...el.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [RFC] vmstat: Avoid waking up idle-cpu to service shepherd work
On Sat, Mar 28, 2015 at 09:58:38AM +0530, Viresh Kumar wrote:
> On 27 March 2015 at 17:32, Peter Zijlstra <peterz@...radead.org> wrote:
> > What's not clear to me is why that thing is allocated at all, AFAICT
> > something like:
> >
> > static DEFINE_PER_CPU(struct tvec_base, tvec_bases);
> >
> > Should do the right thing and be much simpler.
>
> Does this comment from timers.c answers your query ?
>
> /*
> * This is for the boot CPU - we use compile-time
> * static initialisation because per-cpu memory isn't
> * ready yet and because the memory allocators are not
> * initialised either.
> */
No. The reason is because __TIMER_INITIALIZER() needs to set ->base to a
valid pointer and we cannot get a compile time pointer to per-cpu
entries because we don't know where we'll map the section, even for the
boot cpu.
This in turn means we need that boot_tvec_bases thing.
Now the reason we need to set ->base to a valid pointer is because we've
made NULL special.
Arguably we could create another special pointer, but since that's init
time only we get to add code for that will 'never' be used, more special
cases.
Its all a bit of a bother, but it makes sense.
--
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