Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
slub: #ifdef simplification
slabinfo: Support printout of the number of fallbacks
slub: Whitespace cleanup and use of strict_strtoul

+34 -22
+6 -4
Documentation/vm/slabinfo.c
··· 38 38 unsigned long alloc_from_partial, alloc_slab, free_slab, alloc_refill; 39 39 unsigned long cpuslab_flush, deactivate_full, deactivate_empty; 40 40 unsigned long deactivate_to_head, deactivate_to_tail; 41 - unsigned long deactivate_remote_frees; 41 + unsigned long deactivate_remote_frees, order_fallback; 42 42 int numa[MAX_NODES]; 43 43 int numa_partial[MAX_NODES]; 44 44 } slabinfo[MAX_SLABS]; ··· 293 293 void first_line(void) 294 294 { 295 295 if (show_activity) 296 - printf("Name Objects Alloc Free %%Fast\n"); 296 + printf("Name Objects Alloc Free %%Fast Fallb O\n"); 297 297 else 298 298 printf("Name Objects Objsize Space " 299 299 "Slabs/Part/Cpu O/S O %%Fr %%Ef Flg\n"); ··· 573 573 total_alloc = s->alloc_fastpath + s->alloc_slowpath; 574 574 total_free = s->free_fastpath + s->free_slowpath; 575 575 576 - printf("%-21s %8ld %8ld %8ld %3ld %3ld \n", 576 + printf("%-21s %8ld %10ld %10ld %3ld %3ld %5ld %1d\n", 577 577 s->name, s->objects, 578 578 total_alloc, total_free, 579 579 total_alloc ? (s->alloc_fastpath * 100 / total_alloc) : 0, 580 - total_free ? (s->free_fastpath * 100 / total_free) : 0); 580 + total_free ? (s->free_fastpath * 100 / total_free) : 0, 581 + s->order_fallback, s->order); 581 582 } 582 583 else 583 584 printf("%-21s %8ld %7d %8s %14s %4d %1d %3ld %3ld %s\n", ··· 1189 1188 slab->deactivate_to_head = get_obj("deactivate_to_head"); 1190 1189 slab->deactivate_to_tail = get_obj("deactivate_to_tail"); 1191 1190 slab->deactivate_remote_frees = get_obj("deactivate_remote_frees"); 1191 + slab->order_fallback = get_obj("order_fallback"); 1192 1192 chdir(".."); 1193 1193 if (slab->name[0] == ':') 1194 1194 alias_targets++;
+1 -1
init/Kconfig
··· 720 720 config SLUB_DEBUG 721 721 default y 722 722 bool "Enable SLUB debugging support" if EMBEDDED 723 - depends on SLUB 723 + depends on SLUB && SYSFS 724 724 help 725 725 SLUB has extensive debug support features. Disabling these can 726 726 result in significant savings in code size. This also disables
+27 -17
mm/slub.c
··· 217 217 218 218 enum track_item { TRACK_ALLOC, TRACK_FREE }; 219 219 220 - #if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG) 220 + #ifdef CONFIG_SLUB_DEBUG 221 221 static int sysfs_slab_add(struct kmem_cache *); 222 222 static int sysfs_slab_alias(struct kmem_cache *, const char *); 223 223 static void sysfs_slab_remove(struct kmem_cache *); ··· 814 814 return search == NULL; 815 815 } 816 816 817 - static void trace(struct kmem_cache *s, struct page *page, void *object, int alloc) 817 + static void trace(struct kmem_cache *s, struct page *page, void *object, 818 + int alloc) 818 819 { 819 820 if (s->flags & SLAB_TRACE) { 820 821 printk(KERN_INFO "TRACE %s %s 0x%p inuse=%d fp=0x%p\n", ··· 1268 1267 spin_unlock(&n->list_lock); 1269 1268 } 1270 1269 1271 - static void remove_partial(struct kmem_cache *s, 1272 - struct page *page) 1270 + static void remove_partial(struct kmem_cache *s, struct page *page) 1273 1271 { 1274 1272 struct kmem_cache_node *n = get_node(s, page_to_nid(page)); 1275 1273 ··· 1283 1283 * 1284 1284 * Must hold list_lock. 1285 1285 */ 1286 - static inline int lock_and_freeze_slab(struct kmem_cache_node *n, struct page *page) 1286 + static inline int lock_and_freeze_slab(struct kmem_cache_node *n, 1287 + struct page *page) 1287 1288 { 1288 1289 if (slab_trylock(page)) { 1289 1290 list_del(&page->lru); ··· 1421 1420 * so that the others get filled first. That way the 1422 1421 * size of the partial list stays small. 1423 1422 * 1424 - * kmem_cache_shrink can reclaim any empty slabs from the 1425 - * partial list. 1423 + * kmem_cache_shrink can reclaim any empty slabs from 1424 + * the partial list. 1426 1425 */ 1427 1426 add_partial(n, page, 1); 1428 1427 slab_unlock(page); ··· 2910 2909 return 0; 2911 2910 2912 2911 /* 2913 - * We are bringing a node online. No memory is availabe yet. We must 2912 + * We are bringing a node online. No memory is available yet. We must 2914 2913 * allocate a kmem_cache_node structure in order to bring the node 2915 2914 * online. 2916 2915 */ ··· 3247 3246 return slab_alloc(s, gfpflags, node, caller); 3248 3247 } 3249 3248 3250 - #if (defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)) || defined(CONFIG_SLABINFO) 3249 + #ifdef CONFIG_SLUB_DEBUG 3251 3250 static unsigned long count_partial(struct kmem_cache_node *n, 3252 3251 int (*get_count)(struct page *)) 3253 3252 { ··· 3276 3275 { 3277 3276 return page->objects - page->inuse; 3278 3277 } 3279 - #endif 3280 3278 3281 - #if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG) 3282 3279 static int validate_slab(struct kmem_cache *s, struct page *page, 3283 3280 unsigned long *map) 3284 3281 { ··· 3811 3812 static ssize_t order_store(struct kmem_cache *s, 3812 3813 const char *buf, size_t length) 3813 3814 { 3814 - int order = simple_strtoul(buf, NULL, 10); 3815 + unsigned long order; 3816 + int err; 3817 + 3818 + err = strict_strtoul(buf, 10, &order); 3819 + if (err) 3820 + return err; 3815 3821 3816 3822 if (order > slub_max_order || order < slub_min_order) 3817 3823 return -EINVAL; ··· 4069 4065 static ssize_t remote_node_defrag_ratio_store(struct kmem_cache *s, 4070 4066 const char *buf, size_t length) 4071 4067 { 4072 - int n = simple_strtoul(buf, NULL, 10); 4068 + unsigned long ratio; 4069 + int err; 4073 4070 4074 - if (n < 100) 4075 - s->remote_node_defrag_ratio = n * 10; 4071 + err = strict_strtoul(buf, 10, &ratio); 4072 + if (err) 4073 + return err; 4074 + 4075 + if (ratio < 100) 4076 + s->remote_node_defrag_ratio = ratio * 10; 4077 + 4076 4078 return length; 4077 4079 } 4078 4080 SLAB_ATTR(remote_node_defrag_ratio); ··· 4435 4425 */ 4436 4426 #ifdef CONFIG_SLABINFO 4437 4427 4438 - ssize_t slabinfo_write(struct file *file, const char __user * buffer, 4439 - size_t count, loff_t *ppos) 4428 + ssize_t slabinfo_write(struct file *file, const char __user *buffer, 4429 + size_t count, loff_t *ppos) 4440 4430 { 4441 4431 return -EINVAL; 4442 4432 }