From mboxrd@z Thu Jan 1 00:00:00 1970 From: mcsim.planeta@gmail.com (Maksym Planeta) Date: Fri, 18 Mar 2011 07:52:19 +0200 Subject: slab: cache sizes for kmalloc In-Reply-To: References: <1300403900.7517.41.camel@debian> Message-ID: <1300427539.10893.22.camel@debian> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Fri, 18/03/2011 at 06:56 +0700, Mulyadi Santosa wrote: > On Fri, Mar 18, 2011 at 06:18, Maksym Planeta wrote: > > I've wrote a hook were I've counted witch object sizes are the most > > popular. > > Uhuh, and why you just don't use "slabtop" utility which just use > /proc/slabinfo? In slabinfo I can see which cache how many objects has. But I was interested witch object sizes are requested most of all. And there isn't such information in slabinfo. For example, if I request 8 bytes 32-byte object will be allocated. And there is no information in slabinfo how much memory I really needed. > I think 32 byte is chosen due to the size of the page in x86 32 bit == > 4 KiB... by doing that, cache is simply allocated using page_alloc (or > alloc_page? I forgot) and then later "teared apart" into slab > objects... > But in slub allocator there are 8- and 16- byte caches. Why in slab can't be the same? -- Thanks, Maksym Planeta