list_lru_walk_one_irq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to isolate. 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:

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