Re: cache coloring

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

 



On Wed, Oct 01, 2003 at 03:37:48 -0000, sushil  mayengbam wrote:
> hi folks/
> i've some trouble in digesting the idea of Bhowmick's "slab 
> coloring" concept.
> can anyone of u chew this things out taking some logical 
> example???.
> i apologize if my question is too naive.
> (and lastly, i must thank "Riek and mel Gorman " for their 
> valuable documents on MM.)

I don't understand the hardware-related implications too well, but it's
along the lines of:

To make life easier, hardware caches are organized in cache-lines. Each
cache-line always caches blocks (some eg 32 bytes wide) with same low
address bits (above the cache-line width).

So if the structure always started at, say 64-byte, boundary, it's first
half (asume it's where the most used data are) would always use even
cacheline. So the computer would soon ran out of even cachelines, while
the odd ones would be unused.

Thus the starting address for data in each page is shifted by some
amount in each page. Thus the hot data will end up in different
cache-lines for different instances of given objects. That leads to
better cache utilization and thus speed up of operations like list
walking.

Note, that since last few bytes (3 pointers IIRC) of each page is used
by slab cache itself, power-of-two sized structures, which most benefit
from coloring, never fit the slab exactly, leaving good possibility for
coloring.

Then there is a lot of black magic involved in tweaking various
constants for best performance on given architecture.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux