From: Andi Kleen <andi@firstfloor.org>
To: Ulrich Drepper <drepper@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH prototype] [0/8] Predictive bitmaps for ELF executables
Date: Thu, 20 Mar 2008 10:00:05 +0100 [thread overview]
Message-ID: <20080320090005.GA25734@one.firstfloor.org> (raw)
In-Reply-To: <a36005b50803191545h33d1a443y57d09176f8324186@mail.gmail.com>
On Wed, Mar 19, 2008 at 03:45:16PM -0700, Ulrich Drepper wrote:
> On Wed, Mar 19, 2008 at 2:04 AM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
> > The requirement to write to an executable sounds like a bit of a
> > showstopper.
>
> Agreed. In addition, it makes all kinds of tools misbehave. I can
> see extensions to the ELF format and those would require relinking
> binaries, but without this you create chaos. ELF is so nice because
What chaos exactly? For me it looks rather that a separatate database
would be a recipe for chaos. e.g. for example how would you make sure
the database keeps track of changing executables?
The only minor issue is rpm -Va and similar, but that can be handled
in the same way as prelinking is handled there by using filter scripts
that reset the bitmap before taking a checksum.
Also the current way does not require relinking by using the shdr hack.
I have a simple program that adds a bitmap shdr to any executable.
But if the binutils leanred about this and added a bitmap phdr (it
tends to be only a few hundred bytes even on very large executables)
one seek could be avoided.
> it describes the entire file and we can handle everything according to
> rules. If you just somehow magically patch some new data structure in
> this will break things.
Can you elaborate what you think will be broken?
>
> Furthermore, by adding all this data to the end of the file you'll
We are talking about 32bytes for each MB worth of executable.
You can hardly call that "all that data". Besides the prefetcher supports
in theory larger page sizes, so if you wanted you could even reduce
that even more by e.g. using 64k prefetch blocks. But the overhead
is so tiny that it doesn't make much difference.
> normally create unnecessary costs. The parts of the binaries which
> are used at runtime start at the front. At the end there might be a
> lot of data which isn't needed at runtime and is therefore normally
> not read.
Yes as I said using the SHDR currently requires an additional seek
(although in practice i expect it to be served out of the track
buffer of the hard disk if the executable is not too large and is
continuous on disk). If binutils were taught of generating a phdr
that minor problem would go away.
>
>
> > if it proves useful, build it all into libc..
>
> I could see that. But to handle it efficiently kernel support is
> needed. Especially since I don't think the currently proposed
I agree.
> "learning mode" is adequate. Over many uses of a program all kinds of
It is not too bad, but could be certainly better. I outlined
some possible ways to improve the algorithms in my original way.
It would be a nice research project for someone to investigate
the various ways (anyone interested?)
> pages will be needed. Far more than in most cases. The prefetching
> should really only cover the commonly used code paths in the program.
Sorry that doesnt make sense. Anything that is read at startup
has to be prefetched, even if that code is only executed once.
Otherwise the whole scheme is rather useless.
Because even a single access requires the IO to read it from
disk.
> If you pull in everything, this will have advantages if you have that
> much page cache to spare. In that case just prefetching the entire
Yes that is what the "mmap_flush" hack (last patch does) I actually
have some numbers on a older kernel and in some cases it really
does quite well. But it also has a few problems (e.g. interaction
with data mmaps and memory waste) that are unpleasant.
-Andi
--
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 prev parent reply other threads:[~2008-03-20 9:00 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-18 1:09 [PATCH prototype] [0/8] Predictive bitmaps for ELF executables Andi Kleen
2008-03-18 1:09 ` [PATCH prototype] [1/8] Give ELF shdr types a name Andi Kleen
2008-03-18 1:09 ` [PATCH prototype] [2/8] Add support to override mmap exec write protection with O_FORCEWRITE Andi Kleen
2008-03-18 1:09 ` [PATCH prototype] [3/8] Make readahead max pinned value a sysctl Andi Kleen
2008-03-18 1:09 ` [PATCH prototype] [4/8] Add readahead function to read-ahead based on a bitmap Andi Kleen
2008-03-18 1:09 ` [PATCH prototype] [5/8] Add ELF constants for pbitmaps Andi Kleen
2008-03-18 1:09 ` [PATCH prototype] [6/8] Core predictive bitmap engine Andi Kleen
2008-03-18 1:09 ` [PATCH prototype] [7/8] Add the sysctls to control pbitmaps Andi Kleen
2008-03-18 1:09 ` [PATCH prototype] [8/8] Add mmap_full_slurp support Andi Kleen
2008-03-18 7:36 ` [PATCH prototype] [0/8] Predictive bitmaps for ELF executables Andrew Morton
2008-03-18 14:18 ` Andi Kleen
2008-03-18 16:57 ` Andrew Morton
2008-03-18 17:20 ` Andi Kleen
2008-03-18 17:44 ` Andrew Morton
2008-03-19 8:32 ` Andi Kleen
2008-03-19 9:04 ` Andrew Morton
2008-03-19 22:45 ` Ulrich Drepper
2008-03-19 23:12 ` Andrew Morton
2008-03-20 0:09 ` David Miller, Andrew Morton
2008-03-20 9:00 ` Andi Kleen [this message]
2008-03-21 17:15 ` Ulrich Drepper
2008-03-21 17:26 ` Andi Kleen
2008-03-22 4:36 ` Ulrich Drepper
2008-03-22 7:17 ` Andi Kleen
2008-03-22 7:24 ` Nicholas Miell
2008-03-22 9:10 ` Andi Kleen
2008-03-22 10:16 ` Nicholas Miell
2008-03-22 14:29 ` Andi Kleen
2008-03-23 13:25 ` Pavel Machek
2008-03-23 17:08 ` Andi Kleen
2008-03-24 16:24 ` Pavel Machek
2008-03-24 4:20 ` Ulrich Drepper
2008-03-24 5:16 ` Nicholas Miell
2008-03-24 5:26 ` Andi Kleen
2008-03-24 19:42 ` Ulrich Drepper
2008-03-24 21:47 ` Nicholas Miell
2008-03-25 7:54 ` Andi Kleen
2008-03-26 18:15 ` Ulrich Drepper
2008-03-26 18:54 ` Andi Kleen
2008-03-22 4:38 ` Ulrich Drepper
2008-03-20 0:15 ` Diego Calleja
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=20080320090005.GA25734@one.firstfloor.org \
--to=andi@firstfloor.org \
--cc=akpm@linux-foundation.org \
--cc=drepper@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).