From: Mel Gorman <mgorman@suse.de>
To: Pintu Agarwal <pintu_agarwal@yahoo.com>
Sent: Friday, 1 July 2011 12:21 PM
Subject: Re: JPEG image creation for memory fragmentation
On Thu, Jun 30, 2011 at 08:02:15AM -0700, Pintu Agarwal wrote:
> I need to create a sample jpeg image for displaying page states
> and fragmentation info across each zone by collecting data from
> /proc/buddyinfo and
/proc/pagetypeinfo a one instance of time.
>
> I saw your article about anti-fragmentation and page type distribution in the form of image from the following links:-
>
http://lwn.net/Articles/224835/>
http://www.skynet.ie/~mel/anti-frag/2007-02-28/page_type_distribution.jpg>
> I wanted to understand, I to create the similar image using my data
> from buddyinfo and pagetypeinfo in my case.
There is insufficient data from buddyinfo and pagetypeinfo to generate
the image linked above.
> What logic you used for creating these images?
I used a perl script reading information via a kernel module and
creating the image with libgd. If I was doing it again, I would
read the
necessary information from /proc/kpageflags. If I needed
a greater degree of accuracy, I would patch the kernel to expand on
the information available in /proc/kpageflags.
> How did you use the buddyinfo data to form this image?
I didn't use buddyinfo.
> Can you give some details about it?
>
> Like your aticle I am also defining the following:-
> - Each block size is 1024
> - Each page is one pixel
> - Free page will be gray color
> - Movable page will be green color
> - Reclaimable page will be blue color
> - And (I dont want zoneboundary, percpu, pinned pages etc in the image)
>
> Now suppose my system page state at some point of time looks like this:-
> -----------------------------------------------------------------------------------------
> Node:1, Zone:DMA
> Order
FreePages MovablePages ReclaimablePages Fragmentation[%]
> 0 38 36 1 0%
> 1 59 55 2 0%
>
2 40 32 1 2%
> 3 19 16 0 4%
> 4 12
10 1 6%
> 5 4 2 1 9%
> 6 6 4
1 11%
> 7 7 4 0 16%
> 8 7 0 1 29%
>
9 2 1 0 55%
> 10 2 2 0 70%
> TotalFreePages: 6932
> TotalMovablePages: 3954
> TotalReclaimablePages: 377
> Overall Fragmentation: 18%
>
-----------------------------------------------------------------------------------------
> How to represent this in the form of a jpeg image?
There is insufficient data there to generate the same jpeg but I doubt
it'd be very helpful anyway. Generating the images was a handy way of
validating anti-fragmentation was working as expected and convincing
people that it was behaving in the right way but I never used it to
formally evaluate how well fragmentation was being handled. For that
I used unusable free space index, a fragmentation index, allocation
latencies and success rates for allocating huge pages.
--
Mel Gorman
SUSE Labs