lkml.org 
[lkml]   [1999]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectLinux Kernel Description(s)
Hello, I'm applying for a kernel programming job
and before I send my files out along with my resume,
I would like someone very knowledgable about the Linux
kernel to go over these attached files and state any
incorrect information.

Thanks,
Omachonu Ogali

--
Omachonu Ogali...omachonu.ogali@softhome.net
---
What's soft, furry, and bites? It sure ain't no penguin... Tonight, (once again the same day), in addition to finding the
purpose of /proc/sys/vm/swapctl, I became even more determined and I've
also managed to figure out what the 'kswapd' file is for. Utilized by
the swap page recovery daemon (kswapd), its structure, also found in
/usr/src/linux/include/linux/swapctl.h, is as follows:

-- start of code --
typedef struct kswapd_control_v1
{
int maxpages;
int pages_buff;
int pages_shm;
int pages_mmap;
int pages_swap;
} kswapd_control_v1;
-- end of code --

-- sample kswapd dump --
powerplant:/proc/sys/vm# cat kswapd
4 -1 -1 -1 -1
-- end of dump --

This file conforms to the following structure:

Maximum Pages: 4
Buffer Pages: -1
Shared Memory Pages: -1
Memory Mapped Pages: -1
Swap Pages: -1

'Maximum Pages' is the amount of pages to swap out in the
background before checking free_pages_low and free_pages_high. 'Buffer
Pages' is the amount of to swap out when kswapd() is called. 'Shared
Memory Pages', 'Swap Pages' and 'Memory Mapped Pages' are the same as
'Buffer Pages' except that they are for different type of pages.

Omachonu Ogali
--------------
omachonu.ogali@softhome.net

"There is almost nothing a
fifteen year old kernel
hacker can't fix/tweak/(insert
any other handy-dandy term here)/
understand/compile"
Tonight, tired and bored I dove into the kernel source
head first...I finally realized the purpose of the 'swapctl' file.
Its format is the structure 'swap_control_v5' found in
/usr/src/linux/include/linux/swapctl.h,

-- start of code --
typedef struct swap_control_v5
{
int sc_max_page_age;
int sc_page_advance;
int sc_page_decline;
int sc_page_initial_age;
int sc_max_buff_age;
int sc_buff_advance;
int sc_buff_decline;
int sc_buff_initial_age;
int sc_age_cluster_fract;
int sc_age_cluster_min;
int sc_pageout_weight;
int sc_bufferout_weight;
int sc_buffer_grace;
int sc_nr_buffs_to_free;
int sc_nr_pages_to_free;
enum RCL_POLICY sc_policy;
} swap_control_v5;
-- end of code --

-- sample swapctl dump --
powerplant:/proc/sys/vm# cat swapctl
20 3 1 3 10 2 2 4 32 4
8192 8192 -200 1 1 0
-- end of dump --

The file conforms to the following structure:
----
Maximum Memory Page Age: 20 |
Memory Page Advance: 3 |_______ Page Aging
Memory Page Decline: 1 |
Initial Age Of Swap Page: 3 |
----
----
Maximum Buffer Age: 10 |
Buffer Advance: 2 |_______ Buffer Aging
Buffer Decline: 2 |
Initial Age Of Buffer: 4 |
----
----
Fractional Cluster Age: 32 |_______ Aging Cluster
Minimum Cluster Age: 4 |
----

----
Pageout Weight: 8192|_______ Pageout/Bufferout Weights
Bufferout Weight: 8192|
----

----
Buffer's Grace: -200|_______ Self-Explanatory
----

----
Buffers To Free: 1 |_______ Buffers/Pages To Free
Pages To Free: 1 |
----

----
Reclaim/Balancing Policy: 0* |_______ See Below
----

*Policies are as follows:
RCL_ROUND_ROBIN
RCL_BUFF_FIRST
RCL_PERSIST

I haven't a clue what these policies definitions are, but I'm
working on finding them.

'Maximum Swap Page Age' is maximum age the kernel's aging
mechanisms wait before handling an old swapped out page. 'Memory
Page Advance' is the quantity of how many new swap pages will be created
when the kernel is needed to swap (i.e., freemem < min_free_pages).
'Memory Page Decline' is the quantity of which 'old' pages will be booted
when the have exceeded the 'Maximum Swap Page Age'. 'Inital Age Of Swap
Page' is the default age given to a newborn swap page.

'Maximum Buffer Age' is maximum age allowed for a buffer. 'Buffer
Page Advance' is the quantity of how many new buffers will be created
when the kernel needs more/swapped out some. 'Buffer Page Decline' is the
quantity of which 'old' pages will be booted when the have exceeded the
'Maximum Buffer Age'. 'Inital Age Of Buffer' is the default age given to
a newborn swap page.

'Aging Cluster Fraction' multiplied by 1024 is the limit of
resources the kernel reclaims when scanning the resource list. 'Minimum
Aging Cluster' is the minimum number of resources used when scanning the
resource list.

'Pageout Weight' is basically the weight of the page the kernel is
swapping out. 'Bufferout Weight' is the same thing but, it applies to
buffers when they are requested to be swapped out.

'Buffer's Grace' is the time that the buffer is given to eradicate
its space after a request to be swapped.

'Buffers To Free' is the amount of buffers to free/swap out at a
time. The same applies to 'Pages To Free'.

I suggest not tweaking parameters here until you understand what
they do and also what you are doing, therefore, I will not include an
example.

Omachonu Ogali
--------------
omachonu.ogali@softhome.net

"There is almost nothing a
fifteen year old kernel
hacker can't fix/tweak/(insert
any other handy-dandy term here)/
understand/compile."
begin:vcard
n:Ogali;Omachonu
x-mozilla-html:FALSE
org:Intranova Networking Group;Internet Services Division
adr:;;;;;;
version:2.1
email;internet:omachonu.ogali@softhome.net
title:Network Administrator
x-mozilla-cpt:;0
fn:Omachonu Ogali
end:vcard
\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.038 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site