All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, dipankar@in.ibm.com,
	bharata@in.ibm.com, shai@scalex86.org,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: [patch 1/11] mm: Reimplementation of dynamic per-cpu allocator -- vmalloc_fixup
Date: Tue, 13 Sep 2005 08:54:16 -0700	[thread overview]
Message-ID: <20050913155416.GC3570@localhost.localdomain> (raw)
In-Reply-To: <20050913155112.GB3570@localhost.localdomain>

Patch to add gfp_flags as args to __get_vm_area.  alloc_percpu needs to use
GFP flags as the dst_entry.refcount needs to be allocated with GFP_ATOMIC.
Since alloc_percpu needs get_vm_area underneath, this patch changes
__get_vmarea to accept gfp_flags as arg, so that alloc_percpu can use
__get_vm_area.  get_vm_area remains unchanged.

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>

Index: alloc_percpu-2.6.13-rc6/arch/arm/kernel/module.c
===================================================================
--- alloc_percpu-2.6.13-rc6.orig/arch/arm/kernel/module.c	2005-06-17 12:48:29.000000000 -0700
+++ alloc_percpu-2.6.13-rc6/arch/arm/kernel/module.c	2005-08-14 23:03:49.000000000 -0700
@@ -40,7 +40,8 @@
 	if (!size)
 		return NULL;
 
-	area = __get_vm_area(size, VM_ALLOC, MODULE_START, MODULE_END);
+	area = __get_vm_area(size, VM_ALLOC, MODULE_START, MODULE_END,
+				GFP_KERNEL);
 	if (!area)
 		return NULL;
 
Index: alloc_percpu-2.6.13-rc6/arch/sh/kernel/cpu/sh4/sq.c
===================================================================
--- alloc_percpu-2.6.13-rc6.orig/arch/sh/kernel/cpu/sh4/sq.c	2005-06-17 12:48:29.000000000 -0700
+++ alloc_percpu-2.6.13-rc6/arch/sh/kernel/cpu/sh4/sq.c	2005-08-14 23:04:48.000000000 -0700
@@ -189,7 +189,8 @@
 	 * writeout before we hit the TLB flush, we do it anyways. This way
 	 * we at least save ourselves the initial page fault overhead.
 	 */
-	vma = __get_vm_area(map->size, VM_ALLOC, map->sq_addr, SQ_ADDRMAX);
+	vma = __get_vm_area(map->size, VM_ALLOC, map->sq_addr, SQ_ADDRMAX,
+				GFP_KERNEL);
 	if (!vma)
 		return ERR_PTR(-ENOMEM);
 
Index: alloc_percpu-2.6.13-rc6/arch/sparc64/kernel/module.c
===================================================================
--- alloc_percpu-2.6.13-rc6.orig/arch/sparc64/kernel/module.c	2005-06-17 12:48:29.000000000 -0700
+++ alloc_percpu-2.6.13-rc6/arch/sparc64/kernel/module.c	2005-08-14 23:05:49.000000000 -0700
@@ -25,7 +25,8 @@
 	if (!size || size > MODULES_LEN)
 		return NULL;
 
-	area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);
+	area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END,
+				GFP_KERNEL);
 	if (!area)
 		return NULL;
 
Index: alloc_percpu-2.6.13-rc6/arch/x86_64/kernel/module.c
===================================================================
--- alloc_percpu-2.6.13-rc6.orig/arch/x86_64/kernel/module.c	2005-06-17 12:48:29.000000000 -0700
+++ alloc_percpu-2.6.13-rc6/arch/x86_64/kernel/module.c	2005-08-14 23:06:28.000000000 -0700
@@ -48,7 +48,8 @@
 	if (size > MODULES_LEN)
 		return NULL;
 
-	area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);
+	area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END,
+				GFP_KERNEL);
 	if (!area)
 		return NULL;
 
Index: alloc_percpu-2.6.13-rc6/include/linux/vmalloc.h
===================================================================
--- alloc_percpu-2.6.13-rc6.orig/include/linux/vmalloc.h	2005-06-17 12:48:29.000000000 -0700
+++ alloc_percpu-2.6.13-rc6/include/linux/vmalloc.h	2005-08-14 23:12:29.000000000 -0700
@@ -39,7 +39,8 @@
  */
 extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
 extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
-					unsigned long start, unsigned long end);
+					unsigned long start, unsigned long end,
+					unsigned int gfpflags);
 extern struct vm_struct *remove_vm_area(void *addr);
 extern struct vm_struct *__remove_vm_area(void *addr);
 extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
Index: alloc_percpu-2.6.13-rc6/mm/vmalloc.c
===================================================================
--- alloc_percpu-2.6.13-rc6.orig/mm/vmalloc.c	2005-06-17 12:48:29.000000000 -0700
+++ alloc_percpu-2.6.13-rc6/mm/vmalloc.c	2005-08-14 22:29:31.000000000 -0700
@@ -161,7 +161,8 @@
 #define IOREMAP_MAX_ORDER	(7 + PAGE_SHIFT)	/* 128 pages */
 
 struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
-				unsigned long start, unsigned long end)
+				unsigned long start, unsigned long end,
+				unsigned int gfp_flags)
 {
 	struct vm_struct **p, *tmp, *area;
 	unsigned long align = 1;
@@ -180,7 +181,7 @@
 	addr = ALIGN(start, align);
 	size = PAGE_ALIGN(size);
 
-	area = kmalloc(sizeof(*area), GFP_KERNEL);
+	area = kmalloc(sizeof(*area), gfp_flags);
 	if (unlikely(!area))
 		return NULL;
 
@@ -245,7 +246,8 @@
  */
 struct vm_struct *get_vm_area(unsigned long size, unsigned long flags)
 {
-	return __get_vm_area(size, flags, VMALLOC_START, VMALLOC_END);
+	return __get_vm_area(size, flags, VMALLOC_START, VMALLOC_END, 
+				GFP_KERNEL);
 }
 
 /* Caller must hold vmlist_lock */

  reply	other threads:[~2005-09-13 15:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 15:51 [patch 0/11] mm: Reimplementation of dynamic per-cpu allocator Ravikiran G Thirumalai
2005-09-13 15:54 ` Ravikiran G Thirumalai [this message]
2005-09-13 19:25   ` [patch 1/11] mm: Reimplementation of dynamic per-cpu allocator -- vmalloc_fixup Andrew Morton
2005-09-13 15:56 ` [patch 2/11] mm: Reimplementation of dynamic per-cpu allocator -- alloc_percpu Ravikiran G Thirumalai
2005-09-13 15:58 ` [patch 3/11] mm: Reimplementation of dynamic per-cpu allocator -- alloc_percpu_atomic Ravikiran G Thirumalai
2005-09-13 15:59 ` [patch 4/11] mm: Reimplementation of dynamic per-cpu allocator -- change_alloc_percpu_users Ravikiran G Thirumalai
2005-09-13 16:01 ` [patch 5/11] mm: Bigrefs -- add_getcpuptr Ravikiran G Thirumalai
2005-09-13 16:04 ` [patch 6/11] mm: Bigrefs -- distributed refcounters Ravikiran G Thirumalai
2005-09-14  7:36   ` Rusty Russell
2005-09-14 20:03     ` Ravikiran G Thirumalai
2005-09-13 16:10 ` [patch 7/11] net: Use bigrefs for net_device.refcount Ravikiran G Thirumalai
2005-09-13 16:26   ` Stephen Hemminger
2005-09-13 16:35     ` Ben Greear
2005-09-13 16:46       ` Stephen Hemminger
2005-09-13 20:26     ` David S. Miller
2005-09-13 22:16       ` Ravikiran G Thirumalai
2005-09-13 18:27   ` Eric Dumazet
2005-09-13 18:53     ` Ravikiran G Thirumalai
2005-09-13 16:12 ` [patch 8/11] net: dst_abstraction macros Ravikiran G Thirumalai
2005-09-13 16:17 ` [patch 9/11] net: dst_entry.refcount, use, lastuse to use alloc_percpu Ravikiran G Thirumalai
2005-09-13 20:24   ` David S. Miller
2005-09-13 22:07     ` Ravikiran G Thirumalai
2005-09-13 22:12       ` David S. Miller
2005-09-13 23:17         ` Ravikiran G Thirumalai
2005-09-13 23:27           ` David S. Miller
2005-09-14  7:21             ` Rusty Russell
2005-09-13 16:18 ` [patch 10/11] mm: Reimplementation of dynamic per-cpu allocator -- allow_early_mapvmarea Ravikiran G Thirumalai
2005-09-13 16:19 ` [patch 11/11] mm: Reimplementation of dynamic per-cpu allocator -- hotplug_alloc_percpu_blocks Ravikiran G Thirumalai

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=20050913155416.GC3570@localhost.localdomain \
    --to=kiran@scalex86.org \
    --cc=akpm@osdl.org \
    --cc=bharata@in.ibm.com \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=shai@scalex86.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.