arm_smmu_invs_unref(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… arm_smmu_invs_unref(9) β€” a Kernel API Manual moment

Okay bestie, welcome to the arm_smmu_invs_unref(9) page from the Kernel API Manual, and honestly? It's giving "quietly iconic little helper function" energy. No cap, this one's a supporting character with main character energy. πŸŽ€


✨ NAME ✨

arm_smmu_invs_unref β€” find in @invs for all entries in @to_unref, decrease the user counts without deletions 🫢


🌸 SYNOPSIS 🌸

VISIBLE_IF_KUNIT void arm_smmu_invs_unref (struct arm_smmu_invs *invs ,
struct arm_smmu_invs *to_unref );

πŸ’– ARGUMENTS πŸ’–

  • invs β€” the base invalidation array. The original. The main character. πŸ‘‘
  • to_unref β€” an array of invalidations to decrease their user counts. Basically the "hey can you take one off the counter for these ones" list. ✨

⭐ RETURN ⭐

It hands you back the number of trash entries in the array β€” and that number is for arm_smmu_invs_purge, so don't lose it, bestie. πŸ—‘οΈπŸ’œ


πŸ¦‹ DESCRIPTION πŸ¦‹

So, story time. This function will not fail. Like, at all. It simply does not have a failure arc. πŸ’€ Any entry with users=0 will be marked as trash, and the caller gets notified about that trashed entry via to_unref by setting a users=0. Lowkey elegant.

All the tailing trash entries in the array will be dropped. Gone. Bye. πŸ‘‹ And the size of the array will be trimmed properly β€” a little glow-up, if you will. But all the trash entries in-between will remain in the invs until they get completely deleted by the next arm_smmu_invs_merge or an arm_smmu_invs_purge function call. So they're just... hanging out. In the middle. πŸ™ˆ

This function must be locked and serialized with arm_smmu_invs_merge and arm_smmu_invs_purge, but do not lockdep on any mutex for KUNIT test. That part is important, fr fr. πŸ”’

And one more note, because we keep it real here: the final invs->num_invs might not reflect the actual number of invalidations, thanks to those trash entries. So any reader should take the read lock to iterate each entry and check its users counter till the last entry. Don't skip the check. Don't trust the count. Check every single one. πŸ’…


🌈 SEE ALSO 🌈

Kernel file ./drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Plus these besties right here:


And that's the whole vibe check! πŸ’– Signing off from ./drivers/iommu/arm/arm-smmu-v3, dated October 2026, your girl arm_smmu_invs_unref(9) β€” slay, stay locked, and always read your users counters. 🧚🌸🌟

πŸ“¦ where this page comes from