[<prev] [next>] [day] [month] [year] [list]
Message-ID: <ye8aauha1no.fsf@camel18.daimi.au.dk>
Date: 09 Mar 2010 17:40:59 +0100
From: Soeren Sandmann <sandmann@...mi.au.dk>
To: linux-kernel@...r.kernel.org
Subject: Mapping perf event files twice
Hi,
In the branch where perf_mmap is backed with vmalloc memory, this
code:
data->user_page = all_buf;
data->data_pages[0] = all_buf + PAGE_SIZE;
data->data_order = ilog2(nr_pages);
data->nr_pages = 1;
sets data->nr_pages to 1. This interferes with Sysprof which tries to
map the file twice consecutively to handle overflows automatically,
and therefore hits this in perf_mmap():
if (atomic_inc_not_zero(&event->mmap_count)) {
if (nr_pages != event->data->nr_pages)
ret = -EINVAL;
goto unlock;
}
Because event->data->nr_pages is 1 and Sysprof uses 32 pages, it gets
-EINVAL.
Possibly Sysprof shouldn't be playing this game, but if mapping the
file twice is not supported, then maybe perf_mmap() should just
explicitly forbid it.
Thanks,
Soren
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists