* Tweaking swap algorithm under constrained memory usage
@ 2010-10-27 18:41 Pawan Singh
2010-10-28 0:52 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 4+ messages in thread
From: Pawan Singh @ 2010-10-27 18:41 UTC (permalink / raw)
To: linux-kernel
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.
-Pawan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Tweaking swap algorithm under constrained memory usage
2010-10-27 18:41 Tweaking swap algorithm under constrained memory usage Pawan Singh
@ 2010-10-28 0:52 ` KAMEZAWA Hiroyuki
2010-10-28 2:58 ` Pawan Singh
0 siblings, 1 reply; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-10-28 0:52 UTC (permalink / raw)
To: Pawan Singh; +Cc: linux-kernel
On Wed, 27 Oct 2010 11:41:18 -0700
Pawan Singh <pawan@pinger.org> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Tweaking swap algorithm under constrained memory usage
2010-10-28 0:52 ` KAMEZAWA Hiroyuki
@ 2010-10-28 2:58 ` Pawan Singh
2010-10-28 3:05 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 4+ messages in thread
From: Pawan Singh @ 2010-10-28 2:58 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki; +Cc: linux-kernel
>
> Recent kernel (2.6.28-) has splited LRUs as
> - active/inactive ANON
> - active/inactive FILE
> - LOCKED (UNEVICTABLE) ---(new)
Thanks for the reply. Does that mean that in 2.6.28 kernel, kswapd
will modify its thresholds so that it only looks at active/inactive
ANON?
Thanks
Pawan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Tweaking swap algorithm under constrained memory usage
2010-10-28 2:58 ` Pawan Singh
@ 2010-10-28 3:05 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-10-28 3:05 UTC (permalink / raw)
To: Pawan Singh; +Cc: linux-kernel
On Wed, 27 Oct 2010 19:58:00 -0700
Pawan Singh <pawan@pinger.org> wrote:
> >
> > Recent kernel (2.6.28-) has splited LRUs as
> > - active/inactive ANON
> > - active/inactive FILE
> > - LOCKED (UNEVICTABLE) ---(new)
>
> Thanks for the reply. Does that mean that in 2.6.28 kernel, kswapd
> will modify its thresholds so that it only looks at active/inactive
> ANON?
>
kswapd's threshold is not modifled. But because UNEVICTABLE LRU is not
scanned by kswapd, time consumption of kswapd is dramatically reduced.
About kswapd trigger, IIUC, /proc/sys/vm/min_free_kbytes is one.
Thanks,
-Kame
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-28 3:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-27 18:41 Tweaking swap algorithm under constrained memory usage Pawan Singh
2010-10-28 0:52 ` KAMEZAWA Hiroyuki
2010-10-28 2:58 ` Pawan Singh
2010-10-28 3:05 ` KAMEZAWA Hiroyuki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.