|
|
Log in / Subscribe / Register

The LRU lock and mmap_sem

The LRU lock and mmap_sem

Posted Apr 30, 2018 19:22 UTC (Mon) by willy (subscriber, #9762)
Parent article: The LRU lock and mmap_sem

I have an entirely different approach in mind which I need to get to the top of my investigation list in the next year or so.

list_heads suck. To remove something from a list you touch three cachelines. By using a data structure like the XArray (currently called the XQueue), you can get all the functionality of a list (insert anywhere, delete any element) with reduced memory consumption and reduced cacheline usage. It gets even better when you take advantage of the data structure to do something like "remove batch from head of list" and get an array of between 1 and 64 pointers to process.


to post comments

The LRU lock and mmap_sem

Posted May 9, 2018 8:41 UTC (Wed) by jan.kara (subscriber, #59161) [Link]

I'm not sure you need the full power (and thus complexity) of the radix tree (which is what is currently behind XArray) for replacement of list_heads. But I was also thinking a few times whether we would not be better off replacing some of the linked lists with a linked list of smallish arrays (essentially the lowest level of the radix tree + neighbor pointers).


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds