From: wind@cocodriloo.com
To: Andrew Morton <akpm@digeo.com>
Cc: Alex Tomas <bzzz@tmi.comex.ru>,
wind@cocodriloo.com, riel@surriel.com,
linux-kernel@vger.kernel.org
Subject: Re: 2.4 vm, program load, page faulting, ...
Date: Tue, 18 Mar 2003 00:08:39 +0100 [thread overview]
Message-ID: <20030317230839.GG11526@wind.cocodriloo.com> (raw)
In-Reply-To: <20030317140506.686282a5.akpm@digeo.com>
[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]
On Mon, Mar 17, 2003 at 02:05:06PM -0800, Andrew Morton wrote:
> Alex Tomas <bzzz@tmi.comex.ru> wrote:
> >
> > w> You should ask Andrew about his patch to do exactly that: he
> > w> forced all PROC_EXEC mmaps to be nonlinear-mapped and this forced
> > w> all programs to suck entire binaries into memory... I recall he
> > w> saw at least 25% improvement at launching gnome.
> >
> > they talked about pages _already present_ in pagecache.
>
> 2.5.64-mm8 does that too. At mmap-time it will, for a PROT_EXEC mapping,
> pull every affected page off disk and it will instantiate pte's against
> them all via install_page().
>
> So there should be zero major and minor faults against that mmap region
> during application startup.
>
> The improved IO layout appears to halve startup time for big things. I
> haven't attempted to instrument the effects of the reduced minor fault rate.
> If indeed the rate _has_ decreased. If it hasn't, it's a bug...
>
>
>
> This is all a bit dubious for several reasons. Most particularly, the
> up-front instantiation of the pages in pagetables makes unneeded pages harder
> to reclaim. It would be really neat if someone could try putting the
> madvise(MADV_WILLNEED) into glibc and test that. Maybe on a 2.4 kernel.
something like this one?
[-- Attachment #2: prefault-madvise.patch --]
[-- Type: text/plain, Size: 722 bytes --]
--- base/fs/binfmt_elf.c Mon Mar 17 23:44:55 2003
+++ work/fs/binfmt_elf.c Tue Mar 18 00:03:34 2003
@@ -256,6 +256,8 @@ create_elf_tables(struct linux_binprm *b
#ifndef elf_map
+asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior);
+
static inline unsigned long
elf_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type)
{
@@ -266,6 +268,10 @@ elf_map (struct file *filep, unsigned lo
eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr), prot, type,
eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr));
up_write(¤t->mm->mmap_sem);
+
+ if(prot & PROT_EXEC)
+ sys_madvise(map_addr, eppnt->p_filesz, MADV_WILLNEED);
+
return(map_addr);
}
next prev parent reply other threads:[~2003-03-17 22:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-16 4:59 Paul Albrecht
2003-03-17 15:02 ` Rik van Riel
2003-03-17 15:10 ` William Lee Irwin III
2003-03-17 16:01 ` Rik van Riel
2003-03-17 16:52 ` wind
2003-03-17 16:50 ` Alex Tomas
2003-03-17 17:12 ` wind-lkml
2003-03-17 17:38 ` wind-lkml
2003-03-17 18:57 ` Marc-Christian Petersen
2003-03-17 19:06 ` wind-lkml
2003-03-17 19:34 ` wind
2003-03-17 22:05 ` Andrew Morton
2003-03-17 23:08 ` wind [this message]
2003-03-17 23:28 ` Andrew Morton
2003-03-18 0:12 ` wind
2003-03-17 16:37 ` Alex Tomas
2003-03-18 7:43 ` Paul Albrecht
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=20030317230839.GG11526@wind.cocodriloo.com \
--to=wind@cocodriloo.com \
--cc=akpm@digeo.com \
--cc=bzzz@tmi.comex.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@surriel.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 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®