Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754777Ab3HRJMk (ORCPT ); Sun, 18 Aug 2013 05:12:40 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:37787 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753397Ab3HRJMj (ORCPT ); Sun, 18 Aug 2013 05:12:39 -0400 MIME-Version: 1.0 In-Reply-To: References: <20130812144309.GK27162@twins.programming.kicks-ass.net> <20130813073842.GP27162@twins.programming.kicks-ass.net> Date: Sun, 18 Aug 2013 17:12:36 +0800 Message-ID: Subject: Re: false nr_running check in load balance? From: Lei Wen To: Paul Turner Cc: Peter Zijlstra , LKML , Ingo Molnar , Lei Wen Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1849 Lines: 55 Paul, On Tue, Aug 13, 2013 at 5:25 PM, Paul Turner wrote: > On Tue, Aug 13, 2013 at 1:18 AM, Lei Wen wrote: >> Hi Paul, >> >> On Tue, Aug 13, 2013 at 4:08 PM, Paul Turner wrote: >>> On Tue, Aug 13, 2013 at 12:38 AM, Peter Zijlstra wrote: >>>> On Tue, Aug 13, 2013 at 12:45:12PM +0800, Lei Wen wrote: >>>>> > Not quite right; I think you need busiest->cfs.h_nr_running. >>>>> > cfs.nr_running is the number of entries running in this 'group'. If >>>>> > you've got nested groups like: >>>>> > >>>>> > 'root' >>>>> > \ >>>>> > 'A' >>>>> > / \ >>>>> > t1 t2 >>>>> > >>>>> > root.nr_running := 1 'A', even though you've got multiple running tasks. >>>>> > >>>>> >>>>> You're absolutely right for this. :) >>>>> I miss it for not considering the group case... >>>>> >>>>> Then do you think it is necessary to do below change in load_balance() code? >>>>> - if (busiest->nr_running > 1) { >>>>> + if (busiest->cfs.h_nr_running > 1) { >>>>> >>>> >>>> Yes I think that would be fine. >>> >>> If we pivot to use h_nr_running we should probably also update >>> call-sites such as cpu_load_avg_per_task() for consistency. >> >> I didn't find cpu_load_avg_per_task in the latest linux git... >> Is it a new patch pending while not being submitted? > > Transposition typo: cpu_avg_load_per_task() > More generally: Most things that examine ->nr_running in the fair > load-balance path. > I see... I have submitted several patches, which covers cpu_avg_load_per_task. Please help to check them. Thanks, Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/