Re: [PATCH -v2] mm: frontswap: fix a wrong if condition in frontswap_shrink

2012-09-29 Thread Paul Bolle
On Sat, 2012-09-29 at 10:54 +0800, Zhenzhong Duan wrote: > On 2012-09-28 22:54, Paul Bolle wrote: > > Not even before applying your patch? Anyhow, after applying your patch > > the warnings gone here too. > I tested both cases, no warning, also didn't see -Wmaybe-uninitialized > when make. > My en

Re: [PATCH -v2] mm: frontswap: fix a wrong if condition in frontswap_shrink

2012-09-28 Thread Zhenzhong Duan
On 2012-09-28 22:54, Paul Bolle wrote: On Fri, 2012-09-28 at 11:43 +0800, Zhenzhong Duan wrote: On 2012-09-27 19:35, Paul Bolle wrote: I think setting pages_to_unuse to zero here is not needed. It is initiated to zero in frontswap_shrink() and hasn't been touched since. See my patch at https:

Re: [PATCH -v2] mm: frontswap: fix a wrong if condition in frontswap_shrink

2012-09-28 Thread Paul Bolle
On Fri, 2012-09-28 at 11:43 +0800, Zhenzhong Duan wrote: > On 2012-09-27 19:35, Paul Bolle wrote: > > I think setting pages_to_unuse to zero here is not needed. It is > > initiated to zero in frontswap_shrink() and hasn't been touched since. > > See my patch at https://lkml.org/lkml/2012/9/27/250.

Re: [PATCH -v2] mm: frontswap: fix a wrong if condition in frontswap_shrink

2012-09-27 Thread Zhenzhong Duan
On 2012-09-27 19:35, Paul Bolle wrote: On Fri, 2012-09-21 at 16:40 +0800, Zhenzhong Duan wrote: @@ -275,7 +280,7 @@ static int __frontswap_shrink(unsigned long target_pages, if (total_pages<= target_pages) { /* Nothing to do */ *pages_to_unuse = 0; I

Re: [PATCH -v2] mm: frontswap: fix a wrong if condition in frontswap_shrink

2012-09-27 Thread Paul Bolle
On Fri, 2012-09-21 at 16:40 +0800, Zhenzhong Duan wrote: > pages_to_unuse is set to 0 to unuse all frontswap pages > But that doesn't happen since a wrong condition in frontswap_shrink > cancel it. > > -v2: Add comment to explain return value of __frontswap_shrink, > as suggested by Dan Carpenter,

[PATCH -v2] mm: frontswap: fix a wrong if condition in frontswap_shrink

2012-09-21 Thread Zhenzhong Duan
pages_to_unuse is set to 0 to unuse all frontswap pages But that doesn't happen since a wrong condition in frontswap_shrink cancel it. -v2: Add comment to explain return value of __frontswap_shrink, as suggested by Dan Carpenter, thanks Signed-off-by: Zhenzhong Duan diff --git a/mm/frontswap.c

Re: mm: frontswap: fix a wrong if condition in frontswap_shrink

2012-09-21 Thread Dan Carpenter
On Fri, Sep 21, 2012 at 11:29:56AM +0800, Zhenzhong Duan wrote: > pages_to_unuse is set to 0 to unuse all frontswap pages > But that doesn't happen since a wrong condition in frontswap_shrink > cancels it. > > Signed-off-by: Zhenzhong Duan > --- > mm/frontswap.c |4 ++-- > 1 files changed, 2

mm: frontswap: fix a wrong if condition in frontswap_shrink

2012-09-20 Thread Zhenzhong Duan
pages_to_unuse is set to 0 to unuse all frontswap pages But that doesn't happen since a wrong condition in frontswap_shrink cancels it. Signed-off-by: Zhenzhong Duan --- mm/frontswap.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/frontswap.c b/mm/frontswap.c ind