-
Notifications
You must be signed in to change notification settings - Fork 20
Add the list_lru interator helper #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
No hurry with this helper. I am writing a test that walks through a memcg aware lru (any filesystem's dentry lru) and a memcg unaware lru (the xfs_buf lru if the filesystem type is xfs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're already doing a respin, I wanted to give a little bit of feedback that should reduce the round trips on this review. The code logically is looking great, but stylistically, there's some things that don't fit with the project's existing code style. I don't want to waste developer's time or mental effort on code style though, so we use some automatic code formatters & linters to help catch these things at commit time.
It's documented here, the checks happen via a pre-commit hook. You can set it up via:
# OL9
dnf install -y pre-commit
# OL8
dnf install python39-pip
python3.9 -m pip install --user pre-commit
# Then, for both:
cd path/to/drgn-tools
pre-commit install --install-hooks
Next time you commit (including amending a commit), the hook will check code. Some checks (e.g. code style) automatically make the changes to your code, so you'll just need to git add
those changes. Other checks are just linters, so they may surface an issue you'll need to manually address.
I wrote a simple drgn script that uses list_lru to count the dentry and negative dentry for one or more fileystems using for_each_mount(). https://github.com/marktinguely/examples/blob/main/count_neg_dentry.py |
75d3467
to
8643d71
Compare
drgn iterator for list_lru and test that walks filesystem(s) and verifies the memcg and NUMA node id. Signed-off-by: Mark Tinguely <mark.tinguely@oracle.com>
list_lru iterators for UEK5, UEK6, UEK7 and UEK8.
The list_lru iteration can iterate all memcg and NUMA nodes or one memcg index and one NUMA node.
list_lru_kmem_to_memcgidx() is provided to calculate the memcg index for a list_lru kvm address. This routine is written for list_lru kernel address and assumes slab allocated addresses.
list_lru_kmem_to_nodeid() is provided to calculate the NUMA node id for a list_lru kvm address.
tests/test_list_lru.py uses every function to walk filesystem(s) and gets the memcg index and NUMA node id of the dentry (and xfs_buf on XFS filesystems) and uses those values to verify that list_lru_kmem_to_memcgidx() finds the entry.
There is an example that counts negative dentry at:
https://github.com/marktinguely/examples/blob/main/count_neg_dentry.py