Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-02-04 Thread Minchan Kim
On Tue, Jan 22, 2013 at 09:09:54AM +0900, Minchan Kim wrote: > On Mon, Jan 21, 2013 at 09:39:06AM -0500, Rik van Riel wrote: > > On 01/20/2013 08:52 PM, Minchan Kim wrote: > > > > > From 94086dc7152359d052802c55c82ef19509fe8cce Mon Sep 17 00:00:00 2001 > > >From: Minchan Kim > > >Date: Mon, 21

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-02-04 Thread Minchan Kim
On Tue, Jan 22, 2013 at 09:09:54AM +0900, Minchan Kim wrote: On Mon, Jan 21, 2013 at 09:39:06AM -0500, Rik van Riel wrote: On 01/20/2013 08:52 PM, Minchan Kim wrote: From 94086dc7152359d052802c55c82ef19509fe8cce Mon Sep 17 00:00:00 2001 From: Minchan Kim minc...@kernel.org Date: Mon,

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-21 Thread Minchan Kim
On Mon, Jan 21, 2013 at 09:39:06AM -0500, Rik van Riel wrote: > On 01/20/2013 08:52 PM, Minchan Kim wrote: > > > From 94086dc7152359d052802c55c82ef19509fe8cce Mon Sep 17 00:00:00 2001 > >From: Minchan Kim > >Date: Mon, 21 Jan 2013 10:43:43 +0900 > >Subject: [PATCH] mm: Use up free swap space

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-21 Thread Rik van Riel
On 01/20/2013 08:52 PM, Minchan Kim wrote: From 94086dc7152359d052802c55c82ef19509fe8cce Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Mon, 21 Jan 2013 10:43:43 +0900 Subject: [PATCH] mm: Use up free swap space before reaching OOM kill Recently, Luigi reported there are lots of free swap

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-21 Thread Rik van Riel
On 01/20/2013 08:52 PM, Minchan Kim wrote: From 94086dc7152359d052802c55c82ef19509fe8cce Mon Sep 17 00:00:00 2001 From: Minchan Kim minc...@kernel.org Date: Mon, 21 Jan 2013 10:43:43 +0900 Subject: [PATCH] mm: Use up free swap space before reaching OOM kill Recently, Luigi reported there are

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-21 Thread Minchan Kim
On Mon, Jan 21, 2013 at 09:39:06AM -0500, Rik van Riel wrote: On 01/20/2013 08:52 PM, Minchan Kim wrote: From 94086dc7152359d052802c55c82ef19509fe8cce Mon Sep 17 00:00:00 2001 From: Minchan Kim minc...@kernel.org Date: Mon, 21 Jan 2013 10:43:43 +0900 Subject: [PATCH] mm: Use up free swap

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-20 Thread Minchan Kim
Hi, On Fri, Jan 18, 2013 at 08:36:42AM +0900, Minchan Kim wrote: > On Thu, Jan 17, 2013 at 02:22:38PM -0800, Andrew Morton wrote: > > On Thu, 17 Jan 2013 09:53:14 +0900 > > Minchan Kim wrote: > > > > > Recently, Luigi reported there are lots of free swap space when > > > OOM happens. It's

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-20 Thread Minchan Kim
Hi, On Fri, Jan 18, 2013 at 08:36:42AM +0900, Minchan Kim wrote: On Thu, Jan 17, 2013 at 02:22:38PM -0800, Andrew Morton wrote: On Thu, 17 Jan 2013 09:53:14 +0900 Minchan Kim minc...@kernel.org wrote: Recently, Luigi reported there are lots of free swap space when OOM happens. It's

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-17 Thread Minchan Kim
On Thu, Jan 17, 2013 at 02:22:38PM -0800, Andrew Morton wrote: > On Thu, 17 Jan 2013 09:53:14 +0900 > Minchan Kim wrote: > > > Recently, Luigi reported there are lots of free swap space when > > OOM happens. It's easily reproduced on zram-over-swap, where > > many instance of memory hogs are

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-17 Thread Andrew Morton
On Thu, 17 Jan 2013 09:53:14 +0900 Minchan Kim wrote: > Recently, Luigi reported there are lots of free swap space when > OOM happens. It's easily reproduced on zram-over-swap, where > many instance of memory hogs are running and laptop_mode is enabled. > He said there was no problem when he

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-17 Thread Andrew Morton
On Thu, 17 Jan 2013 09:53:14 +0900 Minchan Kim minc...@kernel.org wrote: Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on zram-over-swap, where many instance of memory hogs are running and laptop_mode is enabled. He said there was no

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-17 Thread Minchan Kim
On Thu, Jan 17, 2013 at 02:22:38PM -0800, Andrew Morton wrote: On Thu, 17 Jan 2013 09:53:14 +0900 Minchan Kim minc...@kernel.org wrote: Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on zram-over-swap, where many instance of memory

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-16 Thread Minchan Kim
On Wed, Jan 16, 2013 at 01:41:55PM -0800, Andrew Morton wrote: > On Wed, 9 Jan 2013 15:21:13 +0900 > Minchan Kim wrote: > > > > This changelog is quite hard to understand :( > > > Recently, Luigi reported there are lots of free swap space when > > OOM happens. It's easily reproduced on

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-16 Thread Andrew Morton
On Wed, 9 Jan 2013 15:21:13 +0900 Minchan Kim wrote: > This changelog is quite hard to understand :( > Recently, Luigi reported there are lots of free swap space when > OOM happens. It's easily reproduced on zram-over-swap, where > many instance of memory hogs are running and laptop_mode is

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-16 Thread Andrew Morton
On Wed, 9 Jan 2013 15:21:13 +0900 Minchan Kim minc...@kernel.org wrote: This changelog is quite hard to understand :( Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on zram-over-swap, where many instance of memory hogs are running and

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-16 Thread Minchan Kim
On Wed, Jan 16, 2013 at 01:41:55PM -0800, Andrew Morton wrote: On Wed, 9 Jan 2013 15:21:13 +0900 Minchan Kim minc...@kernel.org wrote: This changelog is quite hard to understand :( Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-10 Thread Minchan Kim
Hi Luigi, On Thu, Jan 10, 2013 at 03:24:21PM -0800, Luigi Semenzato wrote: > For what it's worth, I tested this patch on my 3.4 kernel, and it works as > advertised. Here's my setup. > > - 2 GB RAM > - a 3 GB zram disk for swapping > - start one "hog" process per second (each hog process

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-10 Thread Luigi Semenzato
[I may have screwed up my previous message, sorry if this is a duplicate. (Content-Policy reject msg: The message contains HTML subpart, therefore we consider it SPAM or Outlook Virus.)] -- For what it's worth, I tested this patch on my 3.4 kernel, and it

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-10 Thread Luigi Semenzato
[I may have screwed up my previous message, sorry if this is a duplicate. (Content-Policy reject msg: The message contains HTML subpart, therefore we consider it SPAM or Outlook Virus.)] -- For what it's worth, I tested this patch on my 3.4 kernel, and it

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-10 Thread Minchan Kim
Hi Luigi, On Thu, Jan 10, 2013 at 03:24:21PM -0800, Luigi Semenzato wrote: For what it's worth, I tested this patch on my 3.4 kernel, and it works as advertised. Here's my setup. - 2 GB RAM - a 3 GB zram disk for swapping - start one hog process per second (each hog process mallocs and

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-09 Thread Minchan Kim
Hi Andrew, On Wed, Jan 09, 2013 at 04:18:54PM -0800, Andrew Morton wrote: > On Wed, 9 Jan 2013 15:21:13 +0900 > Minchan Kim wrote: > > > Recently, Luigi reported there are lots of free swap space when > > OOM happens. It's easily reproduced on zram-over-swap, where > > many instance of memory

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-09 Thread Andrew Morton
On Wed, 9 Jan 2013 15:21:13 +0900 Minchan Kim wrote: > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -780,6 +780,8 @@ static unsigned long shrink_page_list(struct list_head > *page_list, > if (PageAnon(page) && !PageSwapCache(page)) { > if (!(sc->gfp_mask &

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-09 Thread Andrew Morton
On Wed, 9 Jan 2013 15:21:13 +0900 Minchan Kim wrote: > Recently, Luigi reported there are lots of free swap space when > OOM happens. It's easily reproduced on zram-over-swap, where > many instance of memory hogs are running and laptop_mode is enabled. > > Luigi reported there was no problem

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-09 Thread Andrew Morton
On Wed, 9 Jan 2013 15:21:13 +0900 Minchan Kim minc...@kernel.org wrote: Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on zram-over-swap, where many instance of memory hogs are running and laptop_mode is enabled. Luigi reported there was

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-09 Thread Andrew Morton
On Wed, 9 Jan 2013 15:21:13 +0900 Minchan Kim minc...@kernel.org wrote: --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -780,6 +780,8 @@ static unsigned long shrink_page_list(struct list_head *page_list, if (PageAnon(page) !PageSwapCache(page)) { if

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-09 Thread Minchan Kim
Hi Andrew, On Wed, Jan 09, 2013 at 04:18:54PM -0800, Andrew Morton wrote: On Wed, 9 Jan 2013 15:21:13 +0900 Minchan Kim minc...@kernel.org wrote: Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on zram-over-swap, where many instance

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-08 Thread Minchan Kim
Hi Hannes, On Wed, Jan 09, 2013 at 01:56:12AM -0500, Johannes Weiner wrote: > On Wed, Jan 09, 2013 at 03:21:13PM +0900, Minchan Kim wrote: > > Recently, Luigi reported there are lots of free swap space when > > OOM happens. It's easily reproduced on zram-over-swap, where > > many instance of

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-08 Thread Johannes Weiner
On Wed, Jan 09, 2013 at 03:21:13PM +0900, Minchan Kim wrote: > Recently, Luigi reported there are lots of free swap space when > OOM happens. It's easily reproduced on zram-over-swap, where > many instance of memory hogs are running and laptop_mode is enabled. > > Luigi reported there was no

[PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-08 Thread Minchan Kim
Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on zram-over-swap, where many instance of memory hogs are running and laptop_mode is enabled. Luigi reported there was no problem when he disabled laptop_mode. The problem when I investigate

[PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-08 Thread Minchan Kim
Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on zram-over-swap, where many instance of memory hogs are running and laptop_mode is enabled. Luigi reported there was no problem when he disabled laptop_mode. The problem when I investigate

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-08 Thread Johannes Weiner
On Wed, Jan 09, 2013 at 03:21:13PM +0900, Minchan Kim wrote: Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on zram-over-swap, where many instance of memory hogs are running and laptop_mode is enabled. Luigi reported there was no problem

Re: [PATCH 1/2] mm: prevent to add a page to swap if may_writepage is unset

2013-01-08 Thread Minchan Kim
Hi Hannes, On Wed, Jan 09, 2013 at 01:56:12AM -0500, Johannes Weiner wrote: On Wed, Jan 09, 2013 at 03:21:13PM +0900, Minchan Kim wrote: Recently, Luigi reported there are lots of free swap space when OOM happens. It's easily reproduced on zram-over-swap, where many instance of memory hogs