public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [RFC PATCH 0/3] Improved ALSR
Date: Tue, 24 Nov 2020 11:29:56 -0300	[thread overview]
Message-ID: <9f537b66-d8d2-c0da-7b2b-3a259fb2b5e6@linaro.org> (raw)
In-Reply-To: <ea02ef0f-3aba-4be6-3565-90fb02f945b3@gmail.com>



On 24/11/2020 08:59, Topi Miettinen via Libc-alpha wrote:
> On 24.11.2020 13.24, Florian Weimer wrote:
>> * Topi Miettinen:
>>
>>> On 23.11.2020 23.45, Florian Weimer wrote:
>>>> * Topi Miettinen via Libc-alpha:
>>>>
>>>>> $ time ./malloc-vs-sbrk
>>>>>
>>>>> real    0m1.923s
>>>>> user    0m0.160s
>>>>> sys     0m1.762s
>>>>> $ time ./malloc-vs-sbrk 1
>>>>>
>>>>> real    0m2.847s
>>>>> user    0m0.176s
>>>>> sys     0m2.669s
>>>> Does the difference go away if you change the mmap granularity to
>>>> 128 KiB?  I think this happens under the covers (on the kernel side)
>>>> with sbrk.
>>>
>>> Does not seem so, 56% increase:
>>
>> But the test does not seem very realistic because the pages are never
>> faulted in.  Sorry, I didn't check that before.
> 
> Right, this changes the equation dramatically:
> 
> # time ./malloc-vs-sbrk
> 
> real    0m19.498s
> user    0m1.192s
> sys     0m18.302s
> # time ./malloc-vs-sbrk 1
> 
> real    0m19.428s
> user    0m1.276s
> sys     0m18.146s
> 
> FYI, the effect of full ASLR of mmap() by kernel also seems small:
> 
> # echo 3 >/proc/sys/kernel/randomize_va_space
> # time ./malloc-vs-sbrk
> 
> real    0m19.489s
> user    0m1.263s
> sys     0m18.211s
> # time ./malloc-vs-sbrk 1
> 
> real    0m19.532s
> user    0m1.148s
> sys     0m18.366s

I saw similar results showing little performance difference on different
architectures as well (aarch64, s390x, sparc64, and armhf), so I don't 
think performance should an impending reason for this change.

  reply	other threads:[~2020-11-24 14:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-04 13:09 Topi Miettinen
2020-10-04 13:09 ` [RFC PATCH 1/3] csu: randomize location of TCB Topi Miettinen
2020-11-24 18:44   ` Adhemerval Zanella
2020-10-04 13:09 ` [RFC PATCH 2/3] malloc: always use mmap() to improve ASLR Topi Miettinen
2020-10-04 13:09 ` [RFC PATCH 3/3] dl-sysdep: disable remaining calls to sbrk() Topi Miettinen
2020-11-23 16:06 ` [RFC PATCH 0/3] Improved ALSR Topi Miettinen
2020-11-23 16:41   ` Szabolcs Nagy
2020-11-23 17:55     ` Topi Miettinen
2020-11-23 21:45       ` Florian Weimer
2020-11-23 22:28         ` Topi Miettinen
2020-11-24 11:24           ` Florian Weimer
2020-11-24 11:59             ` Topi Miettinen
2020-11-24 14:29               ` Adhemerval Zanella [this message]
2020-11-30 10:28               ` Florian Weimer
2020-11-30 11:39                 ` Topi Miettinen
2020-11-23 16:44 ` Florian Weimer
2020-11-23 18:16   ` Topi Miettinen
2020-11-24  9:47     ` Szabolcs Nagy

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=9f537b66-d8d2-c0da-7b2b-3a259fb2b5e6@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).