[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070405101900.GA16173@in.ibm.com>
Date: Thu, 5 Apr 2007 15:49:00 +0530
From: Gautham R Shenoy <ego@...ibm.com>
To: Oleg Nesterov <oleg@...sign.ru>
Cc: akpm@...ux-foundation.org, paulmck@...ibm.com,
torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
vatsa@...ibm.com, "Rafael J. Wysocki" <rjw@...k.pl>, mingo@...e.hu,
dipankar@...ibm.com, dino@...ibm.com,
masami.hiramatsu.pt@...achi.com
Subject: Re: [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@...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