From: Ravikiran G Thirumalai <kiran@in.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@digeo.com>,
Rusty Russell <rusty@rustcorp.com.au>,
dipankar@in.ibm.com
Subject: [patch] kmalloc_percpu -- 1 of 2
Date: Wed, 4 Dec 2002 17:42:10 +0530 [thread overview]
Message-ID: <20021204174209.A17375@in.ibm.com> (raw)
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
next reply other threads:[~2002-12-04 12:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-04 12:12 Ravikiran G Thirumalai [this message]
2002-12-04 12:15 ` [patch] kmalloc_percpu -- 2 of 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
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=20021204174209.A17375@in.ibm.com \
--to=kiran@in.ibm.com \
--cc=akpm@digeo.com \
--cc=dipankar@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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;
as well as URLs for NNTP newsgroup(s).