linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hua Ji <hji@netscreen.com>
To: linux-mm@kvack.org
Subject: About performance related to do_map
Date: Tue, 15 May 2001 10:13:30 -0700	[thread overview]
Message-ID: <A33AEFDC2EC0D411851900D0B73EBEF766DBEB@NAPA> (raw)

Folks,

When reading source codes, get a question. Thanks in advance.

Function do_map() ./mm/mmap.c,

After/if we get a vma by using **get_unmapped_area**, why we still
double-check
the vma area by using do_munmap()? 

This call to do_munmap()is ONLY NECESSARY when (flags & MAP_FIXED) is
**TRUE**.

The do_munmap will bring some EXTRA cost with the look up the vma linked
list or/and AVL tree.

Also, why not check it first before we create a new vma area? We don't have
to create a vma first and then release it afterwards when lateron we find
out that this vma is overlapped by some other vma area already.

Mike
------------------------------------------------
 /* Obtain the address to map to. we verify (or select) it and ensure
	 * that it represents a valid section of the address space.
	 */
	if (flags & MAP_FIXED) {
		if (addr & ~PAGE_MASK)
			return -EINVAL;
	} else {
		addr = get_unmapped_area(addr, len);
		if (!addr)
			return -ENOMEM;
	}
--
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.eu.org/Linux-MM/

                 reply	other threads:[~2001-05-15 17:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=A33AEFDC2EC0D411851900D0B73EBEF766DBEB@NAPA \
    --to=hji@netscreen.com \
    --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