From: Andrew Morton <akpm@digeo.com>
To: "Frederic Rossi (LMC)" <Frederic.Rossi@ericsson.ca>
Cc: Ingo Molnar <mingo@elte.hu>, linux-mm@kvack.org
Subject: Re: freemaps
Date: Sat, 14 Dec 2002 19:09:31 -0800 [thread overview]
Message-ID: <3DFBF26B.47C04A6@digeo.com> (raw)
In-Reply-To: 003601c2a3c2$cf721ba0$0d50858e@sybix
"Frederic Rossi (LMC)" wrote:
>
> ...
> 100000 mmaps, mmap=2545 msec munmap=59 msec
> 100000 mmaps, mmap=2545 msec munmap=58 msec
> 100000 mmaps, mmap=2544 msec munmap=60 msec
> 100000 mmaps, mmap=2547 msec munmap=60 msec
>
> and with freemaps I get
> 100000 mmaps, mmap=79 msec munmap=60 msec
> 100000 mmaps, mmap=79 msec munmap=60 msec
> 100000 mmaps, mmap=80 msec munmap=60 msec
> 100000 mmaps, mmap=79 msec munmap=60 msec
>
Yes, this is a real failing.
>
> +ssize_t proc_pid_read_vmc (struct task_struct *task, struct file * file, char * buf, size_t count, loff_t *ppos)
> +{
This should use the seq_file API.
> +struct vma_cache_struct {
> + struct list_head head;
> + unsigned long vm_start;
> + unsigned long vm_end;
> +};
So this is the key part. It is a per-mm linear list of unmapped areas.
You state that its locking is via mm->mmap_sem. I assume that means
a down_write() of that semaphore?
As this is a linear list, I do not understand why it does not have similar failure
modes to the current search. Suppose this list describes 100,000 4k unmapped
areas and the application requests an 8k mmap??
> +static __inline__ int vma_cache_chainout (struct mm_struct *mm, struct vma_cache_struct *vmc)
> +{
> + if (!vmc)
> + return -EINVAL;
> +
> + list_del_init (&vmc->head);
> + vma_cache_free (vmc);
vma_cache_free() already does the list_del_init().
--
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/
next prev parent reply other threads:[~2002-12-15 3:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-14 22:47 freemaps Frederic Rossi (LMC)
2002-12-15 3:09 ` Andrew Morton [this message]
2002-12-15 8:41 ` freemaps Ingo Molnar
2002-12-15 9:03 ` freemaps Andrew Morton
2002-12-15 9:36 ` freemaps Ingo Molnar
2002-12-16 0:51 ` freemaps William Lee Irwin III
2002-12-16 1:03 ` freemaps Andrew Morton
2002-12-16 1:09 ` freemaps William Lee Irwin III
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=3DFBF26B.47C04A6@digeo.com \
--to=akpm@digeo.com \
--cc=Frederic.Rossi@ericsson.ca \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
/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.