From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [RFC][PATCH 2/3] swsusp: Do not use page flags Date: Tue, 13 Mar 2007 15:47:14 +1100 Message-ID: <45F62CD2.5030103@yahoo.com.au> References: <200703011633.54625.rjw@sisk.pl> <200703041450.02178.rjw@sisk.pl> <200703041507.57122.rjw@sisk.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <200703041507.57122.rjw@sisk.pl> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.osdl.org Errors-To: linux-pm-bounces@lists.osdl.org To: "Rafael J. Wysocki" Cc: linux-mm@kvack.org, Peter Zijlstra , Pavel Machek , pm list , Johannes Berg , Christoph Lameter List-Id: linux-pm@vger.kernel.org Rafael J. Wysocki wrote: > } > = > /** > + * This structure represents a range of page frames the contents of which > + * should not be saved during the suspend. > + */ > + > +struct nosave_region { > + struct list_head list; > + unsigned long start_pfn; > + unsigned long end_pfn; > +}; > + > +static LIST_HEAD(nosave_regions); > + > +/** > + * register_nosave_region - register a range of page frames the contents > + * of which should not be saved during the suspend (to be used in the ea= rly > + * initializatoion code) > + */ > + > +void __init > +register_nosave_region(unsigned long start_pfn, unsigned long end_pfn) > +{ > + struct nosave_region *region; > + > + if (start_pfn >=3D end_pfn) > + return; > + > + if (!list_empty(&nosave_regions)) { > + /* Try to extend the previous region (they should be sorted) */ > + region =3D list_entry(nosave_regions.prev, > + struct nosave_region, list); > + if (region->end_pfn =3D=3D start_pfn) { > + region->end_pfn =3D end_pfn; > + goto Report; > + } > + } > + /* This allocation cannot fail */ > + region =3D alloc_bootmem_low(sizeof(struct nosave_region)); > + region->start_pfn =3D start_pfn; > + region->end_pfn =3D end_pfn; > + list_add_tail(®ion->list, &nosave_regions); > + Report: > + printk("swsusp: Registered nosave memory region: %016lx - %016lx\n", > + start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT); > +} I wonder why you reimplemented this and put it in snapshot.c, rather than use my version which was nicely in its own file, had appropriate locking, etc.? -- = SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com = From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <45F62CD2.5030103@yahoo.com.au> Date: Tue, 13 Mar 2007 15:47:14 +1100 From: Nick Piggin MIME-Version: 1.0 Subject: Re: [RFC][PATCH 2/3] swsusp: Do not use page flags References: <200703011633.54625.rjw@sisk.pl> <200703041450.02178.rjw@sisk.pl> <200703041507.57122.rjw@sisk.pl> In-Reply-To: <200703041507.57122.rjw@sisk.pl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: "Rafael J. Wysocki" Cc: Pavel Machek , Christoph Lameter , linux-mm@kvack.org, pm list , Johannes Berg , Peter Zijlstra List-ID: Rafael J. Wysocki wrote: > } > > /** > + * This structure represents a range of page frames the contents of which > + * should not be saved during the suspend. > + */ > + > +struct nosave_region { > + struct list_head list; > + unsigned long start_pfn; > + unsigned long end_pfn; > +}; > + > +static LIST_HEAD(nosave_regions); > + > +/** > + * register_nosave_region - register a range of page frames the contents > + * of which should not be saved during the suspend (to be used in the early > + * initializatoion code) > + */ > + > +void __init > +register_nosave_region(unsigned long start_pfn, unsigned long end_pfn) > +{ > + struct nosave_region *region; > + > + if (start_pfn >= end_pfn) > + return; > + > + if (!list_empty(&nosave_regions)) { > + /* Try to extend the previous region (they should be sorted) */ > + region = list_entry(nosave_regions.prev, > + struct nosave_region, list); > + if (region->end_pfn == start_pfn) { > + region->end_pfn = end_pfn; > + goto Report; > + } > + } > + /* This allocation cannot fail */ > + region = alloc_bootmem_low(sizeof(struct nosave_region)); > + region->start_pfn = start_pfn; > + region->end_pfn = end_pfn; > + list_add_tail(®ion->list, &nosave_regions); > + Report: > + printk("swsusp: Registered nosave memory region: %016lx - %016lx\n", > + start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT); > +} I wonder why you reimplemented this and put it in snapshot.c, rather than use my version which was nicely in its own file, had appropriate locking, etc.? -- SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org