linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Idea to improve the performance of the Kernel Memory Allocation
@ 2000-05-15  2:34 Guilherme Carvalho
  2000-05-15 12:39 ` Stephen C. Tweedie
  0 siblings, 1 reply; 2+ messages in thread
From: Guilherme Carvalho @ 2000-05-15  2:34 UTC (permalink / raw)
  To: linux-mm

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

Hi,

I had an idea to improve the performance of the Kernel Memory
Allocation...
If I am right, the buddy allocation algorithm first searches for blocks
of pages of the size requested and follows the chain of free pages that
is queued on the list element of the the free_area data structure. If no
blocks of pages of the requested size are free, blocks of the next size
are looked for...

free_area:
|  4096  | -> |  8  | -> | 1024  | -> | 8192  | -> | 2  | -> | 4  | -> |
2  | -> | 256  | -> | 512  | -> | 4  | -> | 8  | -> | 16  | ->

in this case, if we request 32 pages, the algorithm will scan the chain
4 times to find the right block.
I think this chain isn't the best structure to do it.

the idea is to make a tree of chains as it is in the attach
(arv-list.jpg).
this tree should be an AVL tree for better performance.

Each element of the tree would be an chain
Each element of the chain would be

Struct free_area_struct {
 struct page *next;
 struct page *prev;                //      <- Free area element
 unsigned int *map;
 unsigned long count;
// +
struct page *next_in_chain;       //     <- pointer to the next free
area with the same size
 };

the old pointers would remain because the deallocation process need
them, to recombine them in larger blocks.

I am a linux code beginner, so I don't know how to put it on linux (and
keep it working too).
Are Anyone interested in try it?

Guilherme Carvalho

[-- Attachment #2: arv-list.jpg --]
[-- Type: image/jpeg, Size: 21036 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-05-15 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-15  2:34 Idea to improve the performance of the Kernel Memory Allocation Guilherme Carvalho
2000-05-15 12:39 ` Stephen C. Tweedie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox