This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Small tcache improvements *
- From: DJ Delorie <dj at redhat dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: libc-alpha at sourceware dot org, nd at arm dot com
- Date: Fri, 10 May 2019 14:23:13 -0400
- Subject: Re: [PATCH] Small tcache improvements *
Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes:
> +
> +/* Maximum chunks in tcache bins for tunables. This value must fit the range
> + of tcache->counts[] entries, else they may overflow. */
> +# define MAX_TCACHE_COUNT 1024
Why an arbitrary limit?
> - char counts[TCACHE_MAX_BINS];
> + uint16_t counts[TCACHE_MAX_BINS];
Ok.
> -#define MAX_TCACHE_COUNT 127 /* Maximum value of counts[] entries. */
> -
Ok.
> - assert (tc_idx < TCACHE_MAX_BINS);
Ok, every call to tcache_put is inside a check for both count and bins
already.
> - assert (tc_idx < TCACHE_MAX_BINS);
Ok, likewise here, for tcache_get and bins.
> - assert (tcache->counts[tc_idx] > 0);
This is now superfluous due to the change below, ok.
> - /*&& tc_idx < TCACHE_MAX_BINS*/ /* to appease gcc */
Heh.
> - && tcache->entries[tc_idx] != NULL)
> + && tcache->counts[tc_idx] > 0)
Ok.
> -The upper limit is 127. If set to zero, the per-thread cache is effectively
> +The upper limit is 1024. If set to zero, the per-thread cache is effectively
Ok.