Lines Matching refs:nr_pages

522 	unsigned long			nr_pages;  member
854 size_t nr_pages; in full_hit() local
857 nr_pages = cpu_buffer->nr_pages; in full_hit()
858 if (!nr_pages || !full) in full_hit()
868 return (dirty * 100) >= (full * nr_pages); in full_hit()
1682 static void *rb_range_meta(struct trace_buffer *buffer, int nr_pages, int cpu) in rb_range_meta() argument
1698 if (!nr_pages) { in rb_range_meta()
1702 nr_subbufs = nr_pages + 1; in rb_range_meta()
1843 struct trace_buffer *buffer, int nr_pages, in rb_cpu_meta_valid() argument
2234 static void rb_range_meta_init(struct trace_buffer *buffer, int nr_pages, int scratch_size) in rb_range_meta_init() argument
2245 subbuf_mask = bitmap_alloc(nr_pages + 1, GFP_KERNEL); in rb_range_meta_init()
2254 meta = rb_range_meta(buffer, nr_pages, cpu); in rb_range_meta_init()
2256 if (valid && rb_cpu_meta_valid(meta, cpu, buffer, nr_pages, subbuf_mask)) { in rb_range_meta_init()
2267 next_meta = rb_range_meta(buffer, nr_pages, cpu + 1); in rb_range_meta_init()
2273 meta->nr_subbufs = nr_pages + 1; in rb_range_meta_init()
2420 long nr_pages, struct list_head *pages) in __rb_allocate_pages() argument
2437 if (i < nr_pages) in __rb_allocate_pages()
2453 meta = rb_range_meta(buffer, nr_pages, cpu_buffer->cpu); in __rb_allocate_pages()
2457 if (!desc || WARN_ON(desc->nr_page_va != (nr_pages + 1))) in __rb_allocate_pages()
2461 for (i = 0; i < nr_pages; i++) { in __rb_allocate_pages()
2523 unsigned long nr_pages) in rb_allocate_pages() argument
2527 WARN_ON(!nr_pages); in rb_allocate_pages()
2529 if (__rb_allocate_pages(cpu_buffer, nr_pages, &pages)) in rb_allocate_pages()
2540 cpu_buffer->nr_pages = nr_pages; in rb_allocate_pages()
2548 rb_allocate_cpu_buffer(struct trace_buffer *buffer, long nr_pages, int cpu) in rb_allocate_cpu_buffer() argument
2585 cpu_buffer->ring_meta = rb_range_meta(buffer, nr_pages, cpu); in rb_allocate_cpu_buffer()
2602 cpu_buffer->nr_pages = nr_pages; in rb_allocate_cpu_buffer()
2603 cpu_buffer->subbuf_ids = kcalloc(cpu_buffer->nr_pages + 1, in rb_allocate_cpu_buffer()
2627 ret = rb_allocate_pages(cpu_buffer, nr_pages); in rb_allocate_cpu_buffer()
2776 long nr_pages; in alloc_buffer() local
2838 nr_pages = (size - sizeof(struct ring_buffer_cpu_meta)) / in alloc_buffer()
2841 if (nr_pages < 3) in alloc_buffer()
2848 sizeof(int) * nr_pages; in alloc_buffer()
2850 ptr += subbuf_size * nr_pages; in alloc_buffer()
2853 if (nr_pages <= 3) in alloc_buffer()
2855 nr_pages--; in alloc_buffer()
2860 nr_pages--; in alloc_buffer()
2864 rb_range_meta_init(buffer, nr_pages, scratch_size); in alloc_buffer()
2871 nr_pages = desc->nr_page_va - 1; in alloc_buffer()
2872 if (nr_pages < 2) in alloc_buffer()
2876 nr_pages = DIV_ROUND_UP(size, rb_subbuf_capacity(buffer)); in alloc_buffer()
2877 if (nr_pages < 2) in alloc_buffer()
2878 nr_pages = 2; in alloc_buffer()
2882 buffer->buffers[cpu] = rb_allocate_cpu_buffer(buffer, nr_pages, cpu); in alloc_buffer()
3040 rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages) in rb_remove_pages() argument
3076 for (nr_removed = 0; nr_removed < nr_pages; nr_removed++) { in rb_remove_pages()
3242 cpu_buffer->nr_pages += cpu_buffer->nr_pages_to_update; in rb_update_pages()
3267 unsigned long nr_pages; in ring_buffer_resize() local
3291 nr_pages = DIV_ROUND_UP(size, rb_subbuf_capacity(buffer)); in ring_buffer_resize()
3294 if (nr_pages < 2) in ring_buffer_resize()
3295 nr_pages = 2; in ring_buffer_resize()
3315 cpu_buffer->nr_pages_to_update = nr_pages - in ring_buffer_resize()
3316 cpu_buffer->nr_pages; in ring_buffer_resize()
3379 if (nr_pages == cpu_buffer->nr_pages) in ring_buffer_resize()
3392 cpu_buffer->nr_pages_to_update = nr_pages - in ring_buffer_resize()
3393 cpu_buffer->nr_pages; in ring_buffer_resize()
4232 max_count = cpu_buffer->nr_pages * 100; in rb_set_commit_to_write()
5814 if (WARN_ON_ONCE(cpu_buffer->meta_page->reader.id > cpu_buffer->nr_pages)) in __rb_get_reader_page_from_remote()
5856 int max_loops = cpu_buffer->ring_meta ? cpu_buffer->nr_pages : 3; in __rb_get_reader_page()
6187 max_loops = cpu_buffer->ring_meta ? cpu_buffer->nr_pages : 3; in rb_iter_peek()
6528 return rb_subbuf_capacity(buffer) * buffer->buffers[cpu]->nr_pages; in ring_buffer_size()
6934 if (cpu_buffer_a->nr_pages != cpu_buffer_b->nr_pages) in ring_buffer_swap_cpu()
7384 int nr_pages; in ring_buffer_subbuf_order_set() local
7430 nr_pages = old_capacity * buffer->buffers[cpu]->nr_pages; in ring_buffer_subbuf_order_set()
7431 nr_pages = DIV_ROUND_UP(nr_pages, rb_subbuf_capacity(buffer)); in ring_buffer_subbuf_order_set()
7434 if (nr_pages < 2) in ring_buffer_subbuf_order_set()
7435 nr_pages = 2; in ring_buffer_subbuf_order_set()
7437 cpu_buffer->nr_pages_to_update = nr_pages; in ring_buffer_subbuf_order_set()
7440 nr_pages++; in ring_buffer_subbuf_order_set()
7444 if (__rb_allocate_pages(cpu_buffer, nr_pages, in ring_buffer_subbuf_order_set()
7491 cpu_buffer->nr_pages = cpu_buffer->nr_pages_to_update; in ring_buffer_subbuf_order_set()
7566 unsigned int nr_subbufs = cpu_buffer->nr_pages + 1; in rb_setup_ids_meta_page()
7673 unsigned long nr_subbufs, nr_pages, nr_vma_pages; in __rb_map_vma() local
7700 nr_subbufs = cpu_buffer->nr_pages + 1; /* + reader-subbuf */ in __rb_map_vma()
7701 nr_pages = ((nr_subbufs + 1) << subbuf_order); /* + meta-page */ in __rb_map_vma()
7702 if (nr_pages <= pgoff) in __rb_map_vma()
7705 nr_pages -= pgoff; in __rb_map_vma()
7708 if (!nr_vma_pages || nr_vma_pages > nr_pages) in __rb_map_vma()
7711 nr_pages = nr_vma_pages; in __rb_map_vma()
7713 pages = kzalloc_objs(*pages, nr_pages); in __rb_map_vma()
7727 while (meta_page_padding-- && p < nr_pages) { in __rb_map_vma()
7740 while (p < nr_pages) { in __rb_map_vma()
7752 if (p >= nr_pages) in __rb_map_vma()
7760 err = vm_insert_pages(vma, vma->vm_start, pages, &nr_pages); in __rb_map_vma()
7802 subbuf_ids = kcalloc(cpu_buffer->nr_pages + 1, sizeof(*subbuf_ids), GFP_KERNEL); in ring_buffer_map()
8007 unsigned long nr_pages; in trace_rb_cpu_prepare() local
8013 nr_pages = 0; in trace_rb_cpu_prepare()
8018 if (nr_pages == 0) in trace_rb_cpu_prepare()
8019 nr_pages = buffer->buffers[cpu_i]->nr_pages; in trace_rb_cpu_prepare()
8020 if (nr_pages != buffer->buffers[cpu_i]->nr_pages) { in trace_rb_cpu_prepare()
8027 nr_pages = 2; in trace_rb_cpu_prepare()
8029 rb_allocate_cpu_buffer(buffer, nr_pages, cpu); in trace_rb_cpu_prepare()