[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170419095220.wvvkllzbvl4hxkvw@hirez.programming.kicks-ass.net>
Date: Wed, 19 Apr 2017 11:52:20 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
John Stultz <john.stultz@...aro.org>,
Eric Dumazet <edumazet@...gle.com>,
Anna-Maria Gleixner <anna-maria@...utronix.de>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
linux-pm@...r.kernel.org, Arjan van de Ven <arjan@...radead.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Rik van Riel <riel@...hat.com>
Subject: Re: [patch V2 08/10] timer: Implement the hierarchical pull model
On Wed, Apr 19, 2017 at 11:43:01AM +0200, Thomas Gleixner wrote:
> On Wed, 19 Apr 2017, Peter Zijlstra wrote:
> > > +done:
> > > + raw_spin_unlock(&group->lock);
> > > + return nextevt;
> > > +}
> >
> > Would it be very onerous to rewrite that into regular loops? That avoids
> > us having to think (and worry) about blowing our stack.
>
> The issue is that this is walking a hierarchy tree (limited depth) and not
> a list of groups at a particular level.
>
> In an earlier version we checked the stack usage and it was ~128 bytes per
> nest level. With 32k CPUs this ends up with maximum 5 recursions, i.e. 640
> bytes. I recheck with the current implementation.
The fact that you have to check (and it varies by compiler version) is
the tedious point. If any of those functions grows their stack
footprint over time, this again changes.
I find it easiest to entirely avoid recursion and safe ourselves this
head-ache.
Powered by blists - more mailing lists