public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* swapping in 2.6.24-rc5-git3
@ 2007-12-17 13:17 Lukas Hejtmanek
  2007-12-17 17:15 ` Jan Kara
  2007-12-18  1:38 ` KAMEZAWA Hiroyuki
  0 siblings, 2 replies; 6+ messages in thread
From: Lukas Hejtmanek @ 2007-12-17 13:17 UTC (permalink / raw)
  To: linux-kernel

Hello,

does /proc/sys/vm/swappiness still work as expected? 
# /proc/sys/vm# cat swappiness 
0

but scp-ing 2GB file causes many processes are swapped out due to increase of
the file cache size. Why? This is totally catastrophic behaviour on the desktop.

Is there a way to avoid it except turning off the swap?

-- 
Lukáš Hejtmánek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: swapping in 2.6.24-rc5-git3
  2007-12-17 13:17 swapping in 2.6.24-rc5-git3 Lukas Hejtmanek
@ 2007-12-17 17:15 ` Jan Kara
  2007-12-17 20:43   ` Lukas Hejtmanek
  2007-12-18 10:58   ` Lukas Hejtmanek
  2007-12-18  1:38 ` KAMEZAWA Hiroyuki
  1 sibling, 2 replies; 6+ messages in thread
From: Jan Kara @ 2007-12-17 17:15 UTC (permalink / raw)
  To: Lukas Hejtmanek; +Cc: linux-kernel

  Hello,

> does /proc/sys/vm/swappiness still work as expected? 
> # /proc/sys/vm# cat swappiness 
> 0
  I think yes. 0 swappiness doesn't mean "no swapping at all". From the
code in shrink_active_list() it seems that it just decreases likeliness
of removing pages of mmaped files (i.e., also executables loaded in memory).

> but scp-ing 2GB file causes many processes are swapped out due to increase of
> the file cache size. Why? This is totally catastrophic behaviour on the desktop.
  Yes, that's quite unpleasant. How much memory do you have? If you have
some time, you can try playing with the code in mm/vmscan.c to find out
what's happening in your case (putting some debugging output in
shrink_active_list() etc...

> Is there a way to avoid it except turning off the swap?
  Currently, I'm not aware of any way...

										Honza
-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: swapping in 2.6.24-rc5-git3
  2007-12-17 17:15 ` Jan Kara
@ 2007-12-17 20:43   ` Lukas Hejtmanek
  2007-12-18 10:58   ` Lukas Hejtmanek
  1 sibling, 0 replies; 6+ messages in thread
From: Lukas Hejtmanek @ 2007-12-17 20:43 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-kernel

On Mon, Dec 17, 2007 at 06:15:32PM +0100, Jan Kara wrote:
>   Yes, that's quite unpleasant. How much memory do you have? If you have
> some time, you can try playing with the code in mm/vmscan.c to find out
> what's happening in your case (putting some debugging output in
> shrink_active_list() etc...

I think it is a regression in recent rc versions as I use 2.6.24-xx kernels on
my new laptop from the very beginnig I have the laptopt and I did not notice
such behaviour before.

I have 1 GB RAM and I was coping a 2GB file from the network to the laptop.
After the operation, 600MB of the swap area has been consumed. At the
beginning of the copy, the swap area was empty.

-- 
Lukáš Hejtmánek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: swapping in 2.6.24-rc5-git3
  2007-12-17 13:17 swapping in 2.6.24-rc5-git3 Lukas Hejtmanek
  2007-12-17 17:15 ` Jan Kara
@ 2007-12-18  1:38 ` KAMEZAWA Hiroyuki
  2007-12-18  1:44   ` KAMEZAWA Hiroyuki
  1 sibling, 1 reply; 6+ messages in thread
From: KAMEZAWA Hiroyuki @ 2007-12-18  1:38 UTC (permalink / raw)
  To: Lukas Hejtmanek; +Cc: linux-kernel

