ttm_lru_first_res_or_null(9)
β¨ ttm_lru_first_res_or_null(9) β¨
okay bestie, so this one is a little kernel API manual page, like from the Kernel API Manual collection β and honestly? it's short, it's sweet, and it does exactly one (1) thing. let's get into it π
πΈ NAME πΈ
ttm_lru_first_res_or_null β literally just peeks at an lru list and hands you back the first resource on it. that's the whole vibe. π
π¦ SYNOPSIS π¦
struct ttm_resource * ttm_lru_first_res_or_null (struct list_head *head
);
yes queen, that's the whole signature. one argument, one pointer back, no drama. β¨
π ARGUMENTS π
headβ the list head of the lru list. like, the entry point to the whole thing. you hand it over, it does the looking. π«Ά
β RETURN β
a pointer to the first resource on the lru list β slay β or NULL if there isn't one. that's it. if the list is empty you get NULL, no cap, no surprises. π
fr fr, check for that NULL before you dereference, bestie. the function is honest about it but it's still on you. π
π SEE ALSO π
the kernel file this lives in:
./drivers/gpu/drm/ttm/ttm_resource.c
and the whole friend group of related pages, gathered here so you never have to go looking:
ttm_resource_cursor_init(9),ttm_resource_cursor_fini(9)ttm_lru_bulk_move_init(9),ttm_lru_bulk_move_fini(9),ttm_lru_bulk_move_tail(9)ttm_resource_init(9),ttm_resource_fini(9)ttm_resource_try_charge(9),ttm_resource_intersects(9),ttm_resource_compatible(9)ttm_resource_manager_init(9),ttm_resource_manager_usage(9),ttm_resource_manager_debug(9)ttm_resource_manager_first(9),ttm_resource_manager_next(9)ttm_kmap_iter_iomap_init(9),Linear io iterator(9),ttm_kmap_iter_linear_io_init(9),ttm_kmap_iter_linear_io_fini(9)ttm_resource_manager_create_debugfs(9)ttm_resource_manager_dmem_reclaim(9)ttm_resource_manager_set_dmem_region(9)
and that's the whole page, bestie, you ate it up π
this little icon came straight out of ./drivers/gpu/drm/ttm, dated October 2026 β go forth and lru π¦β¨
π¦ 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