lkml.org 
[lkml]   [2007]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/8] Make process freezer reentrant
On Thu, Apr 05, 2007 at 01:53:01PM +0400, Oleg Nesterov wrote:
> On 04/02, Gautham R Shenoy wrote:
> >
> > int freeze_processes(unsigned long freeze_event)
> > {
> > unsigned int nr_unfrozen;
> > -
> > + int ret = 0;
> > + mutex_lock(&freezer_mutex);
> > + if (system_freeze_event_mask & freeze_event)
> > + goto done;
>
> I am not sure this is correct. Suppose that system_freeze_event_mask == FE_SUSPEND,
> now freeze_processes(FE_ALL) returns success. Shouldn't we return an error?

Hmm, may be we are getting confused with the word 'reentrant' here.
The idea behind this API was to freeze the system for one event
only at any given time.

However, we can have nested freeze_processes() call for different events.

Something like
freeze_processes(FE_SUSPEND);

/* Do something */

freeze_processes(FE_HOTPLUG_CPU);

/* hotplug cpus */

thaw_processes(FE_HOTPLUG_CPU);

/* Do something more */

thaw_processes(FE_SUSPEND);

So ideally no one is supposed to make a call like
freeze_processes(FE_SUSPEND | FE_HOTPLUG_CPU);
OR
freeze_processes(FE_ALL);

I guess I should also put a check for a valid freeze event.

>
> Oleg.
>

Thanks
gautham.
--
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-05 12:23    [W:0.276 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site