Delete the MAX_FOLLOWERS and increase the bitset size to MAX_LOCKS
in 'follows'. The maximum memories of the 'follows' will be 2GB.
But for the 'follows_bt', if we continue use the std::array, the
maximum memories will be 128G, but most of the array spaces are
useless. Switch the std::array to std::man instead.
Signed-off-by: Xiubo Li <xiubli@redhat.com>
static std::bitset<MAX_LOCKS> free_ids; // bit set = free
static ceph::unordered_map<pthread_t, std::map<int,ceph::BackTrace*> > held;
static constexpr size_t NR_LOCKS = 4096; // the initial number of locks
-static constexpr size_t MAX_FOLLOWERS = 4096;
-static std::vector<std::bitset<MAX_FOLLOWERS>> follows(NR_LOCKS); // follows[a][b] means b taken after a
-static std::vector<std::array<ceph::BackTrace *, MAX_FOLLOWERS>> follows_bt(NR_LOCKS);
+static std::vector<std::bitset<MAX_LOCKS>> follows(NR_LOCKS); // follows[a][b] means b taken after a
+static std::vector<std::map<int,ceph::BackTrace *>> follows_bt(NR_LOCKS);
// upper bound of lock id
unsigned current_maxid;
int last_freed_id = -1;