Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262646AbVCJOdn (ORCPT ); Thu, 10 Mar 2005 09:33:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262645AbVCJOdn (ORCPT ); Thu, 10 Mar 2005 09:33:43 -0500 Received: from 70-56-134-246.albq.qwest.net ([70.56.134.246]:20682 "EHLO montezuma.fsmlabs.com") by vger.kernel.org with ESMTP id S262646AbVCJOdB (ORCPT ); Thu, 10 Mar 2005 09:33:01 -0500 Date: Thu, 10 Mar 2005 07:33:50 -0700 (MST) From: Zwane Mwaikambo To: Andi Kleen cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Reduce cacheline bouncing in cpu_idle_wait In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1163 Lines: 34 On Thu, 10 Mar 2005, Andi Kleen wrote: > Zwane Mwaikambo writes: > > > Andi noted that during normal runtime cpu_idle_map is bounced around a > > lot, and occassionally at a higher frequency than the timer interrupt > > wakeup which we normally exit pm_idle from. So switch to a percpu > > variable. Andi i didn't move things to the slow path because it would > > involve adding scheduler code to wakeup the idle thread on the cpus we're > > waiting for. > > Thanks. > > > > - > > void cpu_idle_wait(void) > > { > > - int cpu; > > - cpumask_t map; > > + unsigned int cpu, this_cpu = get_cpu(); > > + cpumask_t map; > > + > > + set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); > > + put_cpu(); > > You need a cpus_clear(map); here I think (probably same for the other > archs) A bit subtle, the cpus_and will clear the offline processors after the first pass. - 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/