aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/glibc/glibc_2.29_no_passive_falsesharing.patch
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-08-11 23:09:23 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-08-11 23:09:23 +0200
commit4fd995ea5a2f9fada2e298bb1b828e510eb2ad29 (patch)
tree2202c848283a2ff86967d36e7fc5dbadb81ddf82 /src/allocators/glibc/glibc_2.29_no_passive_falsesharing.patch
parent9d056ff64bf887e2c3479fe515bf7c95cb39e5b6 (diff)
downloadallocbench-4fd995ea5a2f9fada2e298bb1b828e510eb2ad29.tar.gz
allocbench-4fd995ea5a2f9fada2e298bb1b828e510eb2ad29.zip
add patch info to malloc_stats
Diffstat (limited to 'src/allocators/glibc/glibc_2.29_no_passive_falsesharing.patch')
-rw-r--r--src/allocators/glibc/glibc_2.29_no_passive_falsesharing.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/allocators/glibc/glibc_2.29_no_passive_falsesharing.patch b/src/allocators/glibc/glibc_2.29_no_passive_falsesharing.patch
new file mode 100644
index 0000000..7d0f23f
--- /dev/null
+++ b/src/allocators/glibc/glibc_2.29_no_passive_falsesharing.patch
@@ -0,0 +1,30 @@
+diff --git a/malloc/malloc.c b/malloc/malloc.c
+index 0abd653be2..eaefd3bd7c 100644
+--- a/malloc/malloc.c
++++ b/malloc/malloc.c
+@@ -4194,6 +4194,9 @@ _int_free (mstate av, mchunkptr p, int have_lock)
+
+ #if USE_TCACHE
+ {
++ /* Check if chunk is from our own arena. */
++ if (av == thread_arena)
++ {
+ size_t tc_idx = csize2tidx (size);
+ if (tcache != NULL && tc_idx < mp_.tcache_bins)
+ {
+@@ -4223,6 +4226,7 @@ _int_free (mstate av, mchunkptr p, int have_lock)
+ return;
+ }
+ }
++ }
+ }
+ #endif
+
+@@ -4997,6 +5001,7 @@ __malloc_stats (void)
+ memset (&mi, 0, sizeof (mi));
+ __libc_lock_lock (ar_ptr->mutex);
+ int_mallinfo (ar_ptr, &mi);
++ fprintf (stderr, "false sharing path by muhq\n");
+ fprintf (stderr, "Arena %d:\n", i);
+ fprintf (stderr, "system bytes = %10u\n", (unsigned int) mi.arena);
+ fprintf (stderr, "in use bytes = %10u\n", (unsigned int) mi.uordblks);