list_lru_add_obj(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– list_lru_add_obj(9) πŸ’–

okay bestie, welcome to the Kernel API Manual ✨ β€” yes this is a section 9 page, yes it's about the kernel, and yes you're gonna get it. this one's list_lru_add_obj, and it's lowkey one of the cutest little helpers in the LRU-verse πŸ¦‹


🌸 NAME 🌸

list_lru_add_obj β€” add an element to the lru list's tail πŸ‘‘

like, it literally does what it says on the tin. element goes in, at the tail, no drama πŸ’…


✨ SYNOPSIS ✨

bool list_lru_add_obj (struct list_lru *lru , struct list_head *item );

that's it. that's the whole vibe check πŸ”₯ returns a bool, takes two pointers, slays.


πŸŽ€ ARGUMENTS πŸŽ€

  • lru β€” the lru pointer 🫢 this is your list, your main character. hand it over and it'll do the thing.
  • item β€” the item to be added. yes, the actual thing going on the list. icon behavior πŸ’–

🌈 DESCRIPTION 🌈

so here's the tea β˜• β€” this function is similar to list_lru_add, but with a little twist: the NUMA node and the memcg of the sublist are determined by the item's list_head, not by you passing them in. it just knows. iykyk 🧚

and this assumption is valid for slab objects LRU such as dentries, inodes, etc. β€” so if that's your situation, you're so good, no cap πŸ’œ

ngl, key word here is assumption β€” it holds for slab objects LRU like the ones listed above. that's the contract, bestie, don't come for it πŸ™ˆ

⭐ RETURN ⭐

  • true β€” the list was updated πŸŽ‰ slay, it worked
  • false β€” otherwise 😭 the list was not updated

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/list_lru.h β€” go read it, it's giving lore πŸ‘‘

and these icons, all in their natural habitat:


and that's the page, bestie 🫢 this little gem comes straight from the ./include/linux corner of the kernel tree, dated October 2026 β€” go add some objects to some tails, you've got this πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from