unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Ondřej Bílka" <neleai@seznam.cz>
To: DJ Delorie <dj@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2] Add malloc micro benchmark
Date: Thu, 1 Mar 2018 12:24:20 +0100	[thread overview]
Message-ID: <20180301112420.GA3062@domone> (raw)
In-Reply-To: <xnmuzssrqr.fsf@greed.delorie.com>

On Wed, Feb 28, 2018 at 04:56:28PM -0500, DJ Delorie wrote:
> 
> Ond?ej B?lka <neleai@seznam.cz> writes:
> > First for small sizes allocation would be just popping element from
> > thread local single linked list, or calling function to refill lists
> > with enough elements when empty.
> 
> This is basically what tcache does.  Although I tested a few ways of
> pre-filling the cache, there's room for more research there beyond the
> few algorithms I used.  Some folks have been experimenting with "ideal"
> values for tcache_count and tcache_max too.
>
That isn't case, tcache counters slow things down and are unneccessary.
One could establish limits by using tricks in free.

I had different idea for representation now, so I will send it in
separate thread.

 
> > Finally for larger allocations I would use page-based logic as
> > mmaping/remapping/unmapping is about only way to actually decrease
> > memory footprint, I didn't try that much yet.
> 
> Note that mmap() itself is expensive (slow) and there may be a limit on
> how many discrete mapped regions a kernel[*] can support.
> 

For larger its more that one should be aware of paging as to handle
memory allocated from system. One such issue is that often big
allocation doesn't use pages at end. 
For returning memory to system I think that best strategy is something like
 hitting pages that weren't used last second by madvise(dont_need)


  reply	other threads:[~2018-03-01 11:22 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 13:51 [PATCH] Add malloc micro benchmark Wilco Dijkstra
2017-12-01 16:13 ` Carlos O'Donell
2017-12-18 15:18   ` Wilco Dijkstra
2017-12-18 16:32     ` Carlos O'Donell
2018-01-02 18:20       ` [PATCH v2] " Wilco Dijkstra
2018-01-02 18:45         ` DJ Delorie
2018-01-03 12:12           ` Wilco Dijkstra
2018-01-03 15:07             ` Carlos O'Donell
2018-01-04 13:48               ` Wilco Dijkstra
2018-01-04 16:37                 ` Adhemerval Zanella
2018-01-05 14:32                 ` Carlos O'Donell
2018-01-05 15:50                   ` Adhemerval Zanella
2018-01-05 16:17                     ` Carlos O'Donell
2018-01-05 16:46                       ` Adhemerval Zanella
2018-01-05 17:27                         ` Carlos O'Donell
2018-01-05 14:33         ` Carlos O'Donell
2018-01-05 16:28           ` Joseph Myers
2018-01-05 17:26             ` Carlos O'Donell
2018-02-28 12:40               ` Florian Weimer
2018-02-28 14:11                 ` Ondřej Bílka
2018-02-28 14:16                   ` Florian Weimer
2018-02-28 16:16                     ` Carlos O'Donell
2018-02-28 20:17                       ` Ondřej Bílka
2018-02-28 16:46                     ` Ondřej Bílka
2018-02-28 17:01                       ` Wilco Dijkstra
2018-02-28 18:21                         ` Carlos O'Donell
2018-02-28 19:56                         ` Ondřej Bílka
2018-02-28 21:56                           ` DJ Delorie
2018-03-01 11:24                             ` Ondřej Bílka [this message]
2017-12-18 23:02     ` [PATCH] " DJ Delorie
2017-12-28 14:09       ` Wilco Dijkstra
2017-12-28 19:01         ` DJ Delorie

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180301112420.GA3062@domone \
    --to=neleai@seznam.cz \
    --cc=dj@redhat.com \
    --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).