From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424933AbcFMQPX (ORCPT ); Mon, 13 Jun 2016 12:15:23 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51440 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1424175AbcFMQPV (ORCPT ); Mon, 13 Jun 2016 12:15:21 -0400 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Mon, 13 Jun 2016 09:15:14 -0700 From: "Paul E. McKenney" To: Thomas Gleixner Cc: LKML , Ingo Molnar , Peter Zijlstra , Eric Dumazet , Frederic Weisbecker , Chris Mason , Arjan van de Ven , rt@linutronix.de Subject: Re: [patch 00/20] timer: Refactor the timer wheel Reply-To: paulmck@linux.vnet.ibm.com References: <20160613070440.950649741@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160613070440.950649741@linutronix.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16061316-0004-0000-0000-00000FAB69EE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16061316-0005-0000-0000-0000761E567C Message-Id: <20160613161514.GA3923@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-13_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606130182 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2016 at 08:40:50AM -0000, Thomas Gleixner wrote: > The current timer wheel has some drawbacks: > > 1) Cascading > > Cascading can be an unbound operation and is completely pointless in most > cases because the vast majority of the timer wheel timers are canceled or > rearmed before expiration. > > 2) No fast lookup of the next expiring timer > > In NOHZ scenarios the first timer soft interrupt after a long NOHZ period > must fast forward the base time to current jiffies. As we have no way to > find the next expiring timer fast, the code loops and increments the base > time by one and checks for expired timers in each step. I've observed loops > lasting 1 ms! > > There are some other issues caused by the above, but they are minor compare to > those. For SMP configurations, this passes light rcutorture testing. For UP builds, it complains about undefined symbols. Builds succeed with the following kneejerk patch. Am retesting rcutorture. Thanx, Paul ------------------------------------------------------------------------ commit 87dbd35cf4034f2b664b6e9d60decd2bdbfc416f Author: Paul E. McKenney Date: Mon Jun 13 09:11:41 2016 -0700 Fix undefined get_nohz_timer_target() in non-SMP builds Signed-off-by: Paul E. McKenney diff --git a/include/linux/sched.h b/include/linux/sched.h index 6e42ada26345..322e52415a29 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -348,6 +348,10 @@ extern int get_nohz_timer_target(void); #else static inline void nohz_balance_enter_idle(int cpu) { } static inline void set_cpu_sd_state_idle(void) { } +static inline int get_nohz_timer_target(void) +{ + return raw_smp_processor_id(); +} #endif /*