linux-kernel-test/arch/x86/kernel/cpu
Mike Travis 65c0118453 cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr
* This patch replaces the dangerous lvalue version of cpumask_of_cpu
    with new cpumask_of_cpu_ptr macros.  These are patterned after the
    node_to_cpumask_ptr macros.

    In general terms, if there is a cpumask_of_cpu_map[] then a pointer to
    the cpumask_of_cpu_map[cpu] entry is used.  The cpumask_of_cpu_map
    is provided when there is a large NR_CPUS count, reducing
    greatly the amount of code generated and stack space used for
    cpumask_of_cpu().  The pointer to the cpumask_t value is needed for
    calling set_cpus_allowed_ptr() to reduce the amount of stack space
    needed to pass the cpumask_t value.

    If there isn't a cpumask_of_cpu_map[], then a temporary variable is
    declared and filled in with value from cpumask_of_cpu(cpu) as well as
    a pointer variable pointing to this temporary variable.  Afterwards,
    the pointer is used to reference the cpumask value.  The compiler
    will optimize out the extra dereference through the pointer as well
    as the stack space used for the pointer, resulting in identical code.

    A good example of the orthogonal usages is in net/sunrpc/svc.c:

	case SVC_POOL_PERCPU:
	{
		unsigned int cpu = m->pool_to[pidx];
		cpumask_of_cpu_ptr(cpumask, cpu);

		*oldmask = current->cpus_allowed;
		set_cpus_allowed_ptr(current, cpumask);
		return 1;
	}
	case SVC_POOL_PERNODE:
	{
		unsigned int node = m->pool_to[pidx];
		node_to_cpumask_ptr(nodecpumask, node);

		*oldmask = current->cpus_allowed;
		set_cpus_allowed_ptr(current, nodecpumask);
		return 1;
	}

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-18 22:02:57 +02:00
..
cpufreq cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr 2008-07-18 22:02:57 +02:00
mcheck Merge branch 'linus' into cpus4096 2008-07-16 00:29:07 +02:00
mtrr Merge branch 'generic-ipi' into generic-ipi-for-linus 2008-07-15 21:55:59 +02:00
addon_cpuid_features.c x86: PAT: fixed checkpatch errors (and whitespaces) 2008-06-12 10:14:24 +02:00
amd_64.c x86: max_low_pfn_mapped fix, #2 2008-07-13 08:19:16 +02:00
amd.c x86: Move PCI IO ECS code to x86/pci 2008-07-08 07:47:39 +02:00
bugs_64.c x86: move bugs_64.c to cpu/bugs_64.c 2008-06-03 14:43:00 -07:00
bugs.c x86: janitor work in bugs.c 2008-05-25 08:58:34 +02:00
centaur_64.c x86: get x86_phys_bits early 2008-07-14 09:24:16 +02:00
centaur.c x86: clean up cpu capabilities accesses, centaur.c 2008-04-17 17:40:51 +02:00
common_64.c x86: get x86_phys_bits early 2008-07-14 09:24:16 +02:00
common.c x86: change identify_cpu to static 2008-07-08 12:48:35 +02:00
cpu.h x86: make 64-bit identify_cpu use cpu_dev 2008-07-08 07:47:39 +02:00
cyrix.c x86: clean up cpu capabilities accesses, cyrix.c 2008-04-17 17:40:51 +02:00
feature_names.c x86: arch/x86/kernel/cpu/feature_names.c - use angle brackets for include 2008-04-17 17:40:57 +02:00
intel_64.c x86: get x86_phys_bits early 2008-07-14 09:24:16 +02:00
intel_cacheinfo.c cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr 2008-07-18 22:02:57 +02:00
intel.c x86: fix numaq_tsc_disable calling 2008-07-13 08:19:45 +02:00
Makefile x86: seperate funcs from setup_64 to cpu common_64.c 2008-07-08 12:48:34 +02:00
perfctr-watchdog.c Merge branch 'generic-ipi' into generic-ipi-for-linus 2008-07-15 21:55:59 +02:00
proc.c arch: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:14:49 -04:00
transmeta.c x86: clean up cpu capabilities accesses, transmeta.c 2008-04-17 17:40:51 +02:00
umc.c x86: coding style fixes to arch/x86/kernel/cpu/umc.c 2008-04-17 17:40:49 +02:00