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


Groups > linux.kernel > #1252346

Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer.

Path csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
From Yunhong Jiang <yunhong.jiang@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer.
Date Wed, 21 Oct 2015 01:00:04 +0200
Message-ID <qlO2U-10k-69@gated-at.bofh.it> (permalink)
References <qdLOy-7Vg-11@gated-at.bofh.it> <qitnY-7Pn-11@gated-at.bofh.it>
X-Original-To Thomas Gleixner <tglx@linutronix.de>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.17,709,1437462000"; d="scan'208";a="584889465"
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
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 52
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, viresh.kumar@linaro.org
X-Original-Date Tue, 20 Oct 2015 15:47:51 -0700
X-Original-Message-ID <20151020224751.GB31289@jnakajim-build>
X-Original-References <1443466096-31252-1-git-send-email-yunhong.jiang@linux.intel.com> <alpine.DEB.2.11.1510112010250.6097@nanos>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1252346

Show key headers only | View raw


On Sun, Oct 11, 2015 at 08:12:39PM +0200, Thomas Gleixner wrote:
> On Mon, 28 Sep 2015, Yunhong Jiang wrote:
> >  static void internal_add_timer(struct tvec_base *base, struct timer_list *timer)
> >  {
> > +	bool kick_nohz = false;
> > +
> >  	/* Advance base->jiffies, if the base is empty */
> >  	if (!base->all_timers++)
> >  		base->timer_jiffies = jiffies;
> > @@ -424,9 +426,17 @@ static void internal_add_timer(struct tvec_base *base, struct timer_list *timer)
> >  	 */
> >  	if (!(timer->flags & TIMER_DEFERRABLE)) {
> >  		if (!base->active_timers++ ||
> > -		    time_before(timer->expires, base->next_timer))
> > +		    time_before(timer->expires, base->next_timer)) {
> >  			base->next_timer = timer->expires;
> > -	}
> > +			/*
> > +			 * CPU in dynticks need reevaluate the timer wheel
> > +			 * if newer timer added with next_timer updated.
> > +			 */
> > +			if (base->nohz_active)
> > +				kick_nohz = true;
> > +		}
> > +	} else if (base->nohz_active && tick_nohz_full_cpu(base->cpu))
> > +		kick_nohz = true;
> 
> Why do you want to kick the other cpu when a deferrable timer got added?

This is what happens in current implementation and this patch does not 
change the logic. According to the comments, it's to avoid race with 
idle_cpu(). Frankly speaking, I didn't get the idea of the race.

Viresh, do you have any hints?

Thanks
--jyh

>   
> Thanks,
> 
> 	tglx
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. Yunhong Jiang <yunhong.jiang@linux.intel.com> - 2015-10-21 01:00 +0200
  Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. Viresh Kumar <viresh.kumar@linaro.org> - 2015-10-21 12:50 +0200
    Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. Yunhong Jiang <yunhong.jiang@linux.intel.com> - 2015-10-23 00:00 +0200
      Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. Viresh Kumar <viresh.kumar@linaro.org> - 2015-10-23 04:30 +0200
        Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. Yunhong Jiang <yunhong.jiang@linux.intel.com> - 2015-10-24 00:30 +0200
          Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. Viresh Kumar <viresh.kumar@linaro.org> - 2015-10-24 05:30 +0200
            Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. Yunhong Jiang <yunhong.jiang@linux.intel.com> - 2015-10-26 17:40 +0100
    Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. Frederic Weisbecker <fweisbec@gmail.com> - 2015-10-27 16:20 +0100

csiph-web