Re: RFC: Non Power of 2 memory allocator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robin Getz <[email protected]> writes:

> The  buddy system allocates things in power of 2 pages sizes (4k, 8k,
> 16k, 32k, 64k, 128k, 256k, 512k, 1024k), which works fine on most
> systems, but an embedded system, which is running without a MMU (
> Memory Management Unit) - RAM is precious, and when you only need
> 129k for an application, you don't want to allocate a power of 2,
> which gives you 256k -  an extra 127k, which can't be used by
> anything else.

In 2.4 I solved this problem at some point by just returning
the excess pages to the buddy allocator. There was even
a nice function to do this (alloc_exact)

That won't work for slab, but does for __get_free_pages() which
is better for large allocations anyways. slab imho doesn't make
sense for allocation anywhere bigger PAGE_SIZE/2. At some
point in 2.6 there was trouble with "compound pages" but I think
that has been resolved. 

Just implementing alloc_exact again would be the simplest solution
for your problem.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux