Re: An attempt to improve the swap tokening:

Coywolf Qi Hunt
2005-05-10T07:52:51Z

On 5/9/05, A.M. Fradley <u2amf@csc.liv.ac.uk> wrote:
> I'd been trying to reduce the amount of page swapping in order to improve the
> kernels behaviour during thrashing as a project for my course. I made this
> after Arjan van de Ven and Rik van Riel suggested I looked into the swap
> tokening mechanism as part of my research. I came up with a function to
> measure the swap rate and then to activate/deactivate the token mechanism
> depending on how much swapping was being done overall. I think the statistics
> I added to the thrash.c file could help it decide how to behave but I'm unsure
> how best to use them to do that.
>
> I've tried testing it a few different ways
> but none of them seem to make any difference. I think this is because of my
> tests though. I made one program that allocates a linked list, until it is
> 128MB long, then once it's done that, it should swap in the oldest page in
> order to free the memory and then swap the newest one back in to edit the
> pointer to the next node then continue for 2 mins. Then to test how much
> progress is made
> during the thrashing, I've been running a simple counter program that stops
> after minute and I've been comparing the max number reached for the different
> attempts I've been making with the kernel. The program for causing thrashing
> at least makes it swap pages because I can watch the memory and swap fill up in
> system monitor. Running the program to cause thrashing seems to work because
> the kernel begins reporting high swap rates when the list reaches the target
> length.
>
> Does anyone know any programs that are designed to test this type of
> thing or any comments on the code that I wrote? I'm still new at this, so I've
> probably misunderstood/left out some things. The updateSwapRate() fuction is
> called at the end of scheduler_tick(). That could probably go somewhere
> better. Also, I wasn't sure if changing the value of
> swap_token_default_timeout was all I needed to do to reactivate the tokening as
> it was disabled in 2.6.11 that I'm working with.
>

Wouldn't it be better shown in patch form?

--
Coywolf Qi Hunt