* [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache
@ 2004-11-14 20:18 Chris Wright
2004-11-14 20:20 ` [PATCH 1/8] " Chris Wright
` (8 more replies)
0 siblings, 9 replies; 13+ messages in thread
From: Chris Wright @ 2004-11-14 20:18 UTC (permalink / raw)
To: davem; +Cc: netdev
The following trivial patches update networking code to use the SLAB_PANIC
flag when creating a critical slab cache instead of doing localized calls
to panic(). This brings networking inline with other core kernel code.
core/flow.c | 5 +----
core/skbuff.c | 4 +---
decnet/dn_route.c | 9 +++------
ipv4/inetpeer.c | 5 +----
ipv4/ipmr.c | 5 +----
ipv6/ip6_fib.c | 4 +---
ipv6/route.c | 9 +++------
xfrm/xfrm_input.c | 4 +---
8 files changed, 12 insertions(+), 33 deletions(-)
thanks,
-chris
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
@ 2004-11-14 20:20 ` Chris Wright
2004-11-14 20:20 ` [PATCH 2/8] " Chris Wright
` (7 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Chris Wright @ 2004-11-14 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev
Use SLAB_PANIC when creating a critical slab cache.
Signed-off-by: Chris Wright <chrisw@osdl.org>
===== net/core/flow.c 1.20 vs edited =====
--- 1.20/net/core/flow.c 2004-03-16 18:10:10 -08:00
+++ edited/net/core/flow.c 2004-10-29 14:22:54 -07:00
@@ -343,11 +343,8 @@ static int __init flow_cache_init(void)
flow_cachep = kmem_cache_create("flow_cache",
sizeof(struct flow_cache_entry),
- 0, SLAB_HWCACHE_ALIGN,
+ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
NULL, NULL);
-
- if (!flow_cachep)
- panic("NET: failed to allocate flow cache slab\n");
flow_hash_shift = 10;
flow_lwm = 2 * flow_hash_size;
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
2004-11-14 20:20 ` [PATCH 1/8] " Chris Wright
@ 2004-11-14 20:20 ` Chris Wright
2004-11-14 20:21 ` [PATCH 3/8] " Chris Wright
` (6 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Chris Wright @ 2004-11-14 20:20 UTC (permalink / raw)
To: davem; +Cc: netdev
Use SLAB_PANIC when creating a critical slab cache.
Signed-off-by: Chris Wright <chrisw@osdl.org>
===== net/core/skbuff.c 1.39 vs edited =====
--- 1.39/net/core/skbuff.c 2004-10-19 21:56:24 -07:00
+++ edited/net/core/skbuff.c 2004-10-29 14:23:43 -07:00
@@ -1430,10 +1430,8 @@ void __init skb_init(void)
skbuff_head_cache = kmem_cache_create("skbuff_head_cache",
sizeof(struct sk_buff),
0,
- SLAB_HWCACHE_ALIGN,
+ SLAB_HWCACHE_ALIGN|SLAB_PANIC,
NULL, NULL);
- if (!skbuff_head_cache)
- panic("cannot create skbuff cache");
}
EXPORT_SYMBOL(___pskb_trim);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 3/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
2004-11-14 20:20 ` [PATCH 1/8] " Chris Wright
2004-11-14 20:20 ` [PATCH 2/8] " Chris Wright
@ 2004-11-14 20:21 ` Chris Wright
2004-11-14 20:22 ` [PATCH 4/8] " Chris Wright
` (5 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Chris Wright @ 2004-11-14 20:21 UTC (permalink / raw)
To: davem; +Cc: netdev
Use SLAB_PANIC when creating a critical slab cache.
Signed-off-by: Chris Wright <chrisw@osdl.org>
===== net/decnet/dn_route.c 1.29 vs edited =====
--- 1.29/net/decnet/dn_route.c 2004-11-09 16:44:25 -08:00
+++ edited/net/decnet/dn_route.c 2004-11-10 17:48:58 -08:00
@@ -1778,12 +1778,9 @@ void __init dn_route_init(void)
int i, goal, order;
dn_dst_ops.kmem_cachep = kmem_cache_create("dn_dst_cache",
- sizeof(struct dn_route),
- 0, SLAB_HWCACHE_ALIGN,
- NULL, NULL);
-
- if (!dn_dst_ops.kmem_cachep)
- panic("DECnet: Failed to allocate dn_dst_cache\n");
+ sizeof(struct dn_route), 0,
+ SLAB_HWCACHE_ALIGN|SLAB_PANIC,
+ NULL, NULL);
init_timer(&dn_route_timer);
dn_route_timer.function = dn_dst_check_expire;
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 4/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
` (2 preceding siblings ...)
2004-11-14 20:21 ` [PATCH 3/8] " Chris Wright
@ 2004-11-14 20:22 ` Chris Wright
2004-11-14 20:23 ` [PATCH 5/8] " Chris Wright
` (4 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Chris Wright @ 2004-11-14 20:22 UTC (permalink / raw)
To: davem; +Cc: netdev
Use SLAB_PANIC when creating a critical slab cache.
Signed-off-by: Chris Wright <chrisw@osdl.org>
===== net/ipv4/inetpeer.c 1.9 vs edited =====
--- 1.9/net/ipv4/inetpeer.c 2004-02-23 15:09:14 -08:00
+++ edited/net/ipv4/inetpeer.c 2004-10-29 14:17:33 -07:00
@@ -126,11 +126,8 @@ void __init inet_initpeers(void)
peer_cachep = kmem_cache_create("inet_peer_cache",
sizeof(struct inet_peer),
- 0, SLAB_HWCACHE_ALIGN,
+ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
NULL, NULL);
-
- if (!peer_cachep)
- panic("cannot create inet_peer_cache");
/* All the timers, started at system startup tend
to synchronize. Perturb it a bit.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 5/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
` (3 preceding siblings ...)
2004-11-14 20:22 ` [PATCH 4/8] " Chris Wright
@ 2004-11-14 20:23 ` Chris Wright
2004-11-14 20:24 ` [PATCH 6/8] " Chris Wright
` (3 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Chris Wright @ 2004-11-14 20:23 UTC (permalink / raw)
To: davem; +Cc: netdev
Use SLAB_PANIC when creating a critical slab cache.
Signed-off-by: Chris Wright <chrisw@osdl.org>
===== net/ipv4/ipmr.c 1.45 vs edited =====
--- 1.45/net/ipv4/ipmr.c 2004-07-20 14:55:34 -07:00
+++ edited/net/ipv4/ipmr.c 2004-10-29 14:11:57 -07:00
@@ -1885,11 +1885,8 @@ void __init ip_mr_init(void)
{
mrt_cachep = kmem_cache_create("ip_mrt_cache",
sizeof(struct mfc_cache),
- 0, SLAB_HWCACHE_ALIGN,
+ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
NULL, NULL);
- if (!mrt_cachep)
- panic("cannot allocate ip_mrt_cache");
-
init_timer(&ipmr_expire_timer);
ipmr_expire_timer.function=ipmr_expire_process;
register_netdevice_notifier(&ip_mr_notifier);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 6/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
` (4 preceding siblings ...)
2004-11-14 20:23 ` [PATCH 5/8] " Chris Wright
@ 2004-11-14 20:24 ` Chris Wright
2004-11-14 20:27 ` Arnaldo Carvalho de Melo
2004-11-14 20:24 ` [PATCH 7/8] " Chris Wright
` (2 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Chris Wright @ 2004-11-14 20:24 UTC (permalink / raw)
To: davem; +Cc: netdev
Use SLAB_PANIC when creating a critical slab cache.
Signed-off-by: Chris Wright <chrisw@osdl.org>
===== net/ipv6/ip6_fib.c 1.33 vs edited =====
--- 1.33/net/ipv6/ip6_fib.c 2004-11-09 22:57:03 -08:00
+++ edited/net/ipv6/ip6_fib.c 2004-11-14 11:56:01 -08:00
@@ -1242,10 +1242,8 @@ void __init fib6_init(void)
{
fib6_node_kmem = kmem_cache_create("fib6_nodes",
sizeof(struct fib6_node),
- 0, SLAB_HWCACHE_ALIGN,
+ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
NULL, NULL);
- if (!fib6_node_kmem)
- panic("cannot create fib6_nodes cache");
}
void __exit fib6_gc_cleanup(void)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 7/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
` (5 preceding siblings ...)
2004-11-14 20:24 ` [PATCH 6/8] " Chris Wright
@ 2004-11-14 20:24 ` Chris Wright
2004-11-14 20:25 ` [PATCH 8/8] " Chris Wright
2004-11-14 23:11 ` [PATCH 0/8] " Christoph Hellwig
8 siblings, 0 replies; 13+ messages in thread
From: Chris Wright @ 2004-11-14 20:24 UTC (permalink / raw)
To: davem; +Cc: netdev
Use SLAB_PANIC when creating a critical slab cache.
Signed-off-by: Chris Wright <chrisw@osdl.org>
===== net/ipv6/route.c 1.101 vs edited =====
--- 1.101/net/ipv6/route.c 2004-11-11 15:07:25 -08:00
+++ edited/net/ipv6/route.c 2004-11-14 11:56:41 -08:00
@@ -2069,12 +2069,9 @@ void __init ip6_route_init(void)
struct proc_dir_entry *p;
ip6_dst_ops.kmem_cachep = kmem_cache_create("ip6_dst_cache",
- sizeof(struct rt6_info),
- 0, SLAB_HWCACHE_ALIGN,
- NULL, NULL);
- if (!ip6_dst_ops.kmem_cachep)
- panic("cannot create ip6_dst_cache");
-
+ sizeof(struct rt6_info), 0,
+ SLAB_HWCACHE_ALIGN|SLAB_PANIC,
+ NULL, NULL);
fib6_init();
#ifdef CONFIG_PROC_FS
p = proc_net_create("ipv6_route", 0, rt6_proc_info);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 8/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
` (6 preceding siblings ...)
2004-11-14 20:24 ` [PATCH 7/8] " Chris Wright
@ 2004-11-14 20:25 ` Chris Wright
2004-11-14 23:11 ` [PATCH 0/8] " Christoph Hellwig
8 siblings, 0 replies; 13+ messages in thread
From: Chris Wright @ 2004-11-14 20:25 UTC (permalink / raw)
To: davem; +Cc: netdev
Use SLAB_PANIC when creating a critical slab cache.
Signed-off-by: Chris Wright <chrisw@osdl.org>
===== net/xfrm/xfrm_input.c 1.13 vs edited =====
--- 1.13/net/xfrm/xfrm_input.c 2003-07-27 19:22:27 -07:00
+++ edited/net/xfrm/xfrm_input.c 2004-10-29 14:57:20 -07:00
@@ -78,8 +78,6 @@ void __init xfrm_input_init(void)
{
secpath_cachep = kmem_cache_create("secpath_cache",
sizeof(struct sec_path),
- 0, SLAB_HWCACHE_ALIGN,
+ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
NULL, NULL);
- if (!secpath_cachep)
- panic("XFRM: failed to allocate secpath_cache\n");
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 6/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:24 ` [PATCH 6/8] " Chris Wright
@ 2004-11-14 20:27 ` Arnaldo Carvalho de Melo
2004-11-14 22:51 ` Chris Wright
0 siblings, 1 reply; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2004-11-14 20:27 UTC (permalink / raw)
To: Chris Wright; +Cc: davem, netdev
Chris,
I think somebody proposed this in the past and it was refused
because we better get rid of the panics and return an error, propagate
it and refuse to load the module, better have the machine still alive
but without networking than panic it.
- Arnaldo
Chris Wright wrote:
> Use SLAB_PANIC when creating a critical slab cache.
>
> Signed-off-by: Chris Wright <chrisw@osdl.org>
>
> ===== net/ipv6/ip6_fib.c 1.33 vs edited =====
> --- 1.33/net/ipv6/ip6_fib.c 2004-11-09 22:57:03 -08:00
> +++ edited/net/ipv6/ip6_fib.c 2004-11-14 11:56:01 -08:00
> @@ -1242,10 +1242,8 @@ void __init fib6_init(void)
> {
> fib6_node_kmem = kmem_cache_create("fib6_nodes",
> sizeof(struct fib6_node),
> - 0, SLAB_HWCACHE_ALIGN,
> + 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
> NULL, NULL);
> - if (!fib6_node_kmem)
> - panic("cannot create fib6_nodes cache");
> }
>
> void __exit fib6_gc_cleanup(void)
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 6/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:27 ` Arnaldo Carvalho de Melo
@ 2004-11-14 22:51 ` Chris Wright
2004-11-14 23:51 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 13+ messages in thread
From: Chris Wright @ 2004-11-14 22:51 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: Chris Wright, davem, netdev
* Arnaldo Carvalho de Melo (acme@conectiva.com.br) wrote:
> Chris,
>
> I think somebody proposed this in the past and it was refused
> because we better get rid of the panics and return an error, propagate
> it and refuse to load the module, better have the machine still alive
> but without networking than panic it.
Sounds good too. Part of my thinking was that these patches would be a
good chance to review if these are necessarily panic conditions. What was
the plan on error return, since I expect some caches are interdependent?
thanks,
-chris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
` (7 preceding siblings ...)
2004-11-14 20:25 ` [PATCH 8/8] " Chris Wright
@ 2004-11-14 23:11 ` Christoph Hellwig
8 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2004-11-14 23:11 UTC (permalink / raw)
To: Chris Wright; +Cc: davem, netdev
On Sun, Nov 14, 2004 at 12:18:37PM -0800, Chris Wright wrote:
> The following trivial patches update networking code to use the SLAB_PANIC
> flag when creating a critical slab cache instead of doing localized calls
> to panic(). This brings networking inline with other core kernel code.
>
> core/flow.c | 5 +----
> core/skbuff.c | 4 +---
> decnet/dn_route.c | 9 +++------
> ipv4/inetpeer.c | 5 +----
> ipv4/ipmr.c | 5 +----
> ipv6/ip6_fib.c | 4 +---
> ipv6/route.c | 9 +++------
> xfrm/xfrm_input.c | 4 +---
decnet, ipv6 and xfrm can be modular, so using SLAB_PANIC there is bogus.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 6/8] Use SLAB_PANIC when creating critical slab cache
2004-11-14 22:51 ` Chris Wright
@ 2004-11-14 23:51 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2004-11-14 23:51 UTC (permalink / raw)
To: Chris Wright; +Cc: davem, netdev
Chris Wright wrote:
> * Arnaldo Carvalho de Melo (acme@conectiva.com.br) wrote:
>
>>Chris,
>>
>> I think somebody proposed this in the past and it was refused
>>because we better get rid of the panics and return an error, propagate
>>it and refuse to load the module, better have the machine still alive
>>but without networking than panic it.
>
>
> Sounds good too. Part of my thinking was that these patches would be a
> good chance to review if these are necessarily panic conditions. What was
> the plan on error return, since I expect some caches are interdependent?
I lost track, perhaps we should push this to the janitor mailing list?
:-)
- Arnaldo
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2004-11-14 23:51 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-14 20:18 [PATCH 0/8] Use SLAB_PANIC when creating critical slab cache Chris Wright
2004-11-14 20:20 ` [PATCH 1/8] " Chris Wright
2004-11-14 20:20 ` [PATCH 2/8] " Chris Wright
2004-11-14 20:21 ` [PATCH 3/8] " Chris Wright
2004-11-14 20:22 ` [PATCH 4/8] " Chris Wright
2004-11-14 20:23 ` [PATCH 5/8] " Chris Wright
2004-11-14 20:24 ` [PATCH 6/8] " Chris Wright
2004-11-14 20:27 ` Arnaldo Carvalho de Melo
2004-11-14 22:51 ` Chris Wright
2004-11-14 23:51 ` Arnaldo Carvalho de Melo
2004-11-14 20:24 ` [PATCH 7/8] " Chris Wright
2004-11-14 20:25 ` [PATCH 8/8] " Chris Wright
2004-11-14 23:11 ` [PATCH 0/8] " Christoph Hellwig
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).