From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbbJKSNS (ORCPT ); Sun, 11 Oct 2015 14:13:18 -0400 Received: from www.linutronix.de ([62.245.132.108]:41953 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbbJKSNR (ORCPT ); Sun, 11 Oct 2015 14:13:17 -0400 Date: Sun, 11 Oct 2015 20:12:39 +0200 (CEST) From: Thomas Gleixner To: Yunhong Jiang cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] timer: Lazily wakup nohz CPU when adding new timer. In-Reply-To: <1443466096-31252-1-git-send-email-yunhong.jiang@linux.intel.com> Message-ID: References: <1443466096-31252-1-git-send-email-yunhong.jiang@linux.intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, tglx