From: Mike Travis <travis@sgi.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH 12/12] cpumask: Cleanup more uses of CPU_MASK and NODE_MASK
Date: Fri, 04 Apr 2008 18:11:12 -0700 [thread overview]
Message-ID: <20080405011102.807056000@polaris-admin.engr.sgi.com> (raw)
In-Reply-To: <20080405011100.720014000@polaris-admin.engr.sgi.com>
[-- Attachment #1: use-CPUMASK_ALL_PTR --]
[-- Type: text/plain, Size: 2339 bytes --]
* Replace usages of CPU_MASK_NONE, CPU_MASK_ALL, NODE_MASK_NONE,
NODE_MASK_ALL to reduce stack requirements for large NR_CPUS
and MAXNODES counts.
* In some cases, the cpumask variable was initialized but then overwritten
with another value. This is the case for changes like this:
- cpumask_t oldmask = CPU_MASK_ALL;
+ cpumask_t oldmask;
Based on:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+ x86/latest .../x86/linux-2.6-x86.git
+ sched-devel/latest .../mingo/linux-2.6-sched-devel.git
Signed-off-by: Mike Travis <travis@sgi.com>
---
arch/x86/kernel/genapic_flat_64.c | 4 +++-
arch/x86/kernel/io_apic_64.c | 2 +-
kernel/irq/chip.c | 2 +-
mm/allocpercpu.c | 3 ++-
4 files changed, 7 insertions(+), 4 deletions(-)
--- linux-2.6.x86.orig/arch/x86/kernel/genapic_flat_64.c
+++ linux-2.6.x86/arch/x86/kernel/genapic_flat_64.c
@@ -138,7 +138,9 @@ static cpumask_t physflat_target_cpus(vo
static cpumask_t physflat_vector_allocation_domain(int cpu)
{
- cpumask_t domain = CPU_MASK_NONE;
+ cpumask_t domain;
+
+ cpus_clear(domain);
cpu_set(cpu, domain);
return domain;
}
--- linux-2.6.x86.orig/arch/x86/kernel/io_apic_64.c
+++ linux-2.6.x86/arch/x86/kernel/io_apic_64.c
@@ -772,7 +772,7 @@ static void __clear_irq_vector(int irq)
per_cpu(vector_irq, cpu)[vector] = -1;
cfg->vector = 0;
- cfg->domain = CPU_MASK_NONE;
+ cpus_clear(cfg->domain);
}
void __setup_vector_irq(int cpu)
--- linux-2.6.x86.orig/kernel/irq/chip.c
+++ linux-2.6.x86/kernel/irq/chip.c
@@ -47,7 +47,7 @@ void dynamic_irq_init(unsigned int irq)
desc->irq_count = 0;
desc->irqs_unhandled = 0;
#ifdef CONFIG_SMP
- desc->affinity = CPU_MASK_ALL;
+ cpus_setall(desc->affinity);
#endif
spin_unlock_irqrestore(&desc->lock, flags);
}
--- linux-2.6.x86.orig/mm/allocpercpu.c
+++ linux-2.6.x86/mm/allocpercpu.c
@@ -82,9 +82,10 @@ EXPORT_SYMBOL_GPL(percpu_populate);
int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
cpumask_t *mask)
{
- cpumask_t populated = CPU_MASK_NONE;
+ cpumask_t populated;
int cpu;
+ cpus_clear(populated);
for_each_cpu_mask(cpu, *mask)
if (unlikely(!percpu_populate(__pdata, size, gfp, cpu))) {
__percpu_depopulate_mask(__pdata, &populated);
--
prev parent reply other threads:[~2008-04-05 1:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-05 1:11 [PATCH 00/12] cpumask: reduce stack pressure from local/passed cpumask variables v3 Mike Travis
2008-04-05 1:11 ` [PATCH 01/12] x86: Convert cpumask_of_cpu macro to allocated array Mike Travis
2008-04-05 1:11 ` [PATCH 02/12] cpumask: add CPU_MASK_ALL_PTR macro Mike Travis
2008-04-05 1:11 ` [PATCH 03/12] cpumask: reduce stack pressure in cpu_coregroup_map Mike Travis
2008-04-05 1:11 ` [PATCH 04/12] sched: Remove fixed NR_CPUS sized arrays in kernel_sched_c v2 Mike Travis
2008-04-22 16:16 ` Tony Luck
2008-04-22 16:42 ` Mike Travis
2008-04-22 17:04 ` [PATCH 1/1] sched: remove unnecessary kzalloc in sched_init_smp Mike Travis
2008-04-22 17:28 ` Luck, Tony
2008-04-05 1:11 ` [PATCH 05/12] x86: use new set_cpus_allowed_ptr function Mike Travis
2008-04-05 1:11 ` [PATCH 06/12] generic: " Mike Travis
2008-04-05 1:11 ` [PATCH 07/12] cpuset: modify cpuset_set_cpus_allowed to use cpumask pointer Mike Travis
2008-04-05 1:11 ` [PATCH 08/12] generic: reduce stack pressure in sched_affinity Mike Travis
2008-04-05 1:11 ` [PATCH 09/12] numa: move large array from stack to _initdata section Mike Travis
2008-04-05 1:11 ` [PATCH 10/12] nodemask: use new node_to_cpumask_ptr function Mike Travis
2008-04-05 1:11 ` [PATCH 11/12] cpumask: reduce stack usage in SD_x_INIT initializers Mike Travis
2008-04-05 1:11 ` Mike Travis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080405011102.807056000@polaris-admin.engr.sgi.com \
--to=travis@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®