STRUCT DMA_RESV_ITER(9)
๐ struct dma_resv_iter(9) โ the Kernel API Manual, but make it cute
okay bestie, so we're deep in the Kernel API Manual today and the topic is struct dma_resv_iter, which is literally just current position into the dma_resv fences. that's it. that's the vibe. it's an iterator, it knows where you are in the fence list, and it's lowkey the main character of your dma_resv traversal. periodt. ๐
โจ SYNOPSIS โจ
here's the whole struct, char-for-char, no cap:
struct dma_resv_iter {
struct dma_resv *obj;
enum dma_resv_usage usage;
struct dma_fence *fence;
enum dma_resv_usage fence_usage;
unsigned int index;
struct dma_resv_list *fences;
unsigned int num_fences;
bool is_restarted;
};
๐ธ Members (the cast of characters)
objโ thedma_resvobject we iterate over. our home base ๐usageโ return fences with this usage or lower. it's giving filter settings โจfenceโ the currently handled fence. the one in the spotlight rn ๐fence_usageโ the usage of the current fence. receipts for the current fence ๐ฅindexโ index into the shared fences. counting girlies stay winning ๐ขfencesโ the shared fences; private, MUST not dereference ๐จ like fr fr do NOT touch, it's giving forbidden snacknum_fencesโ number of fences. the math. the arithmetic. ๐งฎis_restartedโtrueif this is the first returned fence. plot twist detector ๐
๐ DESCRIPTION ๐
okay so the actual instruction here is simple: don't touch this directly in the driver. use the accessor function instead. that's the whole rule. respect the boundary, bestie ๐ซถ
โ ๏ธ IMPORTANT โ ๏ธ when using the lockless iterators likedma_resv_iter_next_unlockedordma_resv_for_each_fence_unlocked, beware that the iterator can be restarted. ๐ญ if your code accumulates statistics or similar, you need to check for this withdma_resv_iter_is_restarted. do not skip the vibe check, or your stats will be a whole lie. ๐
๐ฆ SEE ALSO ๐ฆ
everything else in the family, all of it, no skips:
- Kernel file
./include/linux/dma-resv.hโenum dma_resv_usage(9) dma_resv_usage_rw(9)struct dma_resv(9)dma_resv_iter_begin(9)dma_resv_iter_end(9)dma_resv_iter_usage(9)dma_resv_iter_is_restarted(9)dma_resv_for_each_fence_unlocked(9)dma_resv_for_each_fence(9)dma_resv_lock(9)dma_resv_lock_interruptible(9)dma_resv_lock_slow(9)dma_resv_lock_slow_interruptible(9)dma_resv_trylock(9)dma_resv_is_locked(9)dma_resv_locking_ctx(9)dma_resv_unlock(9)
that's the whole page, bestie, you ate that ๐
sign-off time: this icon was brought to you by the source at ./include/linux, dated October 2026, filed under struct dma_resv_iter(9) โ go forth and iterate responsibly ๐โจ
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms