From: sebastian@pipping.org (Sebastian Pipping)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Question on mmap / expecting more calls to vfs_read
Date: Wed, 05 Jan 2011 21:16:31 +0100 [thread overview]
Message-ID: <4D24D19F.8010800@pipping.org> (raw)
Hello!
Intro / context
===============
I'm trying to get a precise list of file names, offsets and byte counts
of all read and write operations. I need that information to feed it
into a simulator I am working on. I am running qemu-kvm with a slightly
patched Linux kernel (additions of calls to printk only) sucking the
kernel log from the serial console (kernel option
earlyprintk=serial,keep) to a file. The setup itself works okay for me.
Question / problem
==================
When analyzing the kernel logs I produced I noticed stumbled over the
case of a few libraries where only the beginning of the file (maybe its
ELF header) was read repeated times, but nothing after:
file /lib/ld-2.11.2.so
max offset+count 456
total bytes read ever 502840
Especially as libc is among them, I guess some reads pass by me somehow.
Any ideas what is shoveling the file bytes around?
I found calls to do_mmap_pgoff for these file, though.
That's when I thought I may need help understanding how mmap works.
Is data read into the mapped region instantly all at once? Or is it
feed into it on demand when the kernel gets read requests to a mapped
area? In either case, where does the data come from if neither vfs_read
nor do_readv_writev are ever called on the rest of the file?
Thanks in advance for any help.
Sebastian
next reply other threads:[~2011-01-05 20:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 20:16 Sebastian Pipping [this message]
2011-01-05 22:15 ` Question on mmap / expecting more calls to vfs_read Mulyadi Santosa
2011-01-06 6:53 ` Rajat Sharma
2011-01-06 23:49 ` Sebastian Pipping
2011-01-07 0:09 ` Manish Katiyar
2011-01-07 6:26 ` Rajat Sharma
2011-01-07 6:30 ` Rajat Sharma
2011-01-11 19:16 ` Sebastian Pipping
2011-01-12 5:12 ` Rajat Sharma
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=4D24D19F.8010800@pipping.org \
--to=sebastian@pipping.org \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).