linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Linux/PPC Development <linuxppc-dev@ozlabs.org>,
	Linux Kernel Development <linux-kernel@vger.kernel.org>,
	Linux Test Project <Ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] mmapstress03 weirdness? (fwd)
Date: Tue, 22 Sep 2009 10:19:41 +1000	[thread overview]
Message-ID: <1253578781.7103.186.camel@pasglop> (raw)
In-Reply-To: <alpine.LRH.2.00.0909211539520.16077@vixen.sonytel.be>

On Mon, 2009-09-21 at 15:40 +0200, Geert Uytterhoeven wrote:

> 
> With 32-bit userland, this boils down to:
> 
> | mmap addr 0x7fff0000 size 0x7fff0000
> | mmap returned 0x7fff0000
> 
> i.e. mmap() succeeds, but (1) the test expects it to fail, so the test returns
> TFAIL, but (2) ltp-pan still reports that the tests passed?

What is the output of /proc/<pid>/maps after that mmap ?

With a 64-bit kernel, 32-bit userspace has access to the entire 4G
address space, so mapping 2G-64k at the 2G-64k point can work, provided
you aren't overlapping an existing mapping such as the stack.

> In addition, sometimes mmapstress03 fails due to SEGV. I created a small test
> program that just does the above mmap(), and depending on the distro and what
> else I print later it crashes with a SEGV, too. Probably this happens because
> the mmap() did succeed, and corrupted some existing mappings, cfr. the notes
> for MAP_FIXED:

That's possible.

>        MAP_FIXED
>               Don’t  interpret  addr  as  a hint: place the mapping at exactly
>               that address.  addr must be a multiple of the page size.  If the
>               memory  region  specified  by addr and len overlaps pages of any
>               existing mapping(s), then the overlapped part  of  the  existing
>               mapping(s)  will  be discarded.  If the specified address cannot
>               be used, mmap() will fail.  Because requiring  a  fixed  address
>               for  a  mapping is less portable, the use of this option is dis‐
>               couraged.

Yeah, I suppose the test might be wiping out its own stack for example

IE. I think that test is just bogus :-)

> JFYI, with 64-bit userland, this boils down to:
> 
> | mmap addr 0x7fffffffffff0000 size 0x7fffffffffff0000
> | mmap returned 0xffffffffffffffff
> 
> i.e. mmap() fails as expected, and the test succeeds.

Right because on 64-bit userspace, you only are allowed something like
16T of address space.

> Does all of this sound OK?
> Thanks for your comments!

Yes, I think so far, it's just bogus tests :-)

Cheers,
Ben.

> With kind regards,
> 
> Geert Uytterhoeven
> Software Architect
> Techsoft Centre
> 
> Technology and Software Centre Europe
> The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
> 
> Phone:    +32 (0)2 700 8453
> Fax:      +32 (0)2 700 8622
> E-mail:   Geert.Uytterhoeven@sonycom.com
> Internet: http://www.sony-europe.com/
> 
> A division of Sony Europe (Belgium) N.V.
> VAT BE 0413.825.160 · RPR Brussels
> Fortis · BIC GEBABEBB · IBAN BE41293037680010
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

  parent reply	other threads:[~2009-09-22  0:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-21 13:40 [LTP] mmapstress03 weirdness? (fwd) Geert Uytterhoeven
2009-09-21 16:10 ` Segher Boessenkool
2009-09-22  0:19 ` Benjamin Herrenschmidt [this message]
2009-09-22  9:53   ` Geert Uytterhoeven

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=1253578781.7103.186.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --cc=Ltp-list@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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).