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 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux

Pull slab updates from Pekka Enberg:
"Mainly a bunch of SLUB fixes from Joonsoo Kim"

* 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux:
slub: use __SetPageSlab function to set PG_slab flag
slub: fix a memory leak in get_partial_node()
slub: remove unused argument of init_kmem_cache_node()
slub: fix a possible memory leak
Documentations: Fix slabinfo.c directory in vm/slub.txt
slub: fix incorrect return type of get_any_partial()

+14 -11
+1 -1
Documentation/vm/slub.txt
··· 17 17 slabs that have data in them. See "slabinfo -h" for more options when 18 18 running the command. slabinfo can be compiled with 19 19 20 - gcc -o slabinfo tools/slub/slabinfo.c 20 + gcc -o slabinfo tools/vm/slabinfo.c 21 21 22 22 Some of the modes of operation of slabinfo require that slub debugging 23 23 be enabled on the command line. F.e. no tracking information will be
+13 -10
mm/slub.c
··· 1369 1369 1370 1370 inc_slabs_node(s, page_to_nid(page), page->objects); 1371 1371 page->slab = s; 1372 - page->flags |= 1 << PG_slab; 1372 + __SetPageSlab(page); 1373 1373 1374 1374 start = page_address(page); 1375 1375 ··· 1514 1514 freelist = page->freelist; 1515 1515 counters = page->counters; 1516 1516 new.counters = counters; 1517 - if (mode) 1517 + if (mode) { 1518 1518 new.inuse = page->objects; 1519 + new.freelist = NULL; 1520 + } else { 1521 + new.freelist = freelist; 1522 + } 1519 1523 1520 1524 VM_BUG_ON(new.frozen); 1521 1525 new.frozen = 1; 1522 1526 1523 1527 } while (!__cmpxchg_double_slab(s, page, 1524 1528 freelist, counters, 1525 - NULL, new.counters, 1529 + new.freelist, new.counters, 1526 1530 "lock and freeze")); 1527 1531 1528 1532 remove_partial(n, page); ··· 1568 1564 object = t; 1569 1565 available = page->objects - page->inuse; 1570 1566 } else { 1571 - page->freelist = t; 1572 1567 available = put_cpu_partial(s, page, 0); 1573 1568 stat(s, CPU_PARTIAL_NODE); 1574 1569 } ··· 1582 1579 /* 1583 1580 * Get a page from somewhere. Search in increasing NUMA distances. 1584 1581 */ 1585 - static struct page *get_any_partial(struct kmem_cache *s, gfp_t flags, 1582 + static void *get_any_partial(struct kmem_cache *s, gfp_t flags, 1586 1583 struct kmem_cache_cpu *c) 1587 1584 { 1588 1585 #ifdef CONFIG_NUMA ··· 2769 2766 } 2770 2767 2771 2768 static void 2772 - init_kmem_cache_node(struct kmem_cache_node *n, struct kmem_cache *s) 2769 + init_kmem_cache_node(struct kmem_cache_node *n) 2773 2770 { 2774 2771 n->nr_partial = 0; 2775 2772 spin_lock_init(&n->list_lock); ··· 2839 2836 init_object(kmem_cache_node, n, SLUB_RED_ACTIVE); 2840 2837 init_tracking(kmem_cache_node, n); 2841 2838 #endif 2842 - init_kmem_cache_node(n, kmem_cache_node); 2839 + init_kmem_cache_node(n); 2843 2840 inc_slabs_node(kmem_cache_node, node, page->objects); 2844 2841 2845 2842 add_partial(n, page, DEACTIVATE_TO_HEAD); ··· 2879 2876 } 2880 2877 2881 2878 s->node[node] = n; 2882 - init_kmem_cache_node(n, s); 2879 + init_kmem_cache_node(n); 2883 2880 } 2884 2881 return 1; 2885 2882 } ··· 3628 3625 ret = -ENOMEM; 3629 3626 goto out; 3630 3627 } 3631 - init_kmem_cache_node(n, s); 3628 + init_kmem_cache_node(n); 3632 3629 s->node[nid] = n; 3633 3630 } 3634 3631 out: ··· 3971 3968 } 3972 3969 return s; 3973 3970 } 3974 - kfree(n); 3975 3971 kfree(s); 3976 3972 } 3973 + kfree(n); 3977 3974 err: 3978 3975 up_write(&slub_lock); 3979 3976