Fix base allocator THP auto mode locking and stats.

Added proper synchronization for switching to using THP in auto mode.  Also
fixed stats for number of THPs used.
This commit is contained in:
Qi Wang
2017-11-07 19:40:38 -08:00
committed by Qi Wang
parent b5d071c266
commit cb3b72b975
2 changed files with 18 additions and 21 deletions

View File

@@ -30,6 +30,8 @@ struct base_s {
/* Protects base_alloc() and base_stats_get() operations. */
malloc_mutex_t mtx;
/* Using THP when true (metadata_thp auto mode). */
bool auto_thp_switched;
/*
* Most recent size class in the series of increasingly large base
* extents. Logarithmic spacing between subsequent allocations ensures