On Tue, 2013-03-12 at 11:53 +0100, Jiri Olsa wrote: > > @@ -316,7 +316,7 @@ void rb_free(struct ring_buffer *rb) > > struct page * > > perf_mmap_to_page(struct ring_buffer *rb, unsigned long pgoff) > > { > > - if (pgoff > (1UL << page_order(rb))) > > + if (pgoff > rb->nr_pages) > > return NULL; > > here it's the '>' that masks that there's actually (rb->nr_pages + 1) pages > > > > > return vmalloc_to_page((void *)rb->user_page + pgoff * PAGE_SIZE); > > @@ -336,7 +336,7 @@ static void rb_free_work(struct work_struct *work) > > int i, nr; > > > > rb = container_of(work, struct ring_buffer, work); > > - nr = 1 << page_order(rb); > > + nr = rb->nr_pages; > > > > base = rb->user_page; > > for (i = 0; i < nr + 1; i++) > > and here's the user plus one
Right, we could make that either '< nr' and '<= nr' or '<= nr+1' and '< nr+1'. No real preference either way, but you're right in that being consistent here makes sense. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/