Lines Matching full:entries

113 static void init_stack_table(unsigned long entries)  in init_stack_table()  argument
117 for (i = 0; i < entries; i++) in init_stack_table()
124 unsigned long entries = 0; in stack_depot_early_init() local
156 * If stack_bucket_number_order is not set, leave entries as 0 to rely in stack_depot_early_init()
160 entries = 1UL << stack_bucket_number_order; in stack_depot_early_init()
164 entries, in stack_depot_early_init()
176 if (!entries) { in stack_depot_early_init()
178 * Obtain the number of entries that was calculated by in stack_depot_early_init()
181 entries = stack_hash_mask + 1; in stack_depot_early_init()
183 init_stack_table(entries); in stack_depot_early_init()
192 unsigned long entries; in stack_depot_init() local
205 entries = 1UL << stack_bucket_number_order; in stack_depot_init()
209 entries = nr_free_buffer_pages(); in stack_depot_init()
210 entries = roundup_pow_of_two(entries); in stack_depot_init()
213 entries >>= (scale - PAGE_SHIFT); in stack_depot_init()
215 entries <<= (PAGE_SHIFT - scale); in stack_depot_init()
218 if (entries < 1UL << STACK_BUCKET_NUMBER_ORDER_MIN) in stack_depot_init()
219 entries = 1UL << STACK_BUCKET_NUMBER_ORDER_MIN; in stack_depot_init()
220 if (entries > 1UL << STACK_BUCKET_NUMBER_ORDER_MAX) in stack_depot_init()
221 entries = 1UL << STACK_BUCKET_NUMBER_ORDER_MAX; in stack_depot_init()
223 pr_info("allocating hash table of %lu entries via kvcalloc\n", entries); in stack_depot_init()
224 stack_table = kvcalloc(entries, sizeof(struct list_head), GFP_KERNEL); in stack_depot_init()
231 stack_hash_mask = entries - 1; in stack_depot_init()
232 init_stack_table(entries); in stack_depot_init()
371 const size_t used = flex_array_size(s, entries, nr_entries); in depot_stack_record_size()
372 const size_t unused = sizeof(s->entries) - used; in depot_stack_record_size()
374 WARN_ON_ONCE(sizeof(s->entries) < used); in depot_stack_record_size()
381 depot_alloc_stack(unsigned long *entries, unsigned int nr_entries, u32 hash, depot_flags_t flags, v… in depot_alloc_stack() argument
398 * Evictable entries have to allocate the max. size so they may in depot_alloc_stack()
417 memcpy(stack->entries, entries, flex_array_size(stack, entries, nr_entries)); in depot_alloc_stack()
497 * Add the entry to the freelist tail, so that older entries are in depot_free_stack()
512 static inline u32 hash_stack(unsigned long *entries, unsigned int size) in hash_stack() argument
514 return jhash2((u32 *)entries, in hash_stack()
515 array_size(size, sizeof(*entries)) / sizeof(u32), in hash_stack()
536 unsigned long *entries, int size, in find_stack() argument
547 * unused entries, because the stack record free-then-reuse code paths in find_stack()
558 * management state unioned with @entries. The refcount is zero in find_stack()
561 if (data_race(stackdepot_memcmp(entries, stack->entries, size))) in find_stack()
584 depot_stack_handle_t stack_depot_save_flags(unsigned long *entries, in stack_depot_save_flags() argument
609 nr_entries = filter_irq_stacks(entries, nr_entries); in stack_depot_save_flags()
614 hash = hash_stack(entries, nr_entries); in stack_depot_save_flags()
618 found = find_stack(bucket, entries, nr_entries, hash, depot_flags); in stack_depot_save_flags()
637 found = find_stack(bucket, entries, nr_entries, hash, depot_flags); in stack_depot_save_flags()
640 depot_alloc_stack(entries, nr_entries, hash, depot_flags, &prealloc); in stack_depot_save_flags()
674 depot_stack_handle_t stack_depot_save(unsigned long *entries, in stack_depot_save() argument
678 return stack_depot_save_flags(entries, nr_entries, alloc_flags, in stack_depot_save()
692 unsigned long **entries) in stack_depot_fetch() argument
696 *entries = NULL; in stack_depot_fetch()
698 * Let KMSAN know *entries is initialized. This shall prevent false in stack_depot_fetch()
701 kmsan_unpoison_memory(entries, sizeof(*entries)); in stack_depot_fetch()
714 *entries = stack->entries; in stack_depot_fetch()
741 unsigned long *entries; in stack_depot_print() local
744 nr_entries = stack_depot_fetch(stack, &entries); in stack_depot_print()
746 stack_trace_print(entries, nr_entries, 0); in stack_depot_print()
753 unsigned long *entries; in stack_depot_snprint() local
756 nr_entries = stack_depot_fetch(handle, &entries); in stack_depot_snprint()
757 return nr_entries ? stack_trace_snprint(buf, size, entries, nr_entries, in stack_depot_snprint()