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
552 struct page *page, void *objp) in cache_free_pfmemalloc() argument
562 free_block(cachep, &objp, 1, page_node, &list); in cache_free_pfmemalloc()
606 static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) in cache_free_alien() argument
752 static int __cache_free_alien(struct kmem_cache *cachep, void *objp, in __cache_free_alien() argument
770 ac->entry[ac->avail++] = objp; in __cache_free_alien()
776 free_block(cachep, &objp, 1, page_node, &list); in __cache_free_alien()
783 static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) in cache_free_alien() argument
785 int page_node = page_to_nid(virt_to_page(objp)); in cache_free_alien()
794 return __cache_free_alien(cachep, objp, node, page_node); in cache_free_alien()
1426 static void slab_kernel_map(struct kmem_cache *cachep, void *objp, int map) in slab_kernel_map() argument
1431 kernel_map_pages(virt_to_page(objp), cachep->size / PAGE_SIZE, map); in slab_kernel_map()
1435 static inline void slab_kernel_map(struct kmem_cache *cachep, void *objp, in slab_kernel_map() argument
1481 static void print_objinfo(struct kmem_cache *cachep, void *objp, int lines) in print_objinfo() argument
1488 *dbg_redzone1(cachep, objp), in print_objinfo()
1489 *dbg_redzone2(cachep, objp)); in print_objinfo()
1493 pr_err("Last user: (%pSR)\n", *dbg_userword(cachep, objp)); in print_objinfo()
1494 realobj = (char *)objp + obj_offset(cachep); in print_objinfo()
1505 static void check_poison_obj(struct kmem_cache *cachep, void *objp) in check_poison_obj() argument
1514 realobj = (char *)objp + obj_offset(cachep); in check_poison_obj()
1529 print_objinfo(cachep, objp, 0); in check_poison_obj()
1548 struct page *page = virt_to_head_page(objp); in check_poison_obj()
1551 objnr = obj_to_index(cachep, page, objp); in check_poison_obj()
1553 objp = index_to_obj(cachep, page, objnr - 1); in check_poison_obj()
1554 realobj = (char *)objp + obj_offset(cachep); in check_poison_obj()
1556 print_objinfo(cachep, objp, 2); in check_poison_obj()
1559 objp = index_to_obj(cachep, page, objnr + 1); in check_poison_obj()
1560 realobj = (char *)objp + obj_offset(cachep); in check_poison_obj()
1562 print_objinfo(cachep, objp, 2); in check_poison_obj()
1580 void *objp = index_to_obj(cachep, page, i); in slab_destroy_debugcheck() local
1583 check_poison_obj(cachep, objp); in slab_destroy_debugcheck()
1584 slab_kernel_map(cachep, objp, 1); in slab_destroy_debugcheck()
1587 if (*dbg_redzone1(cachep, objp) != RED_INACTIVE) in slab_destroy_debugcheck()
1589 if (*dbg_redzone2(cachep, objp) != RED_INACTIVE) in slab_destroy_debugcheck()
2337 void *objp = index_to_obj(cachep, page, i); in cache_init_objs_debug() local
2340 *dbg_userword(cachep, objp) = NULL; in cache_init_objs_debug()
2343 *dbg_redzone1(cachep, objp) = RED_INACTIVE; in cache_init_objs_debug()
2344 *dbg_redzone2(cachep, objp) = RED_INACTIVE; in cache_init_objs_debug()
2353 objp + obj_offset(cachep)); in cache_init_objs_debug()
2354 cachep->ctor(objp + obj_offset(cachep)); in cache_init_objs_debug()
2356 cachep, objp + obj_offset(cachep)); in cache_init_objs_debug()
2360 if (*dbg_redzone2(cachep, objp) != RED_INACTIVE) in cache_init_objs_debug()
2362 if (*dbg_redzone1(cachep, objp) != RED_INACTIVE) in cache_init_objs_debug()
2367 poison_obj(cachep, objp, POISON_FREE); in cache_init_objs_debug()
2368 slab_kernel_map(cachep, objp, 0); in cache_init_objs_debug()
2489 void *objp; in cache_init_objs() local
2503 objp = index_to_obj(cachep, page, i); in cache_init_objs()
2504 objp = kasan_init_slab_obj(cachep, objp); in cache_init_objs()
2508 kasan_unpoison_object_data(cachep, objp); in cache_init_objs()
2509 cachep->ctor(objp); in cache_init_objs()
2510 kasan_poison_object_data(cachep, objp); in cache_init_objs()
2520 void *objp; in slab_get_obj() local
2522 objp = index_to_obj(cachep, page, get_free_obj(page, page->active)); in slab_get_obj()
2525 return objp; in slab_get_obj()
2529 struct page *page, void *objp) in slab_put_obj() argument
2531 unsigned int objnr = obj_to_index(cachep, page, objp); in slab_put_obj()
2539 cachep->name, objp); in slab_put_obj()
2546 page->freelist = objp + obj_offset(cachep); in slab_put_obj()
2682 static void kfree_debugcheck(const void *objp) in kfree_debugcheck() argument
2684 if (!virt_addr_valid(objp)) { in kfree_debugcheck()
2686 (unsigned long)objp); in kfree_debugcheck()
2713 static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp, in cache_free_debugcheck() argument
2719 BUG_ON(virt_to_cache(objp) != cachep); in cache_free_debugcheck()
2721 objp -= obj_offset(cachep); in cache_free_debugcheck()
2722 kfree_debugcheck(objp); in cache_free_debugcheck()
2723 page = virt_to_head_page(objp); in cache_free_debugcheck()
2726 verify_redzone_free(cachep, objp); in cache_free_debugcheck()
2727 *dbg_redzone1(cachep, objp) = RED_INACTIVE; in cache_free_debugcheck()
2728 *dbg_redzone2(cachep, objp) = RED_INACTIVE; in cache_free_debugcheck()
2731 *dbg_userword(cachep, objp) = (void *)caller; in cache_free_debugcheck()
2733 objnr = obj_to_index(cachep, page, objp); in cache_free_debugcheck()
2736 BUG_ON(objp != index_to_obj(cachep, page, objnr)); in cache_free_debugcheck()
2739 poison_obj(cachep, objp, POISON_FREE); in cache_free_debugcheck()
2740 slab_kernel_map(cachep, objp, 0); in cache_free_debugcheck()
2742 return objp; in cache_free_debugcheck()
2747 #define cache_free_debugcheck(x,objp,z) (objp) argument
2755 void *objp; in fixup_objfreelist_debug() local
2758 objp = next - obj_offset(cachep); in fixup_objfreelist_debug()
2760 poison_obj(cachep, objp, POISON_FREE); in fixup_objfreelist_debug()
2777 void **objp = page->freelist; in fixup_slab_list() local
2779 *objp = *list; in fixup_slab_list()
2780 *list = objp; in fixup_slab_list()
2998 gfp_t flags, void *objp, unsigned long caller) in cache_alloc_debugcheck_after() argument
3001 if (!objp) in cache_alloc_debugcheck_after()
3002 return objp; in cache_alloc_debugcheck_after()
3004 check_poison_obj(cachep, objp); in cache_alloc_debugcheck_after()
3005 slab_kernel_map(cachep, objp, 1); in cache_alloc_debugcheck_after()
3006 poison_obj(cachep, objp, POISON_INUSE); in cache_alloc_debugcheck_after()
3009 *dbg_userword(cachep, objp) = (void *)caller; in cache_alloc_debugcheck_after()
3012 if (*dbg_redzone1(cachep, objp) != RED_INACTIVE || in cache_alloc_debugcheck_after()
3013 *dbg_redzone2(cachep, objp) != RED_INACTIVE) { in cache_alloc_debugcheck_after()
3016 objp, *dbg_redzone1(cachep, objp), in cache_alloc_debugcheck_after()
3017 *dbg_redzone2(cachep, objp)); in cache_alloc_debugcheck_after()
3019 *dbg_redzone1(cachep, objp) = RED_ACTIVE; in cache_alloc_debugcheck_after()
3020 *dbg_redzone2(cachep, objp) = RED_ACTIVE; in cache_alloc_debugcheck_after()
3023 objp += obj_offset(cachep); in cache_alloc_debugcheck_after()
3025 cachep->ctor(objp); in cache_alloc_debugcheck_after()
3027 ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1))) { in cache_alloc_debugcheck_after()
3029 objp, (int)ARCH_SLAB_MINALIGN); in cache_alloc_debugcheck_after()
3031 return objp; in cache_alloc_debugcheck_after()
3034 #define cache_alloc_debugcheck_after(a,b,objp,d) (objp) argument
3039 void *objp; in ____cache_alloc() local
3047 objp = ac->entry[--ac->avail]; in ____cache_alloc()
3054 objp = cache_alloc_refill(cachep, flags); in ____cache_alloc()
3067 if (objp) in ____cache_alloc()
3069 return objp; in ____cache_alloc()
3269 void *objp; in __do_cache_alloc() local
3272 objp = alternate_node_alloc(cache, flags); in __do_cache_alloc()
3273 if (objp) in __do_cache_alloc()
3276 objp = ____cache_alloc(cache, flags); in __do_cache_alloc()
3282 if (!objp) in __do_cache_alloc()
3283 objp = ____cache_alloc_node(cache, flags, numa_mem_id()); in __do_cache_alloc()
3286 return objp; in __do_cache_alloc()
3302 void *objp; in slab_alloc() local
3311 objp = __do_cache_alloc(cachep, flags); in slab_alloc()
3313 objp = cache_alloc_debugcheck_after(cachep, flags, objp, caller); in slab_alloc()
3314 prefetchw(objp); in slab_alloc()
3316 if (unlikely(slab_want_init_on_alloc(flags, cachep)) && objp) in slab_alloc()
3317 memset(objp, 0, cachep->object_size); in slab_alloc()
3319 slab_post_alloc_hook(cachep, flags, 1, &objp); in slab_alloc()
3320 return objp; in slab_alloc()
3337 void *objp; in free_block() local
3340 objp = objpp[i]; in free_block()
3342 page = virt_to_head_page(objp); in free_block()
3345 slab_put_obj(cachep, page, objp); in free_block()
3421 static __always_inline void __cache_free(struct kmem_cache *cachep, void *objp, in __cache_free() argument
3425 if (kasan_slab_free(cachep, objp, _RET_IP_)) in __cache_free()
3428 ___cache_free(cachep, objp, caller); in __cache_free()
3431 void ___cache_free(struct kmem_cache *cachep, void *objp, in ___cache_free() argument
3438 memset(objp, 0, cachep->object_size); in ___cache_free()
3439 kmemleak_free_recursive(objp, cachep->flags); in ___cache_free()
3440 objp = cache_free_debugcheck(cachep, objp, caller); in ___cache_free()
3449 if (nr_online_nodes > 1 && cache_free_alien(cachep, objp)) in ___cache_free()
3460 struct page *page = virt_to_head_page(objp); in ___cache_free()
3463 cache_free_pfmemalloc(cachep, page, objp); in ___cache_free()
3468 ac->entry[ac->avail++] = objp; in ___cache_free()
3515 void *objp = __do_cache_alloc(s, flags); in kmem_cache_alloc_bulk() local
3517 if (unlikely(!objp)) in kmem_cache_alloc_bulk()
3519 p[i] = objp; in kmem_cache_alloc_bulk()
3682 void kmem_cache_free(struct kmem_cache *cachep, void *objp) in kmem_cache_free() argument
3685 cachep = cache_from_obj(cachep, objp); in kmem_cache_free()
3690 debug_check_no_locks_freed(objp, cachep->object_size); in kmem_cache_free()
3692 debug_check_no_obj_freed(objp, cachep->object_size); in kmem_cache_free()
3693 __cache_free(cachep, objp, _RET_IP_); in kmem_cache_free()
3696 trace_kmem_cache_free(_RET_IP_, objp); in kmem_cache_free()
3707 void *objp = p[i]; in kmem_cache_free_bulk() local
3710 s = virt_to_cache(objp); in kmem_cache_free_bulk()
3712 s = cache_from_obj(orig_s, objp); in kmem_cache_free_bulk()
3716 debug_check_no_locks_freed(objp, s->object_size); in kmem_cache_free_bulk()
3718 debug_check_no_obj_freed(objp, s->object_size); in kmem_cache_free_bulk()
3720 __cache_free(s, objp, _RET_IP_); in kmem_cache_free_bulk()
3737 void kfree(const void *objp) in kfree() argument
3742 trace_kfree(_RET_IP_, objp); in kfree()
3744 if (unlikely(ZERO_OR_NULL_PTR(objp))) in kfree()
3747 kfree_debugcheck(objp); in kfree()
3748 c = virt_to_cache(objp); in kfree()
3753 debug_check_no_locks_freed(objp, c->object_size); in kfree()
3755 debug_check_no_obj_freed(objp, c->object_size); in kfree()
3756 __cache_free(c, (void *)objp, _RET_IP_); in kfree()
4216 size_t __ksize(const void *objp) in __ksize() argument
4221 BUG_ON(!objp); in __ksize()
4222 if (unlikely(objp == ZERO_SIZE_PTR)) in __ksize()
4225 c = virt_to_cache(objp); in __ksize()