[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070423141908.GA6842@in.ibm.com>
Date: Mon, 23 Apr 2007 19:49:08 +0530
From: Gautham R Shenoy <ego@...ibm.com>
To: Satyam Sharma <satyam.sharma@...il.com>
Cc: "Rafael J. Wysocki" <rjw@...k.pl>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>, Oleg Nesterov <oleg@...sign.ru>,
linux-kernel@...r.kernel.org, vatsa@...ibm.com, paulmck@...ibm.com,
pavel@....cz
Subject: Re: [RFC][PATCH -mm 2/3] freezer: Introduce freezer_flags
Hi Satyam,
On Mon, Apr 23, 2007 at 09:39:30AM +0530, Satyam Sharma wrote:
> Hi Rafael,
>
> >+/*
> >+ * Per task flags used by the freezer
> >+ *
> >+ * They should not be referred to directly outside of this file.
> >+ */
> >+#define TFF_NOFREEZE 0 /* task should not be frozen */
> >+#define TFF_FREEZE 8 /* task should go to the refrigerator ASAP
> >*/
> >+#define TFF_SKIP 9 /* do not count this task as freezable */
> >+#define TFF_FROZEN 10 /* task is frozen */
>
> Aren't NOFREEZE and SKIP doing the same thing? One of them appears
> superfluous. I'm looking at 21-rc6-mm1 and vfork(2) seems to be its
> only user. Seeing how vfork(2) used it, can't the call to
> freezer_do_not_count() be replaced with a call to freezer_exempt()?
> Similarly, the freezer_count() after the wait_for_completion might
> just as well be a clear of the NOFREEZE bit followed by a
> try_to_freeze(). Could you please explain the rationale behind the
> SKIP flag?
The difference between the NOFREEZE and the SKIP flag is a subtle one.
When a task (say p) sets it's NOFREEZE flag, it tells the freezer not to
consider it for freezing. Which means freezeable(p) will return 0.
So the freezer will not even mark it for freezing.
However, when a task sets it SKIP flag, it tells the freezer - "I might
block at a safe place. So when you are counting the processes which
have been marked as freezeable, but have not frozen yet, please don't
count me in. IOW, please skip me."
Thus such a task can still be marked for freezing.
The typical usage is
freezer_do_not_count(current);
/* currents goes to an uninterruptible sleep, like wait_for_completion. */
freezer_count(current);
Once the task wakes up from it's uninterruptible sleep, it will
call freezer_count which in turn calls try_to_freeze.
If the task was marked for freezing, it will be frozen now.
You may want to check the thread http://lkml.org/lkml/2007/2/18/47
on how it came into existance.
>
> Cheers,
> Satyam
Regards
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