Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755201AbYG3T0L (ORCPT ); Wed, 30 Jul 2008 15:26:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753487AbYG3TZz (ORCPT ); Wed, 30 Jul 2008 15:25:55 -0400 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:43349 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752243AbYG3TZy (ORCPT ); Wed, 30 Jul 2008 15:25:54 -0400 Message-ID: <4890C03D.6090307@sgi.com> Date: Wed, 30 Jul 2008 12:25:49 -0700 From: Mike Travis User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: Dave Jones , Mike Travis , Ingo Molnar , Rusty Russell , Andrew Morton , "H. Peter Anvin" , Jack Steiner , Christoph Lameter , linux-kernel@vger.kernel.org, Len Brown , Lennert Buytenhek , Paul Jackson , Tony Luck , Tigran Aivazian , Paul Mackerras , Benjamin Herrenschmidt , Robert Richter , Martin Schwidefsky , Heiko Carstens , Sam Creasey , Greg Banks , "Eric W. Biederman" , Adrian Bunk , Thomas Gleixner , Andreas Schwab , Johannes Weiner Subject: Re: [PATCH 1/1] cpumask: Change cpumask_of_cpu to use cpumask_of_cpu_map References: <20080723171841.815234000@polaris-admin.engr.sgi.com> <20080723171841.997896000@polaris-admin.engr.sgi.com> <20080730165539.GA10079@codemonkey.org.uk> <4890A0A8.4000502@sgi.com> <4890B500.7040100@sgi.com> <20080730185003.GA18162@codemonkey.org.uk> In-Reply-To: <20080730185003.GA18162@codemonkey.org.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2575 Lines: 81 Dave Jones wrote: > On Wed, Jul 30, 2008 at 11:37:52AM -0700, Mike Travis wrote: > > > >> I've lost the plot on what's going on with these cpumask patches. > > >> But I just saw this on -rc1. > > >> > > >> arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c:206:33: error: not addressable > > >> arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c:274:32: error: not addressable > > >> arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c:352:34: error: not addressable > > >> > > > > After I recreated linux-next the changes all appear to be there now. > > One problem though, is !SMP config does not build (something about > > DECLARE_BITMAP with NR_CPUS=1.) I wasn't sure how to create a constant > > "(cpumask_t)1" that worked as an lvalue, so the following patch is > > somewhat a kluge, but fulfills the requirements. > > > > If anyone has a better suggestion, please let me know. > > > > Subject: [PATCH] cpmask: add cpumask_of_cpu(0) for non-SMP > > > > * Fix cpumask_of_cpu(0) when CONFIG_SMP is not set by providing a > > pointer to a cpumask_t with cpu 0 bit set. > > confused. I saw the error above with a make allyesconfig, which > sets CONFIG_SMP=y > > Dave > Well now the !SMP error is not there, so my "fixup" patch is not needed. (It might have been because I had a slightly old copy of cpumask.h which had the troublesome statement expression: "({ *get_cpu_mask(cpu); })" in it.) But the errors you were seeing are fixed in the latest linux-next. When I git-fetched, I got the same errors, but when I built a fresh copy of linux-next, the correct code appeared. A quick check... arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c should have: static void drv_write(struct drv_cmd *cmd) { cpumask_t saved_mask = current->cpus_allowed; unsigned int i; for_each_cpu_mask_nr(i, cmd->mask) { set_cpus_allowed_ptr(current, &cpumask_of_cpu(i)); do_drv_write(cmd); } set_cpus_allowed_ptr(current, &saved_mask); return; } instead of: static void drv_write(struct drv_cmd *cmd) { cpumask_t saved_mask = current->cpus_allowed; cpumask_of_cpu_ptr_declare(cpu_mask); unsigned int i; for_each_cpu_mask_nr(i, cmd->mask) { cpumask_of_cpu_ptr_next(cpu_mask, i); set_cpus_allowed_ptr(current, cpu_mask); do_drv_write(cmd); } set_cpus_allowed_ptr(current, &saved_mask); return; } Thanks, Mike -- 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/