list_lru_walk_one_irq(9)
π list_lru_walk_one_irq(9) π
okay so bestie, buckle up β this one's from the Kernel API Manual and it's genuinely such a mood. It's giving "i walk the LRU but make it interrupt-safe" energy and honestly? iconic. β¨
πΈ NAME πΈ
list_lru_walk_one_irq β walk a @lru, isolating and disposing freeable items. yes you read that right, we're walking, we're isolating, we're disposing. main character behaviour fr fr π
π¦ SYNOPSIS π¦
unsigned long list_lru_walk_one_irq (struct list_lru *lru , int nid ,
struct mem_cgroup *memcg , list_lru_walk_cb isolate , void *cb_arg ,
unsigned long *nr_to_walk );
like look at that signature. six whole arguments. she's high maintenance and we respect it π
π ARGUMENTS π
lruβ the lru pointer. the actual LRU we're strolling through, no cap πΆββοΈnidβ the node id to scan from. which node, bestie? that one. πmemcgβ the cgroup to scan from. we stay in our lane (our cgroup) πisolateβ callback function that is responsible for deciding what to do with the item currently being scanned. this is the whole personality of the walk ngl β you decide the fate of each item, the kernel just hands them to you π«Άcb_argβ opaque type that will be passed toisolate. it's opaque, we don't peek, we just pass it along like a sealed letter πnr_to_walkβ how many items to scan. set your limit, know your limit π₯
π DESCRIPTION π
Same as list_lru_walk_one except that the spinlock is acquired with spin_lock_irq.
that's it. that's the whole vibe. literally the one (1) difference and it's a big deal β we're grabbing that spinlock with spin_lock_irq instead, so interrupts get handled properly. lowkey the whole reason this function exists β¨
π SEE ALSO π
Kernel file ./include/linux/list_lru.h β and the whole friend group:
folio_memcg_list_lru_alloc(9)list_lru_lock(9)list_lru_unlock(9)list_lru_add(9)list_lru_add_obj(9)list_lru_del(9)list_lru_del_obj(9)list_lru_count_one(9)list_lru_walk_one(9)
go read them, they're all slaying in their own way ππ¦
aaaand that's the page!! π brought to you by the fine folks over at ./include/linux, dated October 2026, living in the Kernel API Manual β she's serving kernel documentation realness and we ate, no crumbs left πππ
π¦ 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