All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] kmalloc_percpu  -- 1 of 2
@ 2002-12-04 12:12 Ravikiran G Thirumalai
  2002-12-04 12:15 ` [patch] kmalloc_percpu -- 2 " Ravikiran G Thirumalai
  0 siblings, 1 reply; 17+ messages in thread
From: Ravikiran G Thirumalai @ 2002-12-04 12:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Rusty Russell, dipankar

Here's a 2.5.50 version of kmalloc_percpu originally submitted by Dipankar.  
This one incorporates Rusty's suggestions to rearrange code and sync 
up with its static counterpart. This version needs exposure of malloc_sizes 
in order to move the interfaces to percpu.c from slab.c (kmalloc_percpu and
kfree_percpu donot have anything to do with the slab allocator itself).
First of the two patches is to expose the malloc_sizes and the second
one is the actual allocator.  I'll follow this up with patchsets to enable 
networking mibs use kmalloc_percpu. We'll have to use kmalloc_percpu
for mibs since DEFINE_PER_CPU won't work with modules (and ipv6 stuff
can be compiled in as modules)

Following is the 1 of 2 patches.

D: Name: slabchange-2.5.50-1.patch
D: Description: Exposes malloc_sizes for kmalloc_percpu
D: Author: Ravikiran Thirumalai


 include/linux/slab.h |   13 +++++++++++++
 mm/slab.c            |    9 +--------
 2 files changed, 14 insertions(+), 8 deletions(-)


diff -ruN linux-2.5.50/include/linux/slab.h kmalloc_percpu-2.5.50/include/linux/slab.h
--- linux-2.5.50/include/linux/slab.h	Thu Nov 28 04:06:23 2002
+++ kmalloc_percpu-2.5.50/include/linux/slab.h	Sun Dec  1 11:13:49 2002
@@ -75,6 +75,19 @@
 extern kmem_cache_t	*sigact_cachep;
 extern kmem_cache_t	*bio_cachep;
 
+/* 
+ * Size description struct for general caches. 
+ * This had to be exposed for kmalloc_percpu.
+ */
+
+struct cache_sizes {
+	size_t           cs_size;
+	kmem_cache_t    *cs_cachep;
+	kmem_cache_t    *cs_dmacachep;
+};
+
+extern struct cache_sizes malloc_sizes[];
+
 #endif	/* __KERNEL__ */
 
 #endif	/* _LINUX_SLAB_H */
diff -ruN linux-2.5.50/mm/slab.c kmalloc_percpu-2.5.50/mm/slab.c
--- linux-2.5.50/mm/slab.c	Thu Nov 28 04:06:17 2002
+++ kmalloc_percpu-2.5.50/mm/slab.c	Sun Dec  1 11:13:49 2002
@@ -369,15 +369,8 @@
 #define	SET_PAGE_SLAB(pg,x)   ((pg)->list.prev = (struct list_head *)(x))
 #define	GET_PAGE_SLAB(pg)     ((struct slab *)(pg)->list.prev)
 
-/* Size description struct for general caches. */
-struct cache_sizes {
-	size_t		 cs_size;
-	kmem_cache_t	*cs_cachep;
-	kmem_cache_t	*cs_dmacachep;
-};
-
 /* These are the default caches for kmalloc. Custom caches can have other sizes. */
-static struct cache_sizes malloc_sizes[] = {
+struct cache_sizes malloc_sizes[] = {
 #if PAGE_SIZE == 4096
 	{    32,	NULL, NULL},
 #endif

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2002-12-09 22:23 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-04 12:12 [patch] kmalloc_percpu -- 1 of 2 Ravikiran G Thirumalai
2002-12-04 12:15 ` [patch] kmalloc_percpu -- 2 " Ravikiran G Thirumalai
2002-12-04 19:34   ` Andrew Morton
2002-12-05  3:42     ` Dipankar Sarma
2002-12-05  4:32       ` Andrew Morton
2002-12-05  4:47         ` William Lee Irwin III
2002-12-05 10:53         ` Dipankar Sarma
2002-12-05 11:23           ` yodaiken
2002-12-05 11:28             ` William Lee Irwin III
2002-12-05 12:41             ` Dipankar Sarma
2002-12-05 15:08               ` yodaiken
2002-12-05 20:02           ` Andrew Morton
2002-12-05 21:23             ` Dipankar Sarma
2002-12-05 22:15               ` Andrew Morton
2002-12-09  5:30             ` Ravikiran G Thirumalai
2002-12-09  5:57               ` Andrew Morton
2002-12-09 19:28               ` Andrew Morton

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.