On Mon, 17 Dec 2007 14:17:26 +0100
Lukas Hejtmanek <xhejtman@ics.muni.cz> wrote:

> Hello,
> 
> does /proc/sys/vm/swappiness still work as expected? 
> # /proc/sys/vm# cat swappiness 
> 0
> 
> but scp-ing 2GB file causes many processes are swapped out due to increase of
> the file cache size. Why? This is totally catastrophic behaviour on the desktop.
> 

Hmm, which version of the kernel do you compare with ?

Seems following patch is the newest one, which changes meaning of swappiness.
Now the swap happens even if swappiness=0, when the system memory usage is highly
unbalanced or when memory reclaim doesn't make progress.
=
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=4106f83a9f86afc423557d0d92ebf4b3f36728c1
=

> Is there a way to avoid it except turning off the swap?
> 
Maybe...no.

(*) I'm now working on memory resource controller in -mm kernel. please see/try
    and comments if interested.


Thanks,
-Kame


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: swapping in 2.6.24-rc5-git3
  2007-12-18  1:38 ` KAMEZAWA Hiroyuki
@ 2007-12-18  1:44   ` KAMEZAWA Hiroyuki
  0 siblings, 0 replies; 6+ messages in thread
From: KAMEZAWA Hiroyuki @ 2007-12-18  1:44 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki; +Cc: Lukas Hejtmanek, linux-kernel

On Tue, 18 Dec 2007 10:38:13 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > Is there a way to avoid it except turning off the swap?
> > 
> Maybe...no.
> 
Ah, sorry. If too much dirty page by ftp is trouble, tuning 
/proc/sys/vm/dirty_ratio
/proc/sys/vm/dirty_writeback/centisecs
etc..

may work for you.

Thanks,
-Kame


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: swapping in 2.6.24-rc5-git3
  2007-12-17 17:15 ` Jan Kara
  2007-12-17 20:43   ` Lukas Hejtmanek
@ 2007-12-18 10:58   ` Lukas Hejtmanek
  1 sibling, 0 replies; 6+ messages in thread
From: Lukas Hejtmanek @ 2007-12-18 10:58 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-kernel, kamezawa.hiroyu

On Mon, Dec 17, 2007 at 06:15:32PM +0100, Jan Kara wrote:
>   I think yes. 0 swappiness doesn't mean "no swapping at all". From the
> code in shrink_active_list() it seems that it just decreases likeliness
> of removing pages of mmaped files (i.e., also executables loaded in memory).

So, I tried to add some prints. 

I have mapped ratio about 78 while scp-ing the file. Distress suddenly raises
from 0 to 100. At this poing, all the processes are swapped out.

I guess it happens if scp is faster than the local disk which happens if
I scp-ing over GE from desktop (with fast disk - and reading) to laptop (slow
disk - and writing).

This is my settings.
/proc/sys/vm/*
block_dump:0
dirty_background_ratio:10
dirty_expire_centisecs:2999
dirty_ratio:40
dirty_writeback_centisecs:499
drop_caches:0
laptop_mode:0
legacy_va_layout:0
lowmem_reserve_ratio:256	256	32
max_map_count:65536
min_free_kbytes:4006
nr_pdflush_threads:2
oom_kill_allocating_task:0
overcommit_memory:0
overcommit_ratio:50
page-cluster:3
panic_on_oom:0
percpu_pagelist_fraction:0
stat_interval:1
swappiness:0
vfs_cache_pressure:100

-- 
Lukáš Hejtmánek

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-18 10:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-17 13:17 swapping in 2.6.24-rc5-git3 Lukas Hejtmanek
2007-12-17 17:15 ` Jan Kara
2007-12-17 20:43   ` Lukas Hejtmanek
2007-12-18 10:58   ` Lukas Hejtmanek
2007-12-18  1:38 ` KAMEZAWA Hiroyuki
2007-12-18  1:44   ` KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox