Glusterfs Session #8
Memory tracking infra, io-threads
Scope
- How memory tracking is done to identify memory leaks in gluster
- How to use statedumps to identify the structures that are leaking memory
- How bricks processes scale with the number of fops
- Future improvements that can be done in io-threads.
Memory tracking infra
- Idea is to give enumerate all the data structures that will be used in an xlator
and let the memory allocation/deallocation functions to increment/decrement
the numbers as and when allocation/deallocations happen.
- Xlators can create mem_acct_init function to add its own data structures that
are used in that particular xlator.
- GF_CALLOC does increments of counts at the time of allocations.
- GF_FREE does decrements of counts at the time of de-allocations.
Memory tracking infra - Continued
header
Actual Data Trailer
How to use statedump to identify leaks
- Example of how leaks are identified
https://github.com/gluster/glusterfs/issues/2337
- Interpreting statedump output
- [global.glusterfs - usage-type gf_common_mt_xlator_t memusage]
- size=42240
- num_allocs=10
- max_size=42240
- max_num_allocs=10
- total_allocs=10
io-threads
- Why do we need an xlator like io-threads?
- How does it work?
- How can we improve latencies for different priorities of fops?
- Code walkthrough
Io-threads future directions
- Io-uring
- Thread pool implementations
Q & A

Glusterfs session #8 memory tracking infra, io-threads

  • 1.
    Glusterfs Session #8 Memorytracking infra, io-threads
  • 2.
    Scope - How memorytracking is done to identify memory leaks in gluster - How to use statedumps to identify the structures that are leaking memory - How bricks processes scale with the number of fops - Future improvements that can be done in io-threads.
  • 3.
    Memory tracking infra -Idea is to give enumerate all the data structures that will be used in an xlator and let the memory allocation/deallocation functions to increment/decrement the numbers as and when allocation/deallocations happen. - Xlators can create mem_acct_init function to add its own data structures that are used in that particular xlator. - GF_CALLOC does increments of counts at the time of allocations. - GF_FREE does decrements of counts at the time of de-allocations.
  • 4.
    Memory tracking infra- Continued header Actual Data Trailer
  • 5.
    How to usestatedump to identify leaks - Example of how leaks are identified https://github.com/gluster/glusterfs/issues/2337 - Interpreting statedump output - [global.glusterfs - usage-type gf_common_mt_xlator_t memusage] - size=42240 - num_allocs=10 - max_size=42240 - max_num_allocs=10 - total_allocs=10
  • 6.
    io-threads - Why dowe need an xlator like io-threads? - How does it work? - How can we improve latencies for different priorities of fops? - Code walkthrough
  • 7.
    Io-threads future directions -Io-uring - Thread pool implementations
  • 8.