Edata: split up different list linkage uses.

This commit is contained in:
David Goldblatt
2020-06-11 15:15:51 -07:00
committed by David Goldblatt
parent 129b727058
commit 392f645f4d
12 changed files with 55 additions and 47 deletions

View File

@@ -69,7 +69,7 @@ struct arena_s {
*
* Synchronization: large_mtx.
*/
edata_list_t large;
edata_list_active_t large;
/* Synchronizes all large allocation/update/deallocation. */
malloc_mutex_t large_mtx;

View File

@@ -32,7 +32,7 @@ struct bin_s {
edata_heap_t slabs_nonfull;
/* List used to track full slabs. */
edata_list_t slabs_full;
edata_list_active_t slabs_full;
/* Bin statistics. */
bin_stats_t stats;

View File

@@ -185,22 +185,28 @@ struct edata_s {
size_t e_bsize;
};
/*
* List linkage, used by a variety of lists:
* - bin_t's slabs_full
* - extents_t's LRU
* - stashed dirty extents
* - arena's large allocations
*/
ql_elm(edata_t) ql_link;
/*
* Linkage for per size class sn/address-ordered heaps, and
* for extent_avail
*/
phn(edata_t) ph_link;
union {
/*
* List linkage used when the edata_t is active; either in
* arena's large allocations or bin_t's slabs_full.
*/
ql_elm(edata_t) ql_link_active;
/*
* Pairing heap linkage. Used whenever the extent is inactive
* (in the page allocators), or when it is active and in
* slabs_nonfull, or when the edata_t is unassociated with an
* extent and sitting in an edata_cache.
*/
phn(edata_t) ph_link;
};
union {
/*
* List linkage used when the extent is inactive:
* - Stashed dirty extents
* - Ecache LRU functionality.
*/
ql_elm(edata_t) ql_link_inactive;
/* Small region slab metadata. */
slab_data_t e_slab_data;
@@ -209,7 +215,8 @@ struct edata_s {
};
};
TYPED_LIST(edata_list, edata_t, ql_link)
TYPED_LIST(edata_list_active, edata_t, ql_link_active)
TYPED_LIST(edata_list_inactive, edata_t, ql_link_inactive)
static inline unsigned
edata_arena_ind_get(const edata_t *edata) {

View File

@@ -27,7 +27,7 @@ void edata_cache_postfork_child(tsdn_t *tsdn, edata_cache_t *edata_cache);
typedef struct edata_cache_small_s edata_cache_small_t;
struct edata_cache_small_s {
edata_list_t list;
edata_list_inactive_t list;
size_t count;
edata_cache_t *fallback;
};

View File

@@ -25,7 +25,7 @@ struct eset_s {
bitmap_t bitmap[BITMAP_GROUPS(SC_NPSIZES + 1)];
/* LRU of all extents in heaps. */
edata_list_t lru;
edata_list_inactive_t lru;
/* Page sum for all extents in heaps. */
atomic_zu_t npages;