Skip to content

Conversation

@sdimitro
Copy link
Contributor

On a system with more than 1 nodes per cache:

sdb> addr nr_node_ids | deref
(unsigned int)2

Before this patch:

sdb> spl_kmem_caches -s active_memory | head 1 | spl_kmem_caches
name                entry_size active_objs active_memory                    source total_memory util
------------------- ---------- ----------- ------------- ------------------------- ------------ ----
arc_buf_hdr_t_full         328     8956159         2.7GB  arc_buf_hdr_t_full[SLUB]        1.3GB  203

In the output above the SLUB helpers are only looking at the first
node of the kmem cache and undercount the amount of active objects
in the SLUB layer and thus reporting less total_memory. As a result
the SPL that explicitly tracks the counts of those allocations shows
the correct number of active objects resulting to the above
inconsistency where active_memory is more than total_memory and util%
is more than 100%.

After this patch:

sdb> spl_kmem_caches -s active_memory | head 1 | spl_kmem_caches
name                entry_size active_objs active_memory                    source total_memory util
------------------- ---------- ----------- ------------- ------------------------- ------------ ----
arc_buf_hdr_t_full         328     9250638         2.8GB  arc_buf_hdr_t_full[SLUB]        2.8GB   99

The behavior is corrected.

On a system with more than 1 nodes per cache:
```
sdb> addr nr_node_ids | deref
(unsigned int)2
```

Before this patch:
```
sdb> spl_kmem_caches -s active_memory | head 1 | spl_kmem_caches
name                entry_size active_objs active_memory                    source total_memory util
------------------- ---------- ----------- ------------- ------------------------- ------------ ----
arc_buf_hdr_t_full         328     8956159         2.7GB  arc_buf_hdr_t_full[SLUB]        1.3GB  203
```
In the output above the SLUB helpers are only looking at the first
node of the kmem cache and undercount the amount of active objects
in the SLUB layer and thus reporting less total_memory. As a result
the SPL that explicitly tracks the counts of those allocations shows
the correct number of active objects resulting to the above
inconsistency where active_memory is more than total_memory and util%
is more than 100%.

After this patch:
```
sdb> spl_kmem_caches -s active_memory | head 1 | spl_kmem_caches
name                entry_size active_objs active_memory                    source total_memory util
------------------- ---------- ----------- ------------- ------------------------- ------------ ----
arc_buf_hdr_t_full         328     9250638         2.8GB  arc_buf_hdr_t_full[SLUB]        2.8GB   99
```
The behavior is corrected.
@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2020

Codecov Report

Merging #233 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #233      +/-   ##
==========================================
+ Coverage   87.29%   87.35%   +0.05%     
==========================================
  Files          60       60              
  Lines        2456     2467      +11     
==========================================
+ Hits         2144     2155      +11     
  Misses        312      312              
Impacted Files Coverage Δ
sdb/commands/linux/internal/slub_helpers.py 98.54% <100.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3aded5...ba00946. Read the comment docs.

@sdimitro sdimitro requested a review from ahrens July 22, 2020 00:51
@sdimitro sdimitro merged commit e5c1c96 into delphix:master Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants