Discussion:
free lists 2.0
Walt Karas
2018-12-06 22:02:44 UTC
Permalink
Would it be desirable for ATS to use this (cleaner) version of free lists?

https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/example.cc

https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/Dynamic_obj.h

The advantage is faster allocation/deallocation for small objects with
short lifetimes. The disadvantage is we could reach heap exhaustion
more easily, as the free lists are reserving free memory for
allocation of a particular size (and where the size is a constexpr).

We would probably want to use conditional compilation for force
Large_threshold to 0 for FSAN builds and maybe debug builds also.
Leif Hedstrom
2018-12-07 00:56:03 UTC
Permalink
I thought the efforts were to be focused on getting jemalloc optimized with their concepts of arenas and NUMA affinity and thread ware allocations?

— Leif
Post by Walt Karas
Would it be desirable for ATS to use this (cleaner) version of free lists?
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/example.cc
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/Dynamic_obj.h
The advantage is faster allocation/deallocation for small objects with
short lifetimes. The disadvantage is we could reach heap exhaustion
more easily, as the free lists are reserving free memory for
allocation of a particular size (and where the size is a constexpr).
We would probably want to use conditional compilation for force
Large_threshold to 0 for FSAN builds and maybe debug builds also.
Walt Karas
2018-12-07 16:27:22 UTC
Permalink
This doesn't conflict with those efforts, and is much easier to do.
Post by Leif Hedstrom
I thought the efforts were to be focused on getting jemalloc optimized with their concepts of arenas and NUMA affinity and thread ware allocations?
— Leif
Post by Walt Karas
Would it be desirable for ATS to use this (cleaner) version of free lists?
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/example.cc
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/Dynamic_obj.h
The advantage is faster allocation/deallocation for small objects with
short lifetimes. The disadvantage is we could reach heap exhaustion
more easily, as the free lists are reserving free memory for
allocation of a particular size (and where the size is a constexpr).
We would probably want to use conditional compilation for force
Large_threshold to 0 for FSAN builds and maybe debug builds also.
Leif Hedstrom
2018-12-07 18:54:56 UTC
Permalink
What problem does solve? Does it make things faster?

— Leif
Post by Walt Karas
This doesn't conflict with those efforts, and is much easier to do.
Post by Leif Hedstrom
I thought the efforts were to be focused on getting jemalloc optimized with their concepts of arenas and NUMA affinity and thread ware allocations?
— Leif
Post by Walt Karas
Would it be desirable for ATS to use this (cleaner) version of free lists?
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/example.cc
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/Dynamic_obj.h
The advantage is faster allocation/deallocation for small objects with
short lifetimes. The disadvantage is we could reach heap exhaustion
more easily, as the free lists are reserving free memory for
allocation of a particular size (and where the size is a constexpr).
We would probably want to use conditional compilation for force
Large_threshold to 0 for FSAN builds and maybe debug builds also.
Walt Karas
2018-12-07 20:02:20 UTC
Permalink
It's the same general idea as the current free lists, but with a
better, cleaner implementation. If there are a lot of smaller dynamic
objects with short lifetimes, it will reduce thread blocking on the
heap mutex, block coalescing, and relatively complex changes to the
data structure of free blocks.
Post by Leif Hedstrom
What problem does solve? Does it make things faster?
— Leif
Post by Walt Karas
This doesn't conflict with those efforts, and is much easier to do.
Post by Leif Hedstrom
I thought the efforts were to be focused on getting jemalloc optimized with their concepts of arenas and NUMA affinity and thread ware allocations?
— Leif
Post by Walt Karas
Would it be desirable for ATS to use this (cleaner) version of free lists?
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/example.cc
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/Dynamic_obj.h
The advantage is faster allocation/deallocation for small objects with
short lifetimes. The disadvantage is we could reach heap exhaustion
more easily, as the free lists are reserving free memory for
allocation of a particular size (and where the size is a constexpr).
We would probably want to use conditional compilation for force
Large_threshold to 0 for FSAN builds and maybe debug builds also.
Leif Hedstrom
2018-12-07 23:54:15 UTC
Permalink
Post by Walt Karas
It's the same general idea as the current free lists, but with a
better, cleaner implementation. If there are a lot of smaller dynamic
objects with short lifetimes, it will reduce thread blocking on the
heap mutex, block coalescing, and relatively complex changes to the
data structure of free blocks.
I’m pretty meh on this proposal. If it’s not broken, don’t fix it. I much rather hold off until someone is interested in doing real work on migrating the freelist over to jemalloc properly.

— leif
Post by Walt Karas
Post by Leif Hedstrom
What problem does solve? Does it make things faster?
— Leif
Post by Walt Karas
This doesn't conflict with those efforts, and is much easier to do.
Post by Leif Hedstrom
I thought the efforts were to be focused on getting jemalloc optimized with their concepts of arenas and NUMA affinity and thread ware allocations?
— Leif
Post by Walt Karas
Would it be desirable for ATS to use this (cleaner) version of free lists?
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/example.cc
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/Dynamic_obj.h
The advantage is faster allocation/deallocation for small objects with
short lifetimes. The disadvantage is we could reach heap exhaustion
more easily, as the free lists are reserving free memory for
allocation of a particular size (and where the size is a constexpr).
We would probably want to use conditional compilation for force
Large_threshold to 0 for FSAN builds and maybe debug builds also.
Walt Karas
2018-12-08 01:10:57 UTC
Permalink
How does one migrate improper code properly?
Post by Leif Hedstrom
Post by Walt Karas
It's the same general idea as the current free lists, but with a
better, cleaner implementation. If there are a lot of smaller dynamic
objects with short lifetimes, it will reduce thread blocking on the
heap mutex, block coalescing, and relatively complex changes to the
data structure of free blocks.
I’m pretty meh on this proposal. If it’s not broken, don’t fix it. I much rather hold off until someone is interested in doing real work on migrating the freelist over to jemalloc properly.
— leif
Post by Walt Karas
Post by Leif Hedstrom
What problem does solve? Does it make things faster?
— Leif
Post by Walt Karas
This doesn't conflict with those efforts, and is much easier to do.
Post by Leif Hedstrom
I thought the efforts were to be focused on getting jemalloc optimized with their concepts of arenas and NUMA affinity and thread ware allocations?
— Leif
Post by Walt Karas
Would it be desirable for ATS to use this (cleaner) version of free lists?
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/example.cc
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/Dynamic_obj.h
The advantage is faster allocation/deallocation for small objects with
short lifetimes. The disadvantage is we could reach heap exhaustion
more easily, as the free lists are reserving free memory for
allocation of a particular size (and where the size is a constexpr).
We would probably want to use conditional compilation for force
Large_threshold to 0 for FSAN builds and maybe debug builds also.
Leif Hedstrom
2018-12-08 18:59:32 UTC
Permalink
Post by Walt Karas
How does one migrate improper code properly?
You get rid of it. I’d argue that what we have works fine, has worked fine for years and your are replacing with something that we will replace anyways.

Focus on real problems IMO.

— Leif
Post by Walt Karas
Post by Leif Hedstrom
Post by Walt Karas
It's the same general idea as the current free lists, but with a
better, cleaner implementation. If there are a lot of smaller dynamic
objects with short lifetimes, it will reduce thread blocking on the
heap mutex, block coalescing, and relatively complex changes to the
data structure of free blocks.
I’m pretty meh on this proposal. If it’s not broken, don’t fix it. I much rather hold off until someone is interested in doing real work on migrating the freelist over to jemalloc properly.
— leif
Post by Walt Karas
Post by Leif Hedstrom
What problem does solve? Does it make things faster?
— Leif
Post by Walt Karas
This doesn't conflict with those efforts, and is much easier to do.
Post by Leif Hedstrom
I thought the efforts were to be focused on getting jemalloc optimized with their concepts of arenas and NUMA affinity and thread ware allocations?
— Leif
Post by Walt Karas
Would it be desirable for ATS to use this (cleaner) version of free lists?
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/example.cc
https://github.com/ywkaras/MiscRepo/blob/master/Dynamic_obj/Dynamic_obj.h
The advantage is faster allocation/deallocation for small objects with
short lifetimes. The disadvantage is we could reach heap exhaustion
more easily, as the free lists are reserving free memory for
allocation of a particular size (and where the size is a constexpr).
We would probably want to use conditional compilation for force
Large_threshold to 0 for FSAN builds and maybe debug builds also.
Walt Karas
2018-12-10 18:24:26 UTC
Permalink
Fei's being doing tests like this. But do we have a way of comparing
two executables with realistic traffic and the same traffic twice?
It's a matter of intuition how much free lists improve TS performance,
Is it? Can you benchmark with the -f and -F flags to verify the effect of free lists and the proxy allocator?
J
SUSAN HINRICHS
2018-12-10 18:29:23 UTC
Permalink
Based on Fei's measurements, the ATS freelists provide no benefit over
jemalloc. We are now in a position to do larger tests over our production
installs.
It's a matter of intuition how much free lists improve TS performance,
Is it? Can you benchmark with the -f and -F flags to verify the effect of
free lists and the proxy allocator?
J
Loading...