lkml.org 
[lkml]   [2002]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectsuggestion for changing kmalloc()
hi folks,

I am sending this mail again as i forgot to put a subject line
previously, so chances are
that some of u may have missed it.

as kmalloc allocates memory in power of 2 ( starting from 32 )
instead of the size requested. there are following problems :

1) we are allocating at least 32 bytes in all cases ( most of
the times it is not
required ).

2) if we allocate large memory, internal fregmentation also
increases.

3) allocating more memory then the request often leads to
programming errors
esp. when we store some data and read it back or try to get size
of data stored
( though it can be handled but we have to take special care of
it at every point ).

the solution to above problems may be that we dont allocate
objects from the 13
general purpose caches, instead we make a new cache keep its
address either in
cache_sizes or declare it global. now as the kmalloc is invoked
check the memory size
requested if predefined sizes are not suitable then make a new
object of the size
requested ( now here the definition of c_offset flag of cache
descriptor may be
violated ) and allot it to our new cache and return it .

i know that there may be subtle problems in it's
implementation.
i need your suggestions. is it worth to make efforts in this
field.

keenly waitinf for ur reply
tushar korde
_________________________________________________________
Click below to visit monsterindia.com and review jobs in India or
Abroad
http://monsterindia.rediff.com/jobs

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

\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.028 / U:12.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site