Re: Tweaking swap algorithm under constrained memory usage

From: KAMEZAWA Hiroyuki
Date: Wed Oct 27 2010 - 20:58:34 EST


On Wed, 27 Oct 2010 11:41:18 -0700
Pawan Singh <pawan@xxxxxxxxxx> wrote:

> I have a requirement where a user space process needs to allocate 75%
> of the memory on the machine and keep it locked i.e. not swappable.
> Other processes need to share the rest of the memory. Swap is enabled.
> I was wondering what tweaks would be required so that the swapping
> alogrithms' thresholds are based on 25% of the memory rather than on
> 100% of the memory. If I leave this at default, kswapd may decide to
> swap a lot more pages than really required because 75% of pages are
> locked. I am working on 2.6.22 kernel. I can use "swappiness" factor
> and reduce it - but I wanted to know if I can alter something
> fundamental in the kernel code to make life for rest of the processes
> better.
>
> Thanks for any suggestions.
>

Recent kernel (2.6.28-) has splited LRUs as
- active/inactive ANON
- active/inactive FILE
- LOCKED (UNEVICTABLE) ---(new)

Then, try the new kernel is a choice.

Thanks,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/