Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 13 Jan 2002 23:37:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 13 Jan 2002 23:37:32 -0500 Received: from [202.135.142.194] ([202.135.142.194]:65035 "EHLO haven.ozlabs.ibm.com") by vger.kernel.org with ESMTP id ; Sun, 13 Jan 2002 23:37:21 -0500 From: Rusty Russell To: Davide Libenzi Cc: Manfred Spraul , mingo@elte.hu, linux-kernel@vger.kernel.org Subject: Re: cross-cpu balancing with the new scheduler In-Reply-To: Your message of "Sun, 13 Jan 2002 18:49:16 -0800." Date: Mon, 14 Jan 2002 15:37:27 +1100 Message-Id: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org In message yo u write: > On Mon, 14 Jan 2002, Rusty Russell wrote: > > > This could be fixed by making "nr_running" closer to a "priority sum". > > I've a very simple phrase when QA is bugging me with these corner cases : > > "As Designed" My point is: it's just a heuristic number. It currently reflects the number on the runqueue, but there's no reason it *has to* (except the name, of course). 1) The nr_running() function can use rq->active->nr_active + rq->expired->nr_active. And anyway it's only as "am I idle?". 2) The test inside schedule() can be replaced by checking the result of the sched_find_first_zero_bit() (I have a patch which does this to good effect, but for other reasons). The other uses of nr_running are all "how long is this runqueue for rebalancing", and Ingo *already* modifies his use of this number, using the "prev_nr_running" hack. Hope that clarifies, Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - 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/