Re: [PATCH/RFC] module: replace module_layout with module_memory

From
Peter Zijlstra <peterz@infradead.org>
Date
2023-01-18 15:07:45
Also in
lkml
Reply to
Christophe Leroy, 2023-01-10
On Tue, Jan 10, 2023 at 06:31:41AM +0000, Christophe Leroy wrote:
Le 09/01/2023 à 21:51, Song Liu a écrit :
quoted
Do you mean one tree will cause addr_[min|max] to be inaccurate?
Yes at least. On powerpc you will have module text below kernel, 
somewhere between 0xb0000000 and 0xcfffffff, and you will have module 
data in vmalloc area, somewhere between 0xf0000000 and 0xffffffff.

If you have only one tree, any address between 0xc0000000 and 0xefffffff 
will trigger a tree search.
The current min/max thing is tied to the tree because of easy update on
remove, but module-insert/remove is not a performance critical path.

So I think it should be possible to have {min,max}[TYPES] pairs.  Either
brute force the removal -- using a linear scan of the mod->list to find
the new bounds on removal.

Or overengineer the whole thing and use an augmented tree to keep that
many heaps in sync during the update -- but this seems total overkill.

The only consideration is testing that many ranges in
__module_address(), this is already 2 cachelines worth of range-checks
-- which seems a little excessive.

(also, I note that module_addr_{min,max} are unused these days)
Thread (18 messages) 18 messages, 4 authors, last reply 2023-01-24
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help