From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752809AbZECDLr (ORCPT ); Sat, 2 May 2009 23:11:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751038AbZECDLj (ORCPT ); Sat, 2 May 2009 23:11:39 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:47866 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750730AbZECDLi (ORCPT ); Sat, 2 May 2009 23:11:38 -0400 Date: Sat, 2 May 2009 20:06:51 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: "Rafael J. Wysocki" cc: Andrew Morton , pavel@ucw.cz, jens.axboe@oracle.com, alan-jenkins@tuffmail.co.uk, linux-kernel@vger.kernel.org, kernel-testers@vger.kernel.org, linux-pm@lists.linux-foundation.org Subject: Re: [PATCH 3/4] PM/Hibernate: Use memory allocations to free memory (rev. 2) In-Reply-To: <200905030224.21471.rjw@sisk.pl> Message-ID: References: <20090502104947.2720f173.akpm@linux-foundation.org> <200905030220.57933.rjw@sisk.pl> <200905030224.21471.rjw@sisk.pl> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 3 May 2009, Rafael J. Wysocki wrote: > > Remove the shrinking of memory from the suspend-to-RAM code, where it is > not really necessary. Hmm. Shouldn't we do this _regardless_? IOW, shouldn't this be a totally separate patch? It seems to be left-over from when we shared the same code-paths, and before the split of the STR and hibernate code? IOW, shouldn't the very _first_ patch just be this part? That code doesn't make any sense anyway (that FREE_PAGE_NUMBER really _is_ totally arbitrary). This part seems to be totally independent of all the other parts in your patch-series. No? Linus --- kernel/power/main.c | 19 +------------------ 1 files changed, 1 insertions(+), 18 deletions(-) diff --git a/kernel/power/main.c b/kernel/power/main.c index f99ed6a..e3197e9 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -188,9 +188,6 @@ static void suspend_test_finish(const char *label) #endif -/* This is just an arbitrary number */ -#define FREE_PAGE_NUMBER (100) - static struct platform_suspend_ops *suspend_ops; /** @@ -241,24 +238,10 @@ static int suspend_prepare(void) if (error) goto Finish; - if (suspend_freeze_processes()) { - error = -EAGAIN; - goto Thaw; - } - - free_pages = global_page_state(NR_FREE_PAGES); - if (free_pages < FREE_PAGE_NUMBER) { - pr_debug("PM: free some memory\n"); - shrink_all_memory(FREE_PAGE_NUMBER - free_pages); - if (nr_free_pages() < FREE_PAGE_NUMBER) { - error = -ENOMEM; - printk(KERN_ERR "PM: No enough memory\n"); - } - } + error = suspend_freeze_processes(); if (!error) return 0; - Thaw: suspend_thaw_processes(); usermodehelper_enable(); Finish: From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH 3/4] PM/Hibernate: Use memory allocations to free memory (rev. 2) Date: Sat, 2 May 2009 20:06:51 -0700 (PDT) Message-ID: References: <20090502104947.2720f173.akpm@linux-foundation.org> <200905030220.57933.rjw@sisk.pl> <200905030224.21471.rjw@sisk.pl> Mime-Version: 1.0 Return-path: In-Reply-To: <200905030224.21471.rjw-KKrjLPT3xs0@public.gmane.org> Sender: kernel-testers-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: TEXT/PLAIN; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Rafael J. Wysocki" Cc: Andrew Morton , pavel-+ZI9xUNit7I@public.gmane.org, jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, alan-jenkins-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org On Sun, 3 May 2009, Rafael J. Wysocki wrote: > > Remove the shrinking of memory from the suspend-to-RAM code, where it is > not really necessary. Hmm. Shouldn't we do this _regardless_? IOW, shouldn't this be a totally separate patch? It seems to be left-over from when we shared the same code-paths, and before the split of the STR and hibernate code? IOW, shouldn't the very _first_ patch just be this part? That code doesn't make any sense anyway (that FREE_PAGE_NUMBER really _is_ totally arbitrary). This part seems to be totally independent of all the other parts in your patch-series. No? Linus --- kernel/power/main.c | 19 +------------------ 1 files changed, 1 insertions(+), 18 deletions(-) diff --git a/kernel/power/main.c b/kernel/power/main.c index f99ed6a..e3197e9 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -188,9 +188,6 @@ static void suspend_test_finish(const char *label) #endif -/* This is just an arbitrary number */ -#define FREE_PAGE_NUMBER (100) - static struct platform_suspend_ops *suspend_ops; /** @@ -241,24 +238,10 @@ static int suspend_prepare(void) if (error) goto Finish; - if (suspend_freeze_processes()) { - error = -EAGAIN; - goto Thaw; - } - - free_pages = global_page_state(NR_FREE_PAGES); - if (free_pages < FREE_PAGE_NUMBER) { - pr_debug("PM: free some memory\n"); - shrink_all_memory(FREE_PAGE_NUMBER - free_pages); - if (nr_free_pages() < FREE_PAGE_NUMBER) { - error = -ENOMEM; - printk(KERN_ERR "PM: No enough memory\n"); - } - } + error = suspend_freeze_processes(); if (!error) return 0; - Thaw: suspend_thaw_processes(); usermodehelper_enable(); Finish: