public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Torvald Riegel <triegel@redhat.com>
To: "Jörn Engel" <joern@purestorage.com>
Cc: Szabolcs Nagy <szabolcs.nagy@arm.com>,
	Yury Gribov <y.gribov@samsung.com>,
	Florian Weimer <fweimer@redhat.com>,
	"GNU C. Library" <libc-alpha@sourceware.org>,
	Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>,
	nd@arm.com
Subject: Re: [PATCH] malloc: add locking to thread cache
Date: Wed, 27 Jan 2016 19:19:00 -0000	[thread overview]
Message-ID: <1453922342.4592.166.camel@localhost.localdomain> (raw)
In-Reply-To: <20160127174440.GR5745@Sligo.logfs.org>

On Wed, 2016-01-27 at 09:44 -0800, Jörn Engel wrote:
> On Wed, Jan 27, 2016 at 10:05:33AM +0000, Szabolcs Nagy wrote:
> > 
> > portable code does not need the fix, but all users
> > of the api are affected by the overhead of the fix.
> 
> Sorry, but you have no idea what you are talking about.  The overhead of
> the fix is _negative_.  Users _want_ to be affected.
> 
> The reason why free() is not signalsafe is that it spins on an
> arena-lock.  If the same thread already holds that lock, you have a
> classic deadlock.  By not spinning on the lock you make code run faster.
> You also fix the signal-induced deadlock.
> 
> Ok, for thread-cache there is some overhead.  Without signal-safety you
> wouldn't need a lock for the thread-cache at all.  But here I call
> bullshit again, because I had the same concerns.  Then I measured and
> could not demonstrate any performance impact.
> 
> "If you cannot measure it, it does not exist."
> 
> You might disagree philosophically, but if an engineers goes out of his
> way to measure a certain effect and finds nothing, that effect hardly
> matters in any practical way.

Then it should be sufficient if you can describe what you actually
measured to convince Szabolcs; if your measurement is as good as you
seem to say it is, it should be obvious why his (and your prior)
concerns are unfounded.  Up to now, you just stated that you did measure
something.

I'd also like to kindly point out that we're not on LKML here.  We all
will understand you better if you provide sounds arguments and provide
the necessary background information instead of if you "call bullshit".

  reply	other threads:[~2016-01-27 19:19 UTC|newest]

Thread overview: 119+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26  0:26 malloc: performance improvements and bugfixes Joern Engel
2016-01-26  0:26 ` [PATCH] malloc: turn arena_get() into a function Joern Engel
2016-01-26  0:26 ` [PATCH] malloc: push down the memset for huge pages Joern Engel
2016-01-26  0:26 ` [PATCH] malloc: use MAP_HUGETLB when possible Joern Engel
2016-01-26  0:26 ` [PATCH] malloc: Lindent new_heap Joern Engel
2016-01-26  0:26 ` [PATCH] malloc: unobfuscate an assert Joern Engel
2016-01-26  0:26 ` [PATCH] malloc: remove dead code Joern Engel
2016-01-26  0:26 ` [PATCH] malloc: remove emacs style guards Joern Engel
2016-01-26  0:26 ` [PATCH] malloc: kill mprotect Joern Engel
2016-01-26  0:26 ` [PATCH] malloc: unifdef -m -Ulibc_hidden_def Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: remove mstate typedef Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: make numa_node_count more robust Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: Lindent before functional changes Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: remove __builtin_expect Joern Engel
2016-01-26  7:56   ` Yury Gribov
2016-01-26  9:00     ` Jörn Engel
2016-01-26  9:37       ` Yury Gribov
2016-01-26 15:46       ` Jeff Law
2016-01-26 20:43     ` Steven Munroe
2016-01-26 21:08       ` Florian Weimer
2016-01-26 21:35         ` Steven Munroe
2016-01-26 21:42           ` Jeff Law
2016-01-27  0:37             ` Steven Munroe
2016-01-27  3:16               ` Jeff Law
2016-01-26 21:45           ` Florian Weimer
2016-01-26  0:27 ` [PATCH] malloc: Lindent public_fREe() Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: add documentation Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: s/max_node/num_nodes/ Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: Revert glibc 1d05c2fb9c6f Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: tune thread cache Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: quenche last compiler warnings Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: create a useful assert Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: fix startup races Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: limit free_atomic_list() latency Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: simplify and fix calloc Joern Engel
2016-01-26 10:32   ` Will Newton
2016-01-26  0:27 ` [PATCH] malloc: avoid main_arena Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: better inline documentation Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: unifdef -m -UATOMIC_FASTBINS Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: fix perturb_byte handling for tcache Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: unifdef -D__STD_C Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: use mbind() Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: only free half the objects on tcache_gc Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: hide THREAD_STATS Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: use atomic free list Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: document and fix linked list handling Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: add locking to thread cache Joern Engel
2016-01-26 12:45   ` Szabolcs Nagy
2016-01-26 13:14     ` Florian Weimer
2016-01-26 13:23       ` Yury Gribov
2016-01-26 13:40         ` Szabolcs Nagy
2016-01-26 18:00           ` Mike Frysinger
     [not found]             ` <56A8966D.9080000@arm.com>
2016-01-27 17:45               ` Jörn Engel
2016-01-27 19:19                 ` Torvald Riegel [this message]
2016-01-27 19:43                   ` Jörn Engel
2016-01-27 21:36                 ` Carlos O'Donell
2016-01-26 13:14     ` Yury Gribov
2016-01-26 17:41     ` Jörn Engel
2016-01-26  0:27 ` [PATCH] malloc: fix local_next handling Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: use tsd_getspecific for arena_get Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: initial numa support Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: unifdef -m -UPER_THREAD -U_LIBC Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: Lindent users of arena_get2 Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: always free objects locklessly Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: fix hard-coded constant Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: prefetch for tcache_malloc Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: unifdef -m -DUSE_ARENAS -DHAVE_MMAP Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: introduce get_backup_arena() Joern Engel
2016-01-26  0:27 ` [PATCH] malloc: destroy thread cache on thread exit Joern Engel
2016-01-26  0:28 ` [PATCH] malloc: plug thread-cache memory leak Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: create aliases for malloc, free, Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: remove stale condition Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: use bitmap to conserve hot bins Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: remove tcache prefetching Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: fix mbind on old kernels Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: define __libc_memalign Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: remove get_backup_arena() from tcache_malloc() Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: brain-dead thread cache Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: rename *.ch to *.h Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: remove hooks from malloc() and free() Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: move out perturb_byte conditionals Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: remove atfork hooks Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: remove all remaining hooks Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: Don't call tsd_setspecific before tsd_key_create Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: speed up mmap Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: fix calculation of aligned heaps Joern Engel
2016-01-26  0:32 ` [PATCH] malloc: allow recursion from ptmalloc_init to malloc Joern Engel
2016-01-26  0:50 ` malloc: performance improvements and bugfixes Paul Eggert
2016-01-26  1:01   ` Jörn Engel
2016-01-26  1:52     ` Siddhesh Poyarekar
2016-01-26  2:45       ` Jörn Engel
2016-01-26  3:22         ` Jörn Engel
2016-01-26  6:22           ` Mike Frysinger
2016-01-26  7:54             ` Jörn Engel
2016-01-26  9:53               ` Florian Weimer
2016-01-26 17:05                 ` Jörn Engel
2016-01-26 17:31                   ` Paul Eggert
2016-01-26 17:48                     ` Adhemerval Zanella
2016-01-26 17:49                   ` Joseph Myers
2016-01-26 17:57                   ` Mike Frysinger
2016-01-27 20:46                     ` Manuel López-Ibáñez
2016-01-26 12:37           ` Torvald Riegel
2016-01-26 13:23           ` Florian Weimer
2016-01-26  7:40         ` Paul Eggert
2016-01-26  9:54         ` Florian Weimer
2016-01-26  1:52     ` Joseph Myers
2016-01-26 20:50   ` Steven Munroe
2016-01-26 21:40     ` Florian Weimer
2016-01-26 21:48       ` Steven Munroe
2016-01-26 21:51         ` Florian Weimer
2016-01-26 21:51       ` Paul Eggert
2016-01-26 21:57         ` Florian Weimer
2016-01-26 22:18           ` Paul Eggert
2016-01-26 22:24             ` Florian Weimer
2016-01-27  1:31               ` Paul Eggert
2016-01-26 22:00       ` Jörn Engel
2016-01-26 22:02         ` Florian Weimer
2016-01-27 21:45   ` Carlos O'Donell
2016-01-28 13:51 ` Carlos O'Donell

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=1453922342.4592.166.camel@localhost.localdomain \
    --to=triegel@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=joern@purestorage.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.com \
    --cc=siddhesh.poyarekar@gmail.com \
    --cc=szabolcs.nagy@arm.com \
    --cc=y.gribov@samsung.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).