mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: Ingo Molnar <mingo@elte.hu>, Rusty Russell <rusty@rustcorp.com.au>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	Yinghai Lu <yhlu.kernel@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jack Steiner <steiner@sgi.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 20/31] cpumask: clean mm files
Date: Mon, 29 Sep 2008 11:03:10 -0700	[thread overview]
Message-ID: <20080929180252.858014000@polaris-admin.engr.sgi.com> (raw)
In-Reply-To: <20080929180250.111209000@polaris-admin.engr.sgi.com>

[-- Attachment #1: clean-mm --]
[-- Type: text/plain, Size: 8138 bytes --]

Signed-of-by: Mike Travis <travis@sgi.com>
---
 include/linux/mm_types.h |    2 +-
 mm/allocpercpu.c         |   18 +++++++++---------
 mm/page_alloc.c          |    6 +++---
 mm/pdflush.c             |    6 +++---
 mm/quicklist.c           |    4 ++--
 mm/slab.c                |    4 ++--
 mm/slub.c                |    4 ++--
 mm/vmscan.c              |    8 ++++----
 mm/vmstat.c              |    6 +++---
 9 files changed, 29 insertions(+), 29 deletions(-)

--- struct-cpumasks.orig/include/linux/mm_types.h
+++ struct-cpumasks/include/linux/mm_types.h
@@ -218,7 +218,7 @@ struct mm_struct {
 
 	unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
 
-	cpumask_t cpu_vm_mask;
+	cpumask_map_t cpu_vm_mask;
 
 	/* Architecture-specific MM context */
 	mm_context_t context;
--- struct-cpumasks.orig/mm/allocpercpu.c
+++ struct-cpumasks/mm/allocpercpu.c
@@ -31,10 +31,10 @@ static void percpu_depopulate(void *__pd
  * @__pdata: per-cpu data to depopulate
  * @mask: depopulate per-cpu data for cpu's selected through mask bits
  */
-static void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask)
+static void __percpu_depopulate_mask(void *__pdata, const_cpumask_t mask)
 {
 	int cpu;
-	for_each_cpu(cpu, *mask)
+	for_each_cpu(cpu, mask)
 		percpu_depopulate(__pdata, cpu);
 }
 
@@ -80,15 +80,15 @@ static void *percpu_populate(void *__pda
  * Per-cpu objects are populated with zeroed buffers.
  */
 static int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
-				  cpumask_t *mask)
+				  const_cpumask_t mask)
 {
-	cpumask_t populated;
+	cpumask_var_t populated;
 	int cpu;
 
 	cpus_clear(populated);
-	for_each_cpu(cpu, *mask)
+	for_each_cpu(cpu, mask)
 		if (unlikely(!percpu_populate(__pdata, size, gfp, cpu))) {
-			__percpu_depopulate_mask(__pdata, &populated);
+			__percpu_depopulate_mask(__pdata, populated);
 			return -ENOMEM;
 		} else
 			cpu_set(cpu, populated);
@@ -96,7 +96,7 @@ static int __percpu_populate_mask(void *
 }
 
 #define percpu_populate_mask(__pdata, size, gfp, mask) \
-	__percpu_populate_mask((__pdata), (size), (gfp), &(mask))
+	__percpu_populate_mask((__pdata), (size), (gfp), (mask))
 
 /**
  * percpu_alloc_mask - initial setup of per-cpu data
@@ -108,7 +108,7 @@ static int __percpu_populate_mask(void *
  * which is simplified by the percpu_alloc() wrapper.
  * Per-cpu objects are populated with zeroed buffers.
  */
-void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
+void *__percpu_alloc_mask(size_t size, gfp_t gfp, const_cpumask_t mask)
 {
 	/*
 	 * We allocate whole cache lines to avoid false sharing
@@ -137,7 +137,7 @@ void percpu_free(void *__pdata)
 {
 	if (unlikely(!__pdata))
 		return;
-	__percpu_depopulate_mask(__pdata, &cpu_possible_map);
+	__percpu_depopulate_mask(__pdata, cpu_possible_map);
 	kfree(__percpu_disguise(__pdata));
 }
 EXPORT_SYMBOL_GPL(percpu_free);
--- struct-cpumasks.orig/mm/page_alloc.c
+++ struct-cpumasks/mm/page_alloc.c
@@ -2080,7 +2080,7 @@ static int find_next_best_node(int node,
 	int n, val;
 	int min_val = INT_MAX;
 	int best_node = -1;
-	const cpumask_t tmp = node_to_cpumask(0);
+	const_cpumask_t tmp = node_to_cpumask(0);
 
 	/* Use the local node if we haven't already */
 	if (!node_isset(node, *used_node_mask)) {
@@ -2101,8 +2101,8 @@ static int find_next_best_node(int node,
 		val += (n < node);
 
 		/* Give preference to headless and unused nodes */
-		node_to_cpumask_ptr_next(tmp, n);
-		if (!cpus_empty(*tmp))
+		tmp = node_to_cpumask(n);
+		if (!cpus_empty(tmp))
 			val += PENALTY_FOR_NODE_WITH_CPUS;
 
 		/* Slight preference for less loaded node */
--- struct-cpumasks.orig/mm/pdflush.c
+++ struct-cpumasks/mm/pdflush.c
@@ -172,7 +172,7 @@ static int __pdflush(struct pdflush_work
 static int pdflush(void *dummy)
 {
 	struct pdflush_work my_work;
-	cpumask_t cpus_allowed;
+	cpumask_var_t cpus_allowed;
 
 	/*
 	 * pdflush can spend a lot of time doing encryption via dm-crypt.  We
@@ -187,8 +187,8 @@ static int pdflush(void *dummy)
 	 * This is needed as pdflush's are dynamically created and destroyed.
 	 * The boottime pdflush's are easily placed w/o these 2 lines.
 	 */
-	cpuset_cpus_allowed(current, &cpus_allowed);
-	set_cpus_allowed(current, &cpus_allowed);
+	cpuset_cpus_allowed(current, cpus_allowed);
+	set_cpus_allowed(current, cpus_allowed);
 
 	return __pdflush(&my_work);
 }
--- struct-cpumasks.orig/mm/quicklist.c
+++ struct-cpumasks/mm/quicklist.c
@@ -29,7 +29,7 @@ static unsigned long max_pages(unsigned 
 	int node = numa_node_id();
 	struct zone *zones = NODE_DATA(node)->node_zones;
 	int num_cpus_on_node;
-	const cpumask_t cpumask_on_node = node_to_cpumask(node);
+	const_cpumask_t cpumask_on_node = node_to_cpumask(node);
 
 	node_free_pages =
 #ifdef CONFIG_ZONE_DMA
@@ -42,7 +42,7 @@ static unsigned long max_pages(unsigned 
 
 	max = node_free_pages / FRACTION_OF_NODE_MEM;
 
-	num_cpus_on_node = cpus_weight(*cpumask_on_node);
+	num_cpus_on_node = cpus_weight(cpumask_on_node);
 	max /= num_cpus_on_node;
 
 	return max(max, min_pages);
--- struct-cpumasks.orig/mm/slab.c
+++ struct-cpumasks/mm/slab.c
@@ -1079,7 +1079,7 @@ static void __cpuinit cpuup_canceled(lon
 	struct kmem_cache *cachep;
 	struct kmem_list3 *l3 = NULL;
 	int node = cpu_to_node(cpu);
-	const cpumask_t mask = node_to_cpumask(node);
+	const_cpumask_t mask = node_to_cpumask(node);
 
 	list_for_each_entry(cachep, &cache_chain, next) {
 		struct array_cache *nc;
@@ -1101,7 +1101,7 @@ static void __cpuinit cpuup_canceled(lon
 		if (nc)
 			free_block(cachep, nc->entry, nc->avail, node);
 
-		if (!cpus_empty(*mask)) {
+		if (!cpus_empty(mask)) {
 			spin_unlock_irq(&l3->list_lock);
 			goto free_array_cache;
 		}
--- struct-cpumasks.orig/mm/slub.c
+++ struct-cpumasks/mm/slub.c
@@ -1972,7 +1972,7 @@ static DEFINE_PER_CPU(struct kmem_cache_
 				kmem_cache_cpu)[NR_KMEM_CACHE_CPU];
 
 static DEFINE_PER_CPU(struct kmem_cache_cpu *, kmem_cache_cpu_free);
-static cpumask_t kmem_cach_cpu_free_init_once = CPU_MASK_NONE;
+static cpumask_map_t kmem_cach_cpu_free_init_once = CPU_MASK_NONE;
 
 static struct kmem_cache_cpu *alloc_kmem_cache_cpu(struct kmem_cache *s,
 							int cpu, gfp_t flags)
@@ -3446,7 +3446,7 @@ struct location {
 	long max_time;
 	long min_pid;
 	long max_pid;
-	cpumask_t cpus;
+	cpumask_map_t cpus;
 	nodemask_t nodes;
 };
 
--- struct-cpumasks.orig/mm/vmscan.c
+++ struct-cpumasks/mm/vmscan.c
@@ -1687,9 +1687,9 @@ static int kswapd(void *p)
 	struct reclaim_state reclaim_state = {
 		.reclaimed_slab = 0,
 	};
-	const cpumask_t cpumask = node_to_cpumask(pgdat->node_id);
+	const_cpumask_t cpumask = node_to_cpumask(pgdat->node_id);
 
-	if (!cpus_empty(*cpumask))
+	if (!cpus_empty(cpumask))
 		set_cpus_allowed(tsk, cpumask);
 	current->reclaim_state = &reclaim_state;
 
@@ -1924,9 +1924,9 @@ static int __devinit cpu_callback(struct
 	if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN) {
 		for_each_node_state(nid, N_HIGH_MEMORY) {
 			pg_data_t *pgdat = NODE_DATA(nid);
-			const cpumask_t mask = node_to_cpumask(pgdat->node_id);
+			const_cpumask_t mask = node_to_cpumask(pgdat->node_id);
 
-			if (any_online_cpu(*mask) < nr_cpu_ids)
+			if (any_online_cpu(mask) < nr_cpu_ids)
 				/* One of our CPUs online: restore mask */
 				set_cpus_allowed(pgdat->kswapd, mask);
 		}
--- struct-cpumasks.orig/mm/vmstat.c
+++ struct-cpumasks/mm/vmstat.c
@@ -20,14 +20,14 @@
 DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}};
 EXPORT_PER_CPU_SYMBOL(vm_event_states);
 
-static void sum_vm_events(unsigned long *ret, cpumask_t *cpumask)
+static void sum_vm_events(unsigned long *ret, const_cpumask_t cpumask)
 {
 	int cpu;
 	int i;
 
 	memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long));
 
-	for_each_cpu(cpu, *cpumask) {
+	for_each_cpu(cpu, cpumask) {
 		struct vm_event_state *this = &per_cpu(vm_event_states, cpu);
 
 		for (i = 0; i < NR_VM_EVENT_ITEMS; i++)
@@ -43,7 +43,7 @@ static void sum_vm_events(unsigned long 
 void all_vm_events(unsigned long *ret)
 {
 	get_online_cpus();
-	sum_vm_events(ret, &cpu_online_map);
+	sum_vm_events(ret, cpu_online_map);
 	put_online_cpus();
 }
 EXPORT_SYMBOL_GPL(all_vm_events);

-- 

  parent reply	other threads:[~2008-09-29 18:09 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29 18:02 [PATCH 00/31] cpumask: Provide new cpumask API Mike Travis
2008-09-29 18:02 ` [PATCH 01/31] cpumask: Documentation Mike Travis
2008-09-30 22:49   ` Rusty Russell
2008-10-01  9:13     ` Ingo Molnar
2008-10-02  0:36       ` Rusty Russell
2008-10-02  9:32         ` Ingo Molnar
2008-10-02 12:54         ` Mike Travis
2008-10-03  9:04           ` Ingo Molnar
2008-10-06 15:02             ` Pretty blinking lights vs. monitoring system activity from a system controller Mike Travis
2008-09-29 18:02 ` [PATCH 02/31] cpumask: modify send_IPI_mask interface to accept cpumask_t pointers Mike Travis
2008-09-29 18:02 ` [PATCH 03/31] cpumask: remove min from first_cpu/next_cpu Mike Travis
2008-09-29 18:02 ` [PATCH 04/31] cpumask: move cpu_alloc to separate file Mike Travis
2008-09-29 18:02 ` [PATCH 05/31] cpumask: Provide new cpumask API Mike Travis
2008-09-30  9:11   ` Ingo Molnar
2008-09-30 15:42     ` Mike Travis
2008-09-30 16:17       ` Mike Travis
2008-10-01  9:08         ` Ingo Molnar
2008-09-29 18:02 ` [PATCH 06/31] cpumask: new lib/cpumask.c Mike Travis
2008-09-29 18:02 ` [PATCH 07/31] cpumask: changes to compile init/main.c Mike Travis
2008-09-29 18:02 ` [PATCH 08/31] cpumask: Change cpumask maps Mike Travis
2008-09-29 18:02 ` [PATCH 09/31] cpumask: get rid of _nr functions Mike Travis
2008-09-29 18:03 ` [PATCH 10/31] cpumask: clean cpumask_of_cpu refs Mike Travis
2008-09-29 18:03 ` [PATCH 11/31] cpumask: remove set_cpus_allowed_ptr Mike Travis
2008-09-29 18:03 ` [PATCH 12/31] cpumask: remove CPU_MASK_ALL_PTR Mike Travis
2008-09-29 18:03 ` [PATCH 13/31] cpumask: modify for_each_cpu_mask Mike Travis
2008-09-29 18:03 ` [PATCH 14/31] cpumask: change first/next_cpu to cpus_first/next Mike Travis
2008-09-29 18:03 ` [PATCH 15/31] cpumask: remove node_to_cpumask_ptr Mike Travis
2008-09-29 18:03 ` [PATCH 16/31] cpumask: clean apic files Mike Travis
2008-09-29 18:03 ` [PATCH 17/31] cpumask: clean cpufreq files Mike Travis
2008-09-29 18:03 ` [PATCH 18/31] cpumask: clean sched files Mike Travis
2008-09-29 18:03 ` [PATCH 19/31] cpumask: clean xen files Mike Travis
2008-09-29 18:03 ` Mike Travis [this message]
2008-09-29 18:03 ` [PATCH 21/31] cpumask: clean acpi files Mike Travis
2008-09-29 18:03 ` [PATCH 22/31] cpumask: clean irq files Mike Travis
2008-09-29 18:03 ` [PATCH 23/31] cpumask: clean pci files Mike Travis
2008-09-29 18:03 ` [PATCH 24/31] cpumask: clean cpu files Mike Travis
2008-09-29 18:03 ` [PATCH 25/31] cpumask: clean rcu files Mike Travis
2008-09-29 18:03 ` [PATCH 26/31] cpumask: clean tlb files Mike Travis
2008-09-29 18:03 ` [PATCH 27/31] cpumask: clean time files Mike Travis
2008-09-29 18:03 ` [PATCH 28/31] cpumask: clean smp files Mike Travis
2008-09-29 18:03 ` [PATCH 29/31] cpumask: clean trace files Mike Travis
2008-09-29 18:03 ` [PATCH 30/31] cpumask: clean kernel files Mike Travis
2008-09-29 18:03 ` [PATCH 31/31] cpumask: clean misc files Mike Travis

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=20080929180252.858014000@polaris-admin.engr.sgi.com \
    --to=travis@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=steiner@sgi.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yhlu.kernel@gmail.com \
    /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®