Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262444AbVCJIwu (ORCPT ); Thu, 10 Mar 2005 03:52:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262448AbVCJIwu (ORCPT ); Thu, 10 Mar 2005 03:52:50 -0500 Received: from one.firstfloor.org ([213.235.205.2]:61863 "EHLO one.firstfloor.org") by vger.kernel.org with ESMTP id S262444AbVCJIvY (ORCPT ); Thu, 10 Mar 2005 03:51:24 -0500 To: Zwane Mwaikambo Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Reduce cacheline bouncing in cpu_idle_wait References: From: Andi Kleen Date: Thu, 10 Mar 2005 09:51:22 +0100 In-Reply-To: (Zwane Mwaikambo's message of "Wed, 9 Mar 2005 19:41:35 -0700 (MST)") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) 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: 1104 Lines: 39 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) > + > + for_each_online_cpu(cpu) { > + per_cpu(cpu_idle_state, cpu) = 1; > + cpu_set(cpu, map); > + } -Andi - 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/