From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933709AbbDUVcR (ORCPT ); Tue, 21 Apr 2015 17:32:17 -0400 Received: from www.linutronix.de ([62.245.132.108]:60344 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932723AbbDUVcP (ORCPT ); Tue, 21 Apr 2015 17:32:15 -0400 Date: Tue, 21 Apr 2015 23:32:23 +0200 (CEST) From: Thomas Gleixner To: viresh kumar cc: Ingo Molnar , Peter Zijlstra , linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Steven Miao , shashim@codeaurora.org Subject: Re: [PATCH 1/2] timer: Avoid waking up an idle-core by migrate running timer In-Reply-To: <5530C086.2020700@linaro.org> Message-ID: References: <80182e47a7103608d2ddab7f62c0c3dffc99fdcc.1427782893.git.viresh.kumar@linaro.org> <5530C086.2020700@linaro.org> 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 Fri, 17 Apr 2015, viresh kumar wrote: > Does this look any better ? Yes, but: > 1.) Should the above list_empty(migration_list) block be added out of the > > while (time_after_eq(jiffies, base->timer_jiffies)) > > block ? So that we check it only once per timer interrupt. That's what I suggested. > Also ->running_timer is set to the last serviced timer and a > del_timer_sync() might be waiting to remove it. But we continue with > the migration list first, without clearing it first. Not sure if this > is important at all.. Of course it is and doing it outside of the loop solves that issue. > 2.) By the time we finish serving all pending timers, local CPU might not be > idle anymore OR the target CPU may become idle. That's another good reason to move that migration list outside of the while loop. > 2.) It might be better to update preferred_target every time we choose a > difference base. This may help us avoid calling get_nohz_timer_target() > in the second if block above. Yuck no. You can do that in that migration code and not add more pointless crap to the normal case. Are you realizing that __mod_timer() is a massive hotpath for network heavy workloads? This stuff needs to be debloated and not mindlessly packed with more corner case features. Thanks, tglx