From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934579AbbDWMpx (ORCPT ); Thu, 23 Apr 2015 08:45:53 -0400 Received: from www.linutronix.de ([62.245.132.108]:37422 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753910AbbDWMpv (ORCPT ); Thu, 23 Apr 2015 08:45:51 -0400 Date: Thu, 23 Apr 2015 14:45:56 +0200 (CEST) From: Thomas Gleixner To: Eric Dumazet cc: Peter Zijlstra , viresh kumar , Ingo Molnar , linaro-kernel@lists.linaro.org, LKML , Steven Miao , shashim@codeaurora.org, Frederic Weisbecker , "Paul E. McKenney" , cl@kernel.org Subject: Re: [PATCH 1/2] timer: Avoid waking up an idle-core by migrate running timer In-Reply-To: <1429772251.22254.35.camel@edumazet-glaptop2.roam.corp.google.com> Message-ID: References: <80182e47a7103608d2ddab7f62c0c3dffc99fdcc.1427782893.git.viresh.kumar@linaro.org> <5530C086.2020700@linaro.org> <1429653295.18561.16.camel@edumazet-glaptop2.roam.corp.google.com> <20150422152940.GC3007@worktop.Skamania.guest> <1429718577.18561.103.camel@edumazet-glaptop2.roam.corp.google.com> <1429732743.18561.134.camel@edumazet-glaptop2.roam.corp.google.com> <1429772251.22254.35.camel@edumazet-glaptop2.roam.corp.google.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 Wed, 22 Apr 2015, Eric Dumazet wrote: > On Wed, 2015-04-22 at 23:56 +0200, Thomas Gleixner wrote: > > > -int get_nohz_timer_target(int pinned) > > +int get_nohz_timer_target(void) > > { > > - int cpu = smp_processor_id(); > > - int i; > > + int i, cpu = smp_processor_id(); > > struct sched_domain *sd; > > > > - if (pinned || !get_sysctl_timer_migration() || !idle_cpu(cpu)) > > + if (!idle_cpu(cpu)) > > return cpu; > > Maybe also test in_serving_softirq() ? > > if (in_serving_softirq() || !idle_cpu(cpu)) > return cpu; > > There is a fundamental problem with networking load : Many cpus appear > to be idle from scheduler perspective because no user/kernel task is running. > > CPUs servicing NIC queues can be very busy handling thousands of packets > per second, yet have no user/kernel task running. > > idle_cpu() return code is : this cpu is idle. hmmmm, really ? > > cpus are busy, *and* have to access alien data/locks to activate timers > that hardly fire anyway. > > When idle_cpu() finally gives the right indication, it is too late : > ksoftirqd might be running on the wrong cpu. Innocent cpus, overwhelmed > by a sudden timer load and locked into a service loop. > > This cannot resist to a DOS, and even with non malicious traffic, the > overhead is high. You definitely have a point from the high throughput networking perspective. Though in a power optimizing scenario with minimal network traffic this might be the wrong decision. We have to gather data from the power maniacs whether this matters or not. The FULL_NO_HZ camp might be pretty unhappy about the above. Thanks, tglx