From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756421AbZFTPtV (ORCPT ); Sat, 20 Jun 2009 11:49:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753328AbZFTPtN (ORCPT ); Sat, 20 Jun 2009 11:49:13 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:52063 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753301AbZFTPtM (ORCPT ); Sat, 20 Jun 2009 11:49:12 -0400 Date: Sat, 20 Jun 2009 17:48:57 +0200 From: Ingo Molnar To: Lai Jiangshan Cc: Zhaolei , Thomas Gleixner , Peter Zijlstra , Mathieu Desnoyers , Steven Rostedt , linux-kernel@vger.kernel.org, fweisbec@gmail.com, Li Zefan , Xiao Guangrong , Andrew Morton Subject: Re: [PATCH RFC] softirq: fix ksoftirq starved Message-ID: <20090620154857.GB12901@elte.hu> References: <4A0BF82A.2070208@cn.fujitsu.com> <20090514124013.GC21241@Krystal> <4A0CCB2E.10202@cn.fujitsu.com> <6A70E08D65F749FA92475F8BA1F9510D@zhaoleiwin> <20090519082435.GB15286@elte.hu> <4A31BF1D.1050400@cn.fujitsu.com> <4A32251C.8060001@cn.fujitsu.com> <20090617145333.GD6846@elte.hu> <4A39B25C.2040801@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A39B25C.2040801@cn.fujitsu.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Lai Jiangshan wrote: > Ingo Molnar wrote: > > * Lai Jiangshan wrote: > > > >> --- a/kernel/sched.c > >> +++ b/kernel/sched.c > >> @@ -5307,6 +5307,7 @@ need_resched: > >> release_kernel_lock(prev); > >> need_resched_nonpreemptible: > >> > >> + schedule_softirq_check(); > >> schedule_debug(prev); > > > > hm, this slows down the scheduler fast-path ... > > > > Ingo > > > > > > It's true. But: > > The overheads are: > > Overhead-A: the function call statement "schedule_softirq_check();" > It can be gotten rid off by a macro or inline function. > > Overhead-B: __get_cpu_var() and the test statement. > > Overhead-C: do_softirq() > In my patch, we test a variable and then call do_softirq() when > the variable is true. do_softirq() can be called from process > context or from schedule() or by any other ways, but it must be > called and avoids starvation in this condition. > So we need pay this overhead. It is no worse than before. > > Is it a critical thing when it slows down the scheduler fast-path > because of the "Overhead-B"? > > Or I misunderstand something? The thing is that _any_ extra instruction in the scheduler fast-path should be avoided. I dont think it can be claimed that this problem can only be solved that way. Ingo