From: Matt Mackall <mpm@selenic.com>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, serue@us.ibm.com
Subject: Re: [RFC][PATCH 1/5] pagemap: remove file header
Date: Tue, 7 Aug 2007 20:16:21 -0500 [thread overview]
Message-ID: <20070808011620.GF30556@waste.org> (raw)
In-Reply-To: <20070807223300.9228E0E0@kernel>
On Tue, Aug 07, 2007 at 03:33:00PM -0700, Dave Hansen wrote:
>
> The /proc/<pid>/pagemap file has a header containing:
> * first byte: 0 for big endian, 1 for little
> * second byte: page shift (eg 12 for 4096 byte pages)
> * third byte: entry size in bytes (currently either 4 or 8)
> * fourth byte: header size
>
> The endianness is only useful when examining a raw dump of
> pagemap from a different machine when you don't know the
> source of the file. This is pretty rare, and the programs
> or scripts doing the copying off-machine can certainly be
> made to hold this information.
>
> The page size is available in userspace at least with libc's
> getpagesize(). This will also never vary across processes,
> so putting it in a per-process file doesn't make any difference.
> If we need a "kernel's page size" exported to userspace,
> perhaps we can put it in /proc/meminfo.
>
> The entry size is the really tricky one. This can't just
> be sizeof(unsigned long) from userspace because we can have
> 32-bit processes on 64-bit kernels. But, userspace can
> certainly derive this value if it lseek()s to the end of
> the file, and divides the file position by the size of its
> virtual address space.
I'd really strongly prefer to have no header. It was added to
futureproof the thing.
One downside to this is that dumps are no longer portable. But
that's not a showstopper, I suppose.
--
Mathematics is the supreme nostalgia of our time.
next prev parent reply other threads:[~2007-08-08 1:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-07 22:33 [RFC][PATCH 1/5] pagemap: remove file header Dave Hansen
2007-08-07 22:33 ` [RFC][PATCH 2/5] pagemap: use PAGE_MASK/PAGE_ALIGN() Dave Hansen
2007-08-08 1:54 ` Matt Mackall
2007-08-07 22:33 ` [RFC][PATCH 3/5] pagemap: remove open-coded sizeof(unsigned long) Dave Hansen
2007-08-07 23:40 ` Matt Mackall
2007-08-07 23:55 ` Dave Hansen
2007-08-08 2:01 ` Matt Mackall
2007-08-07 22:33 ` [RFC][PATCH 4/5] introduce TASK_SIZE_OF() for all arches Dave Hansen
2007-08-08 2:03 ` Matt Mackall
2007-08-08 18:19 ` Dave Hansen
2007-08-07 22:33 ` [RFC][PATCH 5/5] pagemap: add walker for empty areas Dave Hansen
2007-08-08 1:16 ` Matt Mackall [this message]
2007-08-08 1:31 ` [RFC][PATCH 1/5] pagemap: remove file header Alan Cox
2007-08-08 3:51 ` Matt Mackall
2007-08-08 16:34 ` Dave Hansen
2007-08-08 16:53 ` Dave Hansen
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=20070808011620.GF30556@waste.org \
--to=mpm@selenic.com \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=serue@us.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.