Lines Matching refs:objp
332 static unsigned long long *dbg_redzone1(struct kmem_cache *cachep, void *objp) in dbg_redzone1() argument
335 return (unsigned long long*) (objp + obj_offset(cachep) - in dbg_redzone1()
339 static unsigned long long *dbg_redzone2(struct kmem_cache *cachep, void *objp) in dbg_redzone2() argument
343 return (unsigned long long *)(objp + cachep->size - in dbg_redzone2()
346 return (unsigned long long *) (objp + cachep->size - in dbg_redzone2()
350 static void **dbg_userword(struct kmem_cache *cachep, void *objp) in dbg_userword() argument
353 return (void **)(objp + cachep->size - BYTES_PER_WORD); in dbg_userword()
359 #define dbg_redzone1(cachep, objp) ({BUG(); (unsigned long long *)NULL;}) argument
360 #define dbg_redzone2(cachep, objp) ({BUG(); (unsigned long long *)NULL;}) argument
361 #define dbg_userword(cachep, objp) ({BUG(); (void **)NULL;}) argument
594 struct page *page, void *objp) in cache_free_pfmemalloc() argument
604 free_block(cachep, &objp, 1, page_node, &list); in cache_free_pfmemalloc()
648 static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) in cache_free_alien() argument
792 static int __cache_free_alien(struct kmem_cache *cachep, void *objp, in __cache_free_alien() argument
810 ac->entry[ac->avail++] = objp; in __cache_free_alien()
816 free_block(cachep, &objp, 1, page_node, &list); in __cache_free_alien()
823 static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) in cache_free_alien() argument
825 int page_node = page_to_nid(virt_to_page(objp)); in cache_free_alien()
834 return __cache_free_alien(cachep, objp, node, page_node); in cache_free_alien()
1513 static void slab_kernel_map(struct kmem_cache *cachep, void *objp, in slab_kernel_map() argument
1520 store_stackinfo(cachep, objp, caller); in slab_kernel_map()
1522 kernel_map_pages(virt_to_page(objp), cachep->size / PAGE_SIZE, map); in slab_kernel_map()
1526 static inline void slab_kernel_map(struct kmem_cache *cachep, void *objp, in slab_kernel_map() argument
1572 static void print_objinfo(struct kmem_cache *cachep, void *objp, int lines) in print_objinfo() argument
1579 *dbg_redzone1(cachep, objp), in print_objinfo()
1580 *dbg_redzone2(cachep, objp)); in print_objinfo()
1584 pr_err("Last user: (%pSR)\n", *dbg_userword(cachep, objp)); in print_objinfo()
1585 realobj = (char *)objp + obj_offset(cachep); in print_objinfo()
1596 static void check_poison_obj(struct kmem_cache *cachep, void *objp) in check_poison_obj() argument
1605 realobj = (char *)objp + obj_offset(cachep); in check_poison_obj()
1620 print_objinfo(cachep, objp, 0); in check_poison_obj()
1639 struct page *page = virt_to_head_page(objp); in check_poison_obj()
1642 objnr = obj_to_index(cachep, page, objp); in check_poison_obj()
1644 objp = index_to_obj(cachep, page, objnr - 1); in check_poison_obj()
1645 realobj = (char *)objp + obj_offset(cachep); in check_poison_obj()
1647 print_objinfo(cachep, objp, 2); in check_poison_obj()
1650 objp = index_to_obj(cachep, page, objnr + 1); in check_poison_obj()
1651 realobj = (char *)objp + obj_offset(cachep); in check_poison_obj()
1653 print_objinfo(cachep, objp, 2); in check_poison_obj()
1671 void *objp = index_to_obj(cachep, page, i); in slab_destroy_debugcheck() local
1674 check_poison_obj(cachep, objp); in slab_destroy_debugcheck()
1675 slab_kernel_map(cachep, objp, 1, 0); in slab_destroy_debugcheck()
1678 if (*dbg_redzone1(cachep, objp) != RED_INACTIVE) in slab_destroy_debugcheck()
1680 if (*dbg_redzone2(cachep, objp) != RED_INACTIVE) in slab_destroy_debugcheck()
2410 void *objp = index_to_obj(cachep, page, i); in cache_init_objs_debug() local
2413 *dbg_userword(cachep, objp) = NULL; in cache_init_objs_debug()
2416 *dbg_redzone1(cachep, objp) = RED_INACTIVE; in cache_init_objs_debug()
2417 *dbg_redzone2(cachep, objp) = RED_INACTIVE; in cache_init_objs_debug()
2426 objp + obj_offset(cachep)); in cache_init_objs_debug()
2427 cachep->ctor(objp + obj_offset(cachep)); in cache_init_objs_debug()
2429 cachep, objp + obj_offset(cachep)); in cache_init_objs_debug()
2433 if (*dbg_redzone2(cachep, objp) != RED_INACTIVE) in cache_init_objs_debug()
2435 if (*dbg_redzone1(cachep, objp) != RED_INACTIVE) in cache_init_objs_debug()
2440 poison_obj(cachep, objp, POISON_FREE); in cache_init_objs_debug()
2441 slab_kernel_map(cachep, objp, 0, 0); in cache_init_objs_debug()
2562 void *objp; in cache_init_objs() local
2576 objp = index_to_obj(cachep, page, i); in cache_init_objs()
2577 kasan_init_slab_obj(cachep, objp); in cache_init_objs()
2581 kasan_unpoison_object_data(cachep, objp); in cache_init_objs()
2582 cachep->ctor(objp); in cache_init_objs()
2583 kasan_poison_object_data(cachep, objp); in cache_init_objs()
2593 void *objp; in slab_get_obj() local
2595 objp = index_to_obj(cachep, page, get_free_obj(page, page->active)); in slab_get_obj()
2603 return objp; in slab_get_obj()
2607 struct page *page, void *objp) in slab_put_obj() argument
2609 unsigned int objnr = obj_to_index(cachep, page, objp); in slab_put_obj()
2617 cachep->name, objp); in slab_put_obj()
2624 page->freelist = objp + obj_offset(cachep); in slab_put_obj()
2754 static void kfree_debugcheck(const void *objp) in kfree_debugcheck() argument
2756 if (!virt_addr_valid(objp)) { in kfree_debugcheck()
2758 (unsigned long)objp); in kfree_debugcheck()
2785 static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp, in cache_free_debugcheck() argument
2791 BUG_ON(virt_to_cache(objp) != cachep); in cache_free_debugcheck()
2793 objp -= obj_offset(cachep); in cache_free_debugcheck()
2794 kfree_debugcheck(objp); in cache_free_debugcheck()
2795 page = virt_to_head_page(objp); in cache_free_debugcheck()
2798 verify_redzone_free(cachep, objp); in cache_free_debugcheck()
2799 *dbg_redzone1(cachep, objp) = RED_INACTIVE; in cache_free_debugcheck()
2800 *dbg_redzone2(cachep, objp) = RED_INACTIVE; in cache_free_debugcheck()
2804 *dbg_userword(cachep, objp) = (void *)caller; in cache_free_debugcheck()
2807 objnr = obj_to_index(cachep, page, objp); in cache_free_debugcheck()
2810 BUG_ON(objp != index_to_obj(cachep, page, objnr)); in cache_free_debugcheck()
2813 poison_obj(cachep, objp, POISON_FREE); in cache_free_debugcheck()
2814 slab_kernel_map(cachep, objp, 0, caller); in cache_free_debugcheck()
2816 return objp; in cache_free_debugcheck()
2821 #define cache_free_debugcheck(x,objp,z) (objp) argument
2829 void *objp; in fixup_objfreelist_debug() local
2832 objp = next - obj_offset(cachep); in fixup_objfreelist_debug()
2834 poison_obj(cachep, objp, POISON_FREE); in fixup_objfreelist_debug()
2851 void **objp = page->freelist; in fixup_slab_list() local
2853 *objp = *list; in fixup_slab_list()
2854 *list = objp; in fixup_slab_list()
3071 gfp_t flags, void *objp, unsigned long caller) in cache_alloc_debugcheck_after() argument
3074 if (!objp) in cache_alloc_debugcheck_after()
3075 return objp; in cache_alloc_debugcheck_after()
3077 check_poison_obj(cachep, objp); in cache_alloc_debugcheck_after()
3078 slab_kernel_map(cachep, objp, 1, 0); in cache_alloc_debugcheck_after()
3079 poison_obj(cachep, objp, POISON_INUSE); in cache_alloc_debugcheck_after()
3082 *dbg_userword(cachep, objp) = (void *)caller; in cache_alloc_debugcheck_after()
3085 if (*dbg_redzone1(cachep, objp) != RED_INACTIVE || in cache_alloc_debugcheck_after()
3086 *dbg_redzone2(cachep, objp) != RED_INACTIVE) { in cache_alloc_debugcheck_after()
3089 objp, *dbg_redzone1(cachep, objp), in cache_alloc_debugcheck_after()
3090 *dbg_redzone2(cachep, objp)); in cache_alloc_debugcheck_after()
3092 *dbg_redzone1(cachep, objp) = RED_ACTIVE; in cache_alloc_debugcheck_after()
3093 *dbg_redzone2(cachep, objp) = RED_ACTIVE; in cache_alloc_debugcheck_after()
3096 objp += obj_offset(cachep); in cache_alloc_debugcheck_after()
3098 cachep->ctor(objp); in cache_alloc_debugcheck_after()
3100 ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1))) { in cache_alloc_debugcheck_after()
3102 objp, (int)ARCH_SLAB_MINALIGN); in cache_alloc_debugcheck_after()
3104 return objp; in cache_alloc_debugcheck_after()
3107 #define cache_alloc_debugcheck_after(a,b,objp,d) (objp) argument
3112 void *objp; in ____cache_alloc() local
3120 objp = ac->entry[--ac->avail]; in ____cache_alloc()
3127 objp = cache_alloc_refill(cachep, flags); in ____cache_alloc()
3140 if (objp) in ____cache_alloc()
3142 return objp; in ____cache_alloc()
3342 void *objp; in __do_cache_alloc() local
3345 objp = alternate_node_alloc(cache, flags); in __do_cache_alloc()
3346 if (objp) in __do_cache_alloc()
3349 objp = ____cache_alloc(cache, flags); in __do_cache_alloc()
3355 if (!objp) in __do_cache_alloc()
3356 objp = ____cache_alloc_node(cache, flags, numa_mem_id()); in __do_cache_alloc()
3359 return objp; in __do_cache_alloc()
3375 void *objp; in slab_alloc() local
3384 objp = __do_cache_alloc(cachep, flags); in slab_alloc()
3386 objp = cache_alloc_debugcheck_after(cachep, flags, objp, caller); in slab_alloc()
3387 prefetchw(objp); in slab_alloc()
3389 if (unlikely(flags & __GFP_ZERO) && objp) in slab_alloc()
3390 memset(objp, 0, cachep->object_size); in slab_alloc()
3392 slab_post_alloc_hook(cachep, flags, 1, &objp); in slab_alloc()
3393 return objp; in slab_alloc()
3410 void *objp; in free_block() local
3413 objp = objpp[i]; in free_block()
3415 page = virt_to_head_page(objp); in free_block()
3418 slab_put_obj(cachep, page, objp); in free_block()
3494 static __always_inline void __cache_free(struct kmem_cache *cachep, void *objp, in __cache_free() argument
3498 if (kasan_slab_free(cachep, objp, _RET_IP_)) in __cache_free()
3501 ___cache_free(cachep, objp, caller); in __cache_free()
3504 void ___cache_free(struct kmem_cache *cachep, void *objp, in ___cache_free() argument
3510 kmemleak_free_recursive(objp, cachep->flags); in ___cache_free()
3511 objp = cache_free_debugcheck(cachep, objp, caller); in ___cache_free()
3520 if (nr_online_nodes > 1 && cache_free_alien(cachep, objp)) in ___cache_free()
3531 struct page *page = virt_to_head_page(objp); in ___cache_free()
3534 cache_free_pfmemalloc(cachep, page, objp); in ___cache_free()
3539 ac->entry[ac->avail++] = objp; in ___cache_free()
3585 void *objp = __do_cache_alloc(s, flags); in kmem_cache_alloc_bulk() local
3587 if (unlikely(!objp)) in kmem_cache_alloc_bulk()
3589 p[i] = objp; in kmem_cache_alloc_bulk()
3745 void kmem_cache_free(struct kmem_cache *cachep, void *objp) in kmem_cache_free() argument
3748 cachep = cache_from_obj(cachep, objp); in kmem_cache_free()
3753 debug_check_no_locks_freed(objp, cachep->object_size); in kmem_cache_free()
3755 debug_check_no_obj_freed(objp, cachep->object_size); in kmem_cache_free()
3756 __cache_free(cachep, objp, _RET_IP_); in kmem_cache_free()
3759 trace_kmem_cache_free(_RET_IP_, objp); in kmem_cache_free()
3770 void *objp = p[i]; in kmem_cache_free_bulk() local
3773 s = virt_to_cache(objp); in kmem_cache_free_bulk()
3775 s = cache_from_obj(orig_s, objp); in kmem_cache_free_bulk()
3777 debug_check_no_locks_freed(objp, s->object_size); in kmem_cache_free_bulk()
3779 debug_check_no_obj_freed(objp, s->object_size); in kmem_cache_free_bulk()
3781 __cache_free(s, objp, _RET_IP_); in kmem_cache_free_bulk()
3798 void kfree(const void *objp) in kfree() argument
3803 trace_kfree(_RET_IP_, objp); in kfree()
3805 if (unlikely(ZERO_OR_NULL_PTR(objp))) in kfree()
3808 kfree_debugcheck(objp); in kfree()
3809 c = virt_to_cache(objp); in kfree()
3810 debug_check_no_locks_freed(objp, c->object_size); in kfree()
3812 debug_check_no_obj_freed(objp, c->object_size); in kfree()
3813 __cache_free(c, (void *)objp, _RET_IP_); in kfree()
4461 size_t ksize(const void *objp) in ksize() argument
4465 BUG_ON(!objp); in ksize()
4466 if (unlikely(objp == ZERO_SIZE_PTR)) in ksize()
4469 size = virt_to_cache(objp)->object_size; in ksize()
4473 kasan_unpoison_shadow(objp, size); in ksize()