[linux-vrf-core] [PATCH] locking too long -> panic
Status: Beta
Brought to you by:
jleu
From: Yon U. <hav...@gm...> - 2002-12-12 20:04:08
|
Hi, fib_add_vrf() { ... write_lock_bh(...); -> cpu_bh_disable(...) -> -> irq_stats.__local_bh_count++ ... 3x __fib_new_table(); -> fib_hash_init -> -> kmalloc(, GFP_KERNEL) /* allocs from the 256 bytes pool */ } eventually (aint randomness fun) the slab cache entry for 256 must grow, and it hits: if (in_interrupt() && (flags & SLAB_LEVEL_MASK) != SLAB_ATOMIC) BUG(); in_interrupt() checks for "(... +irq_stats.__local_bh_count) != 0" Anyway, now for my voodoo explanation of locking: On SMP the function is protected by lock_kernel() (in inet_ioctl()), on UP no write access can happen, 'cos this is user context and it is unpreemptable, and no BH will write-access the values. So basically, only the last assigment needs to be protected (not the "kmalloc"s ), and the check for if (fib_rules[vrf]) return -EEXIST; is outside the protected region anyway. enjoy, yon |