Sourceware Bugzilla – Attachment 8700 Details for
Bug 19048
malloc: arena free list can become cyclic, increasing contention
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
glibc-arena.patch
glibc-arena.patch (text/plain), 954 bytes, created by
Paulo Andrade
on 2015-10-09 16:26:45 UTC
(
hide
)
Description:
glibc-arena.patch
Filename:
MIME Type:
Creator:
Paulo Andrade
Created:
2015-10-09 16:26:45 UTC
Size:
954 bytes
patch
obsolete
>diff -up glibc-2.12-2-gc4ccff1/malloc/arena.c.orig glibc-2.12-2-gc4ccff1/malloc/arena.c >--- glibc-2.12-2-gc4ccff1/malloc/arena.c.orig 2015-10-09 23:55:19.638596777 +0800 >+++ glibc-2.12-2-gc4ccff1/malloc/arena.c 2015-10-09 23:56:27.420659953 +0800 >@@ -1148,8 +1148,27 @@ arena_thread_freeres (void) > if (a != NULL) > { > (void)mutex_lock(&list_lock); >- a->next_free = free_list; >- free_list = a; >+ /* Do not make free_list a cyclic one element list. */ >+ if (a != free_list) >+ { >+ if (free_list != NULL) >+ { >+ mstate b = free_list; >+ /* Check if not already in free_list. */ >+ while (b->next_free != NULL) >+ { >+ /* "a" can be at most once in free_list. */ >+ if (b->next_free == a) >+ { >+ b->next_free = a->next_free; >+ break; >+ } >+ b = b->next_free; >+ } >+ } >+ a->next_free = free_list; >+ free_list = a; >+ } > (void)mutex_unlock(&list_lock); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 19048
:
8666
|
8667
|
8668
|
8669
|
8672
|
8674
| 8700 |
8718
|
8719