mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Soeren Sandmann <sandmann@daimi.au.dk>
To: linux-kernel@vger.kernel.org
Subject: Mapping perf event files twice
Date: 09 Mar 2010 17:40:59 +0100	[thread overview]
Message-ID: <ye8aauha1no.fsf@camel18.daimi.au.dk> (raw)

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

                 reply	other threads:[~2010-03-09 16:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ye8aauha1no.fsf@camel18.daimi.au.dk \
    --to=sandmann@daimi.au.dk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®