From: Robin Holt <holt@sgi.com>
To: linux-mm@kvack.org
Cc: Stephane Eranian <eranian@hpl.hp.com>
Subject: What is the right way to prefault and pin pages for perfmon?
Date: Mon, 7 May 2007 06:48:38 -0500 [thread overview]
Message-ID: <20070507114838.GD14010@lnx-holt.americas.sgi.com> (raw)
perfmon has a need to get memory allocated and prefaulted for a shared
buffer between user and kernel. The memory is read-only to the user.
The hardware performance counter values are inserted into those pages.
Pages can not be faulted during sampling as we only have nano to micro
seconds to capture the values with accuracy. What is the right way to
accomplish this?
Currently, the user is calling the kernel with a number of sample entries
for a single cpu's buffers. The kernel turns this into a buffer size
and calls vmalloc to get a kernel virtually contiguous address range.
It then sets PG_RESERVED on all those pages and calls remap_pfn_range()
to insert page table entries into the users address space. Additionally,
it is updating locked_vm on the tasks mm.
I think this should really become do_mmap(), followed by get_user_pages().
I don't think we have a need to update locked_vm and we also should
not need to insert page table entries, but let the kernel do the work.
This will require perfmon to adjust to using a virtually discontiguous
address range, but that seems reasonable.
What is the "right" way to do this? Is there precedence for this sort
of thing elsewhere in the kernel that I can look at?
Thanks,
Robin
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2007-05-07 11:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-07 11:48 Robin Holt [this message]
2007-05-07 12:20 ` Christoph Hellwig
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=20070507114838.GD14010@lnx-holt.americas.sgi.com \
--to=holt@sgi.com \
--cc=eranian@hpl.hp.com \
--cc=linux-mm@kvack.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