mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Aubrey Li" <aubreylee@gmail.com>
To: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
Cc: "David Howells" <dhowells@redhat.com>,
	vapier.adi@gmail.com, jie.zhang@analog.com, bryan.wu@analog.com,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nommu arch dont zero the anonymous mapping by adding UNINITIALIZE flag
Date: Fri, 30 Mar 2007 22:38:32 +0800	[thread overview]
Message-ID: <6d6a94c50703300738i7b9d3fcn341feb08dca8817d@mail.gmail.com> (raw)
In-Reply-To: <20070330155635.6a6c55d2@the-village.bc.nu>

On 3/30/07, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> > I can't find mmap must give zeroed memory in the mmap manual.
> > Is there any reason relying on anon mmap() giving zerod memory?
>
> Its how all Unix/Linux like systems behave.
Fair enough.


> You have to clear the memory
> to something to deal with security on any kind of real system, and zero
> is a good a value as any
>
> > > Personally, I'd prefer to maintain compatibility with MMU-mode wherever
> > > possible, but I'm happy with overrides like the MAP_UNINITIALISED flag
> > > suggested.
> > >
> > Not necessary IMHO.
>
> mmap() for anonymous memory pools should not normally be a hot path,
> because the C library malloc is supposed to show some brains. If you need
> special behaviour (eg for performance hacks) then create yourself
> a /dev/zero like device which just maps uncleared pages. Its not much
> code and it keeps special cases out of the core kernel.
>
On MMU-mode, /dev/zero's-->mmap gives zerod memory.
On NO-MMU-mode, we have to do memset(,,,) to give zerod memory. So the
different malloc size has the different time cost.
So Bryan's test case shows the terrible performance result.
---------------------------------------------------------------
Summary is, when I run the app "time test",

on x86:
real    0m0.066s
user    0m0.008s
sys     0m0.058s

on Blackfin:
real    3m 37.69s
user    0m 0.04s
sys     3m 37.58s
---------------------------------------------------------------
So now the question is,
Keep the same behave as MMU but with bad performance, or keep the same
performance as MMU but without the same behave, Which one is more
important?

-Aubrey

  reply	other threads:[~2007-03-30 14:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-30  3:42 Wu, Bryan
2007-03-30  3:53 ` Mike Frysinger
2007-03-30  9:39 ` David Howells
2007-03-30 10:34   ` Aubrey Li
2007-03-30 11:24   ` David Howells
2007-03-30 13:44     ` Aubrey Li
2007-03-30 14:56       ` Alan Cox
2007-03-30 14:38         ` Aubrey Li [this message]
2007-03-30 18:13           ` Alan Cox
2007-03-30 15:11         ` David Howells
2007-03-30 15:46           ` Aubrey Li
2009-10-13  7:44           ` [PATCH] NOMMU: fix malloc performance by adding uninitialized flag Mike Frysinger
2009-10-13 15:20             ` [uClinux-dev] [PATCH] NOMMU: fix malloc performance by addinguninitialized flag Robin Getz
2009-10-13 10:10           ` [PATCH] NOMMU: fix malloc performance by adding uninitialized flag David Howells
2009-10-13 11:20             ` [PATCH v2] " Mike Frysinger
2009-10-13 13:03               ` Paul Mundt
2009-10-13 16:03             ` David Howells
2009-10-13 21:31               ` [PATCH v3] " Mike Frysinger
2009-10-13 23:04                 ` David McCullough
2009-10-14  0:25                 ` Greg Ungerer

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=6d6a94c50703300738i7b9d3fcn341feb08dca8817d@mail.gmail.com \
    --to=aubreylee@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bryan.wu@analog.com \
    --cc=dhowells@redhat.com \
    --cc=jie.zhang@analog.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vapier.adi@gmail.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®