[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20081106100727.0D35.KOSAKI.MOTOHIRO@jp.fujitsu.com>
Date: Thu, 6 Nov 2008 10:15:21 +0900 (JST)
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: Hugh Dickins <hugh@...itas.com>
Cc: kosaki.motohiro@...fujitsu.com,
Török Edwin <edwintorok@...il.com>,
Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: /proc/pid/maps containg anonymous maps that have PROT_NONE
> [pid 31928] mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...>
> [pid 31938] futex(0x7ffff6e489e0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
> [pid 31928] <... mmap resumed> ) = 0x7fffe2bd3000
>
> which maps 7fffe2bd3000-7fffeabd3000; then
>
> [pid 31928] munmap(0x7fffe2bd3000, 21155840 <unfinished ...>
> [pid 31938] <... futex resumed> ) = 0
> [pid 31928] <... munmap resumed> ) = 0
>
> which unmaps 7fffe2bd3000-7fffe4000000; and then
>
> [pid 31928] munmap(0x7fffe8000000, 45953024) = 0
>
> which unmaps 7fffe8000000-7fffeabd3000.
>
> So it's trimming off the rough edges to leave 7fffe4000000-7fffe8000000
> mapped PROT_NONE, then mprotecting what it needs of that.
>
> Why does it mmap too much then trim it down? Perhaps it's trying to
> minimize pagetable usage, perhaps it's internally convenient to base
> on rounded addresses, I don't know.
Yup.
glibc malloc's arena need heap size alignment.
it cause that struct arena address can calcurate "arena = any_ptr & ~(HEAP_SIZE-1)"
as old linux's "current" macro calculation.
> But the mmap is there: just easily overlooked because of the way it
> munmaps too (with strace showing hex addresses but decimal sizes).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists