From: Xiubo Li Date: Fri, 12 Mar 2021 12:49:24 +0000 (+0800) Subject: lockdep: switch follows_bt vector member to std::map X-Git-Tag: v17.1.0~2591^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a873edba9e009ec34150ac5f6cd5ce9fa0dd5719;p=ceph.git lockdep: switch follows_bt vector member to std::map 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 --- diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index 59d42780a895..241e2ea3c140 100644 --- a/src/common/lockdep.cc +++ b/src/common/lockdep.cc @@ -41,9 +41,8 @@ static constexpr size_t MAX_LOCKS = 128 * 1024; // increase me as needed static std::bitset free_ids; // bit set = free static ceph::unordered_map > held; static constexpr size_t NR_LOCKS = 4096; // the initial number of locks -static constexpr size_t MAX_FOLLOWERS = 4096; -static std::vector> follows(NR_LOCKS); // follows[a][b] means b taken after a -static std::vector> follows_bt(NR_LOCKS); +static std::vector> follows(NR_LOCKS); // follows[a][b] means b taken after a +static std::vector> follows_bt(NR_LOCKS); // upper bound of lock id unsigned current_maxid; int last_freed_id = -1;