[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201111222133.13667.rjw@sisk.pl>
Date: Tue, 22 Nov 2011 21:33:13 +0100
From: "Rafael J. Wysocki" <rjw@...k.pl>
To: Pavel Machek <pavel@....cz>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>,
len.brown@...el.com, tj@...nel.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org
Subject: Re: [PATCH] PM / Hibernation: Fix *massive* memory leak at early exits in hibernation
On Tuesday, November 22, 2011, Pavel Machek wrote:
> On Mon 2011-11-21 23:25:39, Rafael J. Wysocki wrote:
> > On Monday, November 21, 2011, Srivatsa S. Bhat wrote:
> > > At some of the early exit points during hibernation (exiting either due
> > > to failure or after a successful hibernation test, the memory pre-allocated
> > > for hibernation is not freed up. And this is *very* serious, because, during
> > > pre-allocation, it could have allocated upto a few *gigabytes* of memory!
> > > And hence, if a hibernation fails or even if we run some hibernation tests
> > > using the 'pm_test' framework, the system is rendered unstable due to memory
> > > becoming signifantly lower. Fix this bug.
> >
> > While the observation is valid, I'd prefer to do something like the patch
> > below.
>
> The code slowly becomes goto maze :-(.
>
> > @@ -357,12 +357,14 @@ int hibernation_snapshot(int platform_mo
> > * successful freezer test.
> > */
> > freezer_test_done = true;
> > - goto Close;
> > + goto Cleanup;
> > }
> >
> > error = dpm_prepare(PMSG_FREEZE);
> > - if (error)
> > - goto Complete_devices;
> > + if (error) {
> > + dpm_complete(msg);
> > + goto Cleanup;
> > + }
>
> Perhaps dpm_prepare should be changed to clean after itself in the
> error case? That is the normal convention AFAICT....
Yes, in a future patch.
Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists