Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626000

Re: [patch V2 08/10] timer: Implement the hierarchical pull model

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [patch V2 08/10] timer: Implement the hierarchical pull model
Date Wed, 19 Apr 2017 12:30:02 +0200
Message-ID <txV22-2h2-11@gated-at.bofh.it> (permalink)
References <txEue-8r4-5@gated-at.bofh.it> <txEuf-8r4-41@gated-at.bofh.it>
X-Original-To Thomas Gleixner <tglx@linutronix.de>
Dkim-Signature v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pve9dKqV6ZTtQ74zvExMP8L45pgk0eDls8WUR+qmFYI=; b=OQwjDU14t7wV1PT4RfdiDjO6B 2Ytk3Ak2gSgtXjj3KOiFJCbY7cSkXC+W/A+8xj6TRJHJUka5EdrhRM0qwYgbUHUw6Ka2xOuBVSYte fRSC/AQpspCw1UVJaFhgK10CS377Gr7wx2FMvcTgZlDChelQu9i05vAtPK7t1an1ObMG1YWS5GiNs 18Q0B0x1tSL6ajsTk8qFLka0iYrqliP1EGcNX0xhDHR/NZuInaR5bAm6tfseCc6LTHUNfRe//sVMx HIRm6zbKKyZH61Tg4wVlntg0t5WoZqKYJMEVc0JK7xKO4eVSC2Ex1YcYLFwysWhjHi4TbKXz1No9f S2Q4OliNQ==;
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent NeoMutt/20170113 (1.7.2)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 73
Organization linux.* mail to news gateway
X-Original-Cc LKML <linux-kernel@vger.kernel.org>, John Stultz <john.stultz@linaro.org>, Eric Dumazet <edumazet@google.com>, Anna-Maria Gleixner <anna-maria@linutronix.de>, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>, linux-pm@vger.kernel.org, Arjan van de Ven <arjan@infradead.org>, "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>, Frederic Weisbecker <fweisbec@gmail.com>, Rik van Riel <riel@redhat.com>
X-Original-Date Wed, 19 Apr 2017 12:22:59 +0200
X-Original-Message-ID <20170419102259.lkmvpcbd3mpkoi4r@hirez.programming.kicks-ass.net>
X-Original-References <20170418111102.490432548@linutronix.de> <20170418111401.016420305@linutronix.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1626000

Show key headers only | View raw


On Tue, Apr 18, 2017 at 01:11:10PM +0200, Thomas Gleixner wrote:
> +static u64 tmigr_set_cpu_inactive(struct tmigr_group *group,
> +				  struct tmigr_group *child,
> +				  struct tmigr_event *evt,
> +				  unsigned int cpu)
> +{
> +	struct tmigr_group *parent;
> +	u64 nextevt = KTIME_MAX;
> +
> +	raw_spin_lock_nested(&group->lock, group->level);
> +
> +	DBG_BUG_ON(!group->active);
> +
> +	cpumask_clear_cpu(cpu, group->cpus);
> +	group->active--;
> +
> +	/*
> +	 * If @child is not NULL, then this is a recursive invocation to
> +	 * propagate the deactivation of @cpu. If @child has a new migrator
> +	 * set it active in @group.
> +	 */
> +	if (child && child->migrator != TMIGR_NONE) {
> +		cpumask_set_cpu(child->migrator, group->cpus);
> +		group->active++;

And I'm confused...

If we retain child->migrator as 'active', should we then not also re-set
our own bit for that child group?

> +	}
> +
> +	/* Add @evt to @group */
> +	tmigr_add_evt(group, evt);
> +
> +	/* If @cpu is not the active migrator, everything is up to date */
> +	if (group->migrator != cpu)
> +		goto done;

At this point we have already cleared @cpu's bit in our group->cpus. Is
that right?

> +	/* Update the migrator. */
> +	if (!group->active)
> +		group->migrator = TMIGR_NONE;
> +	else
> +		group->migrator = cpumask_first(group->cpus);

So here we could have changed ->migrator away from @cpu, no?

> +
> +	parent = group->parent;
> +	if (parent) {
> +		/*
> +		 * @cpu was the migrator in @group, so it is marked as
> +		 * active in its parent group(s) as well. Propagate the
> +		 * migrator change.
> +		 */

So how is that then still valid? Because this seems to hinge on the
assumption that @cpu is the migrator.

> +		evt = group->active ? NULL : &group->groupevt;
> +		nextevt = tmigr_set_cpu_inactive(parent, group, evt, cpu);



In general I'm a wee bit confused on how this works. Do we at all times
retain a migrator per group, or only one per group that has activity,
which then reduces to 1 per system when the whole system idles.

I'll stare at this a bit more, but I feel a comment explaining things
wouldn't go amiss.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[patch V2 00/10] timer: Move from a push remote at enqueue to a pull  at expiry model Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 18:50 +0200
  [patch V2 06/10] timer: Restructure internal locking Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 18:50 +0200
    Re: [patch V2 06/10] timer: Restructure internal locking Peter Zijlstra <peterz@infradead.org> - 2017-04-19 09:10 +0200
  [patch V2 10/10] timer: Always queue timers on the local CPU Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 18:50 +0200
  [patch V2 07/10] tick/sched: Split out jiffies update helper function Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 18:50 +0200
  [patch V2 08/10] timer: Implement the hierarchical pull model Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 18:50 +0200
    Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 09:30 +0200
    Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 09:30 +0200
    Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 09:40 +0200
    Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 09:40 +0200
    Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 10:20 +0200
      Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 10:40 +0200
        Re: [patch V2 08/10] timer: Implement the hierarchical pull model Thomas Gleixner <tglx@linutronix.de> - 2017-04-19 11:10 +0200
      Re: [patch V2 08/10] timer: Implement the hierarchical pull model Thomas Gleixner <tglx@linutronix.de> - 2017-04-19 10:40 +0200
    Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 11:00 +0200
    Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 11:10 +0200
      Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 11:50 +0200
        Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 12:00 +0200
      Re: [patch V2 08/10] timer: Implement the hierarchical pull model Thomas Gleixner <tglx@linutronix.de> - 2017-04-19 11:50 +0200
        Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 12:00 +0200
    Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 11:30 +0200
    Re: [patch V2 08/10] timer: Implement the hierarchical pull model Peter Zijlstra <peterz@infradead.org> - 2017-04-19 12:30 +0200
  [patch V2 05/10] timer: Retrieve next expiry of pinned/non-pinned  timers seperately Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 18:50 +0200
    Re: [patch V2 05/10] timer: Retrieve next expiry of  pinned/non-pinned timers seperately Peter Zijlstra <peterz@infradead.org> - 2017-04-19 09:10 +0200
      Re: [patch V2 05/10] timer: Retrieve next expiry of pinned/non-pinned  timers seperately Thomas Gleixner <tglx@linutronix.de> - 2017-04-19 12:00 +0200
  [patch V2 04/10] timer: Keep the pinned timers separate from the  others Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 18:50 +0200
  Re: [patch V2 00/10] timer: Move from a push remote at enqueue to a  pull at expiry model "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-04-21 21:30 +0200

csiph-web