Skip to contentSkip to conversation

Make rt_cache_stat use kmalloc_percpu

PATCH In review Ravikiran G Thirumalai 3 participants 5 messages Dec 16, 2002 – Dec 23, 2002

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make rt_cache_stat use kmalloc_percpu

Hi,
Here's another patch to use kmalloc_percpu. As usual, this removes NR_CPUS bloat, can work when modulized and helps node local allocation.

Thanks,
Kiran

D: Name: rtstats-2.5.52-1.patch
D: Author: Ravikiran Thirumalai
D: Description: Make rt_cache_stat use kmalloc_percpu

 include/net/route.h |    6 +++-
 net/ipv4/route.c    |   71 +++++++++++++++++++++++++++++-----------------------
 2 files changed, 45 insertions(+), 32 deletions(-)
include/net/route.h +5 -1
diff -ruN -X dontdiff linux-2.5.52/include/net/route.h rtstats-2.5.52/include/net/route.h
@@ -102,7 +102,11 @@
         unsigned int gc_ignored;
         unsigned int gc_goal_miss;
         unsigned int gc_dst_overflow;
-} ____cacheline_aligned_in_smp;
+};
+
+extern struct rt_cache_stat *rt_cache_stat;
+#define RT_CACHE_STAT_INC(field)					  \
+		(per_cpu_ptr(rt_cache_stat, smp_processor_id())->field++)
 
 extern struct ip_rt_acct *ip_rt_acct;
 
net/ipv4/route.c +40 -31

178 lines not on this page · raw message

#1 lore raw

From: Ravikiran G Thirumalai <[email protected]>
Date: Mon, 16 Dec 2002 19:22:12 +0530

Here's another patch to use kmalloc_percpu. As usual, this removes NR_CPUS bloat, can work when modulized and helps node local allocation.

I can't consider this seriously until the kmalloc_percpu stuff actually makes it into Linus's tree. Last I checked, Andrew had a lot of legitimate gripes with the ideas.

#2 lore raw
Quoted 10 lines · David S. Miller

From: Ravikiran G Thirumalai <[email protected]>
Date: Mon, 16 Dec 2002 19:22:12 +0530

Here's another patch to use kmalloc_percpu. As usual, this removes NR_CPUS bloat, can work when modulized and helps node local allocation.

I can't consider this seriously until the kmalloc_percpu stuff actually makes it into Linus's tree. Last I checked, Andrew had a lot of legitimate gripes with the ideas.

Kiran's latest (vastly simpler) version looks fine to my eye.

#3 lore raw

From: Andrew Morton <[email protected]>
Date: Fri, 20 Dec 2002 23:31:56 -0800

Quoted 3 lines · David S. Miller

I can't consider this seriously until the kmalloc_percpu stuff actually makes it into Linus's tree. Last I checked, Andrew had a lot of legitimate gripes with the ideas.

Kiran's latest (vastly simpler) version looks fine to my eye.

Ok, so once that is in, he can feel free to resubmit the rt_cache_state patch.

#4 lore raw
Quoted 5 lines · David S. Miller

...
Kiran's latest (vastly simpler) version looks fine to my eye.

Ok, so once that is in, he can feel free to resubmit the rt_cache_state patch.

Ok, I'll do that

Thanks,
Kiran