Re: [patch 09/10] Remove the SLOB allocator for 2.6.23

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

 



Hi Nick,

Pekka Enberg wrote:
> I assume with "slab external fragmentation" you mean allocating a
> whole page for a slab when there are not enough objects to fill the
> whole thing thus wasting memory?

On 7/9/07, Nick Piggin <[email protected]> wrote:
Yep. Without really analysing it, I guess SLOB's savings here are
O(1) over SLUB and will relatively diminish as the machine size gets
larger, however with the number of slabs even a small kernel creates,
this is likely to be significant on small memory systems.

Running the included script on my little Debian on UML with 32 MB of
RAM shows anywhere from 20 KB up to 100 KB of wasted space on light
load. What's interesting is that the wasted amount seems to stabilize
around 70 KB and never goes below that.

                                              Pekka

#!/bin/bash

total_wasted=0

for i in $(find /sys/slab -type d -mindepth 1 -maxdepth 1 | sort)
do
 nr_objs=$(cat $i/objects)
 slabs=$(cat $i/slabs)
 objs_per_slab=$(cat $i/objs_per_slab)
 let "max_objs=$objs_per_slab*$slabs"

 object_size=$(cat $i/object_size)
 let "wasted=($max_objs-$nr_objs)*$object_size"

 if [ "$wasted" -ne "0" ]; then
   echo "$i: max_objs=$max_objs, nr_objs=$nr_objs, $wasted bytes wasted"
 fi
 let "total_wasted=$total_wasted+$wasted"
done

echo "Total wasted: $total_wasted"
-
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