| /linux/mm/ |
| H A D | slab.h | 74 struct slab { struct 95 static_assert(offsetof(struct page, pg) == offsetof(struct slab, sl)) argument 105 static_assert(sizeof(struct slab) <= sizeof(struct page)); 107 static_assert(IS_ALIGNED(offsetof(struct slab, freelist), sizeof(struct freelist_counters))); 122 const struct slab *: (const struct folio *)s, \ 123 struct slab *: (struct folio *)s)) 132 static inline struct slab *page_slab(const struct page *page) in page_slab() 138 return (struct slab *)page; in page_slab() 151 static inline void *slab_address(const struct slab *slab) in slab_address() argument 153 return folio_address(slab_folio(slab)); in slab_address() [all …]
|
| H A D | slub.c | 608 static inline bool slab_test_pfmemalloc(const struct slab *slab) in slab_test_pfmemalloc() argument 610 return test_bit(SL_pfmemalloc, &slab->flags.f); in slab_test_pfmemalloc() 613 static inline void slab_set_pfmemalloc(struct slab *slab) in slab_set_pfmemalloc() argument 615 set_bit(SL_pfmemalloc, &slab->flags.f); in slab_set_pfmemalloc() 618 static inline void __slab_clear_pfmemalloc(struct slab *slab) in __slab_clear_pfmemalloc() argument 620 __clear_bit(SL_pfmemalloc, &slab->flags.f); in __slab_clear_pfmemalloc() 626 static __always_inline void slab_lock(struct slab *slab) in slab_lock() argument 628 bit_spin_lock(SL_locked, &slab->flags.f); in slab_lock() 631 static __always_inline void slab_unlock(struct slab *slab) in slab_unlock() argument 633 bit_spin_unlock(SL_locked, &slab->flags.f); in slab_unlock() [all …]
|
| H A D | usercopy.c | 168 struct slab *slab; in check_heap_object() local 194 slab = page_slab(page); in check_heap_object() 195 if (slab) { in check_heap_object() 197 __check_heap_object(ptr, n, slab, to_user); in check_heap_object()
|
| H A D | slab_common.c | 616 static void kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *slab) in kmem_obj_info() argument 618 if (__kfence_obj_info(kpp, object, slab)) in kmem_obj_info() 620 __kmem_obj_info(kpp, object, slab); in kmem_obj_info() 642 struct slab *slab; in kmem_dump_obj() local 649 slab = virt_to_slab(object); in kmem_dump_obj() 650 if (!slab) in kmem_dump_obj() 653 kmem_obj_info(&kp, object, slab); in kmem_dump_obj() 1248 struct slab *slab; in bpf_get_kmem_cache() local 1253 slab = virt_to_slab((void *)(long)addr); in bpf_get_kmem_cache() 1254 return slab ? slab->slab_cache : NULL; in bpf_get_kmem_cache() [all …]
|
| H A D | memcontrol.c | 2831 struct mem_cgroup *mem_cgroup_from_obj_slab(struct slab *slab, void *p) in mem_cgroup_from_obj_slab() argument 2842 obj_exts = slab_obj_exts(slab); in mem_cgroup_from_obj_slab() 2847 off = obj_to_index(slab->slab_cache, slab, p); in mem_cgroup_from_obj_slab() 2848 obj_ext = slab_obj_ext(slab, obj_exts, off); in mem_cgroup_from_obj_slab() 2871 struct slab *slab; in mem_cgroup_from_virt() local 2876 slab = virt_to_slab(p); in mem_cgroup_from_virt() 2877 if (slab) in mem_cgroup_from_virt() 2878 return mem_cgroup_from_obj_slab(slab, p); in mem_cgroup_from_virt() 3431 struct slab *slab; in __memcg_slab_post_alloc_hook() local 3472 slab = virt_to_slab(p[i]); in __memcg_slab_post_alloc_hook() [all …]
|
| /linux/Documentation/ABI/testing/ |
| H A D | sysfs-kernel-slab | 1 What: /sys/kernel/slab 7 The /sys/kernel/slab directory contains a snapshot of the 13 What: /sys/kernel/slab/<cache>/aliases 22 What: /sys/kernel/slab/<cache>/align 31 What: /sys/kernel/slab/<cache>/alloc_calls 41 Documentation/admin-guide/mm/slab.rst). 43 What: /sys/kernel/slab/<cache>/alloc_fastpath 54 What: /sys/kernel/slab/<cache>/alloc_from_partial 60 The alloc_from_partial file shows how many times a cpu slab has 61 been full and it has been refilled by using a slab from the list [all …]
|
| /linux/tools/mm/ |
| H A D | slabinfo.c | 54 struct slabinfo *slab; member 114 "slabinfo [-aABDefhilLnoPrsStTUvXz1] [N=K] [-dafzput] [slab-regexp]\n" in usage() 247 snprintf(x, 128, "/sys/kernel/debug/slab/%s/%s", s->name, name); in read_debug_slab_obj() 352 * Find the shortest alias of a slab 360 if (a->slab == find && in find_one_alias() 798 fprintf(stderr, "%s can only enable trace for one slab at a time\n", s->name); in slab_debug() 819 /* Number of slabs in a slab cache */ in totals() 823 /* Size of the whole slab */ in totals() 827 /* Bytes used for object storage in a slab */ in totals() 834 /* Number of objects in a slab */ in totals() 1209 slab_mismatch(char * slab) slab_mismatch() argument 1218 struct slabinfo *slab = slabinfo; read_slab_dir() local 1326 struct slabinfo *slab; output_slabs() local [all...] |
| /linux/mm/kasan/ |
| H A D | common.c | 45 struct slab *kasan_addr_to_slab(const void *addr) in kasan_addr_to_slab() 155 void __kasan_poison_slab(struct slab *slab) in __kasan_poison_slab() argument 157 struct page *page = slab_page(slab); in __kasan_poison_slab() 461 struct slab *slab; in __kasan_krealloc() local 479 slab = virt_to_slab(object); in __kasan_krealloc() 482 if (unlikely(!slab)) in __kasan_krealloc() 485 poison_kmalloc_redzone(slab->slab_cache, object, size, flags); in __kasan_krealloc() 522 struct slab *slab; in __kasan_mempool_poison_object() local 534 slab = page_slab(page); in __kasan_mempool_poison_object() 536 if (check_slab_allocation(slab->slab_cache, ptr, ip)) in __kasan_mempool_poison_object() [all …]
|
| H A D | generic.c | 541 struct slab *slab = kasan_addr_to_slab(addr); in kasan_record_aux_stack() local 546 if (is_kfence_address(addr) || !slab) in kasan_record_aux_stack() 549 cache = slab->slab_cache; in kasan_record_aux_stack() 550 object = nearest_obj(cache, slab, addr); in kasan_record_aux_stack()
|
| /linux/scripts/gdb/linux/ |
| H A D | slab.py | 38 def slab_folio(slab): argument 39 return slab.cast(gdb.lookup_type("struct folio").pointer()) 41 def slab_address(slab): argument 43 folio = slab_folio(slab) 155 def __fill_map(obj_map, cache, slab): argument 156 p = slab['freelist'] 157 addr = slab_address(slab) 165 for slab in lists.list_for_each_entry(slab_list, slab_ptr_type, "slab_list"): 167 __fill_map(obj_map, cache, slab) 168 addr = slab_address(slab) [all …]
|
| /linux/tools/cgroup/ |
| H A D | memcg_slabinfo.py | 73 for slab in list_for_each_entry('struct slab', n.partial.address_of_(), 75 nr_objs += fn(slab) 79 def count_free(slab): argument 80 return slab.objects - slab.inuse 194 for slab in for_each_slab(prog): 195 objcg_vec_raw = slab.memcg_data.value_() 198 cache = slab.slab_cache
|
| /linux/Documentation/admin-guide/mm/ |
| H A D | slab.rst | 2 Short users guide for the slab allocator 5 The slab allocator includes full debugging support (when built with 37 slab_debug=<Debug-Options>,<slab name1>,<slab name2>,... 44 of the first "select slabs" blocks that matches the slab's name are applied. 56 caused higher minimum slab orders 69 end of the slab name, in order to cover all slabs with the same prefix. For 75 Red zoning and tracking may realign the slab. We can just apply sanity checks 80 Debugging options may require the minimum possible slab order to increase as 82 sizes). This has a higher likelihood of resulting in slab allocation errors 88 You can apply different options to different list of slab names, using blocks [all …]
|
| /linux/lib/ |
| H A D | sg_pool.c | 13 struct kmem_cache *slab; member 150 sgp->slab = kmem_cache_create(sgp->name, size, 0, in sg_pool_init() 152 if (!sgp->slab) { in sg_pool_init() 159 sgp->slab); in sg_pool_init() 174 kmem_cache_destroy(sgp->slab); in sg_pool_init()
|
| /linux/include/linux/ |
| H A D | kfence.h | 222 bool __kfence_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *slab); 246 static inline bool __kfence_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *slab) in __kfence_obj_info() argument
|
| /linux/net/dccp/ |
| H A D | ccid.c | |
| /linux/tools/perf/Documentation/ |
| H A D | perf-kmem.txt | 47 Sort the output (default: 'frag,hit,bytes' for slab and 'bytes,hit' 49 pingpong, frag' for slab and 'page, callsite, bytes, hit, order, 51 mode selection options - i.e. --slab, --page, --alloc and/or --caller. 60 --slab::
|
| /linux/mm/kfence/ |
| H A D | core.c | 426 struct slab *slab; in kfence_guarded_alloc() local 494 slab = virt_to_slab(addr); in kfence_guarded_alloc() 495 slab->slab_cache = cache; in kfence_guarded_alloc() 496 slab->objects = 1; in kfence_guarded_alloc() 635 struct slab *slab = page_slab(page); in kfence_init_pool() local 636 slab->obj_exts = (unsigned long)&kfence_metadata_init[i / 2 - 1].obj_exts | in kfence_init_pool() 703 struct slab *slab = page_slab(page); in kfence_init_pool() local 704 slab->obj_exts = 0; in kfence_init_pool()
|
| /linux/tools/testing/scatterlist/ |
| H A D | Makefile | 17 … $(OFILES) scatterlist.c linux/scatterlist.h linux/highmem.h linux/kmemleak.h linux/slab.h asm/io.h 31 @touch linux/slab.h
|
| /linux/Documentation/translations/zh_CN/mm/ |
| H A D | split_page_table_lock.rst | 62 确保架构不使用slab分配器来分配页表:slab使用page->slab_cache来分配其页
|
| /linux/Documentation/translations/zh_CN/core-api/ |
| H A D | memory-allocation.rst | 131 如果你需要分配许多相同的对象,你可以使用slab缓存分配器。在使用缓存之前,应该用 137 和 `kvmalloc` 分配的内存。slab缓存应该用kmem_cache_free()来释放。不要忘记用
|
| H A D | mm-api.rst | 49 include/linux/slab.h 51 mm/slab.c
|
| /linux/tools/testing/memblock/ |
| H A D | Makefile | 11 DEP_OFILES = memblock.o lib/slab.o mmzone.o slab.o cmdline.o
|
| /linux/block/ |
| H A D | bio.c | 43 struct kmem_cache *slab; member 80 struct kmem_cache *slab; member 96 bslab->slab = kmem_cache_create(bslab->name, size, in create_bio_slab() 99 if (!bslab->slab) in create_bio_slab() 108 kmem_cache_destroy(bslab->slab); in create_bio_slab() 139 return bslab->slab; in bio_find_or_create_slab() 154 WARN_ON_ONCE(bslab->slab != bs->bio_slab); in bio_put_slab() 163 kmem_cache_destroy(bslab->slab); in bio_put_slab() 207 kmem_cache_free(biovec_slab(bio->bi_max_vecs)->slab, in bio_free() 571 bvecs = kmem_cache_alloc(bvs->slab, gfp); in bio_alloc_bioset() [all …]
|
| /linux/Documentation/mm/ |
| H A D | slab.rst | 10 .. kernel-doc:: mm/slab.h
|
| /linux/scripts/gdb/ |
| H A D | vmlinux-gdb.py | 50 import linux.slab
|