mds: add the option to use tcmalloc directly
As describable in http://tracker.ceph.com/issues/18225, MDS uses boost:pool by default and unused memory is usually maintained by boost::pool and won't be released back to OS.
The recent fix is trying to release those unused memory back to OS but unfortunately it doesn't work as expected in most time because boost::pool's release_memory requires memory block is ordered. MDS uses boost::pool's malloc() and free() instead of ordered_malloc() and ordered_free(), hence the unused memory is not ordered in most time.
I did some tests with ordered_malloc() and ordered_free() by replacing malloc() and free() on MDS, but the performance is too bad.
Then I tried to use tcmalloc directly without boost::pool on MDS. It worked quite well and unused memory can be released back to OS in time. Furthermore by our rough testing, performance is no obviously different between both, even tcmalloc is a little faster than boost::pool on reading large directory.
So in general, it is fine to use boost::pool on MDS in most cases while in some circumstances, e.g, limited memory on MDS node or many other services running on the same MDS node, this might be a potential problem. The change here is to add the option for user to choose tcmalloc or boost::pool on MDS according to their requirements.