public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gautham R Shenoy <ego@in.ibm.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>,
	akpm@linux-foundation.org, paulmck@us.ibm.com,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	vatsa@in.ibm.com, Oleg Nesterov <oleg@tv-sign.ru>,
	mingo@elte.hu, dipankar@in.ibm.com, dino@in.ibm.com,
	masami.hiramatsu.pt@hitachi.com
Subject: Re: [PATCH 1/8] Enhance process freezer interface for usage beyond software suspend
Date: Tue, 3 Apr 2007 13:29:39 +0530	[thread overview]
Message-ID: <20070403075939.GA29308@in.ibm.com> (raw)
In-Reply-To: <200704022248.25948.rjw@sisk.pl>

On Mon, Apr 02, 2007 at 10:48:24PM +0200, Rafael J. Wysocki wrote:
> On Monday, 2 April 2007 15:56, Pavel Machek wrote:
> > Hi!
> > 
> > >  This patch provides an interface to extend the use of the process
> > >  freezer beyond Suspend.
> > > 
> > > The tasks can selectively mark themselves to be exempted from specific
> > > freeze events like SUSPEND /KPROBES/CPU_HOTPLUG.
> > > 
> > > This patch however, *does not* sort non freezable threads into
> > > different categories based on the freeze events. Thus all 
> > > tasks which were previously marked PF_NOFREEZE are now
> > > exempted from freezer using 
> > > 	freezer_exempt(FE_ALL);
> > > which means exempt from all kinds of freezes.
> > > 
> > > Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
> > > Cc: Pavel Machek <pavel@ucw.cz>
> > > Cc: Rafael J. Wysocki <rjw@sisk.pl>
> > > Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> > 
> > Actually no, I was not in cc. 

Oops! Sorry. I knew I had missed something.

> > 
> > > +/* Per process freezer specific flags */
> > > +#define PF_FE_SUSPEND	0x00008000	/* This thread should not be frozen
> > > +					 * for suspend
> > > +					 */
> > > +
> > > +#define PF_FE_KPROBES	0x00000010	/* This thread should not be frozen
> > > +					 * for Kprobes
> > > +					 */
> > 
> > Just put the comment before the define for long comments?
> 
> Agreed.

ok, Will do.

> 
> > > -#ifdef CONFIG_PM
> > > +#if defined(CONFIG_PM) || defined(CONFIG_HOTPLUG_CPU) || \
> > > +					defined(CONFIG_KPROBES)
> > 
> > Should we create CONFIG_FREEZER?
> 
> Why do you think so?  I think the freezer should be compiled automatically
> if any of the above is set, which is what this directive really means.
> 
> > > Index: linux-2.6.21-rc5/kernel/softlockup.c
> > > ===================================================================
> > > --- linux-2.6.21-rc5.orig/kernel/softlockup.c
> > > +++ linux-2.6.21-rc5/kernel/softlockup.c
> > > @@ -96,7 +96,7 @@ static int watchdog(void * __bind_cpu)
> > >  	struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
> > >  
> > >  	sched_setscheduler(current, SCHED_FIFO, &param);
> > > -	current->flags |= PF_NOFREEZE;
> > > +	freezer_exempt(FE_ALL);
> > >  
> > >  	/*
> > >  	 * Run briefly once per second to reset the softlockup timestamp.
> > 
> > Hmmm, I do not really like softlockup watchdog running during suspend.
> > Can we make this freezeable and make watchdog shut itself off while
> > suspending?
> 
> Generally, I agree, but this patch only replaces the existing instances
> of PF_NOFREEZE with the new mechanism.  The changes you're talking about
> require a separate patch series (or at least one separate patch), I think, and
> they need not be so simple to make.

Yes.

> 
> > > Index: linux-2.6.21-rc5/kernel/rcutorture.c
> > > ===================================================================
> > > --- linux-2.6.21-rc5.orig/kernel/rcutorture.c
> > > +++ linux-2.6.21-rc5/kernel/rcutorture.c
> > > @@ -559,7 +559,7 @@ rcu_torture_fakewriter(void *arg)
> > >  
> > >  	VERBOSE_PRINTK_STRING("rcu_torture_fakewriter task started");
> > >  	set_user_nice(current, 19);
> > > -	current->flags |= PF_NOFREEZE;
> > > +	freezer_exempt(FE_ALL);
> > 
> > 
> > Fix rcutorture instead. It has no business running while suspending.
> > 
> > >  
> > >  	do {
> > >  		schedule_timeout_uninterruptible(1 + rcu_random(&rand)%10);
> > > @@ -590,7 +590,7 @@ rcu_torture_reader(void *arg)
> > >  
> > >  	VERBOSE_PRINTK_STRING("rcu_torture_reader task started");
> > >  	set_user_nice(current, 19);
> > > -	current->flags |= PF_NOFREEZE;
> > > +	freezer_exempt(FE_ALL);
> > >  
> > 
> > Same here.
> > 
> > Eventually, we should fix apm, too.
> > 
> > > Index: linux-2.6.21-rc5/init/do_mounts_initrd.c
> > > ===================================================================
> > > --- linux-2.6.21-rc5.orig/init/do_mounts_initrd.c
> > > +++ linux-2.6.21-rc5/init/do_mounts_initrd.c
> > > @@ -55,7 +55,7 @@ static void __init handle_initrd(void)
> > >  	sys_mount(".", "/", NULL, MS_MOVE, NULL);
> > >  	sys_chroot(".");
> > >  
> > > -	current->flags |= PF_NOFREEZE;
> > > +	freezer_exempt(FE_ALL);
> > >  	pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
> > >  	if (pid > 0) {
> > >  		while (pid != sys_wait4(-1, NULL, 0, NULL))
> > 
> > Does this mean we have userland /linuxrc running with PF_NOFREEZE?
> > That would be very bad...
> 
> No, actually it is _required_ for the userland resume to work.  Well, perhaps
> I should place a comment in there so that I don't have to explain this again
> and again. :-)
> 
> > > --- linux-2.6.21-rc5.orig/kernel/kprobes.c
> > > +++ linux-2.6.21-rc5/kernel/kprobes.c
> > > @@ -104,7 +104,7 @@ static int __kprobes check_safety(void)
> > >  {
> > >  	int ret = 0;
> > >  #if defined(CONFIG_PREEMPT) && defined(CONFIG_PM)
> > 
> > Eh? Why does kprobes code depend on config_pm?
> 
> Because it uses the freezer? ;-)

Is that why?! Then I guess we can remove it. Because the freezer is
going to be compiled in if CONFIG_KPROBES is set.

> 
> Greetings,
> Rafael

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!"

  parent reply	other threads:[~2007-04-03  8:00 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-02  5:34 [RFC] Cpu-hotplug: Using the Process Freezer (try2) Gautham R Shenoy
2007-04-02  5:37 ` [PATCH 1/8] Enhance process freezer interface for usage beyond software suspend Gautham R Shenoy
2007-04-02 13:56   ` Pavel Machek
2007-04-02 20:48     ` Rafael J. Wysocki
2007-04-02 20:51       ` Pavel Machek
2007-04-06 14:34         ` Rafael J. Wysocki
2007-04-06 22:20           ` Nigel Cunningham
2007-04-07  9:33             ` Rafael J. Wysocki
2007-04-07  9:47               ` Nigel Cunningham
2007-04-09  3:04         ` Gautham R Shenoy
2007-04-03  7:59       ` Gautham R Shenoy [this message]
2007-04-05  9:46   ` Oleg Nesterov
2007-04-05 10:59     ` Gautham R Shenoy
2007-04-05 11:30       ` Oleg Nesterov
2007-04-02  5:37 ` [PATCH 2/8] Make process freezer reentrant Gautham R Shenoy
2007-04-05  9:53   ` Oleg Nesterov
2007-04-05 10:19     ` Gautham R Shenoy
2007-04-02  5:38 ` [PATCH 3/8] Use process freezer for cpu-hotplug Gautham R Shenoy
2007-04-05 10:53   ` Oleg Nesterov
2007-04-05 12:14     ` Gautham R Shenoy
2007-04-05 13:34       ` Oleg Nesterov
2007-04-06 17:27   ` Nathan Lynch
2007-04-06 17:34     ` Ingo Molnar
2007-04-06 17:47       ` Nathan Lynch
2007-04-06 22:22         ` Nigel Cunningham
2007-04-14 18:48       ` Pavel Machek
2007-04-02  5:39 ` [PATCH 4/8] Rip out lock_cpu_hotplug() Gautham R Shenoy
2007-04-02  5:40 ` [PATCH 5/8] __cpu_up: use singlethreaded workqueue Gautham R Shenoy
2007-04-05 12:08   ` Oleg Nesterov
2007-04-02  5:41 ` [PATCH 6/8] Make non-singlethreaded workqueues freezeable by default Gautham R Shenoy
2007-04-05 11:57   ` Oleg Nesterov
2007-04-05 20:06     ` Andrew Morton
2007-04-02  5:42 ` [PATCH 7/8] Clean up workqueue.c with respect to the freezer based cpu-hotplug Gautham R Shenoy
2007-04-03 11:47   ` Oleg Nesterov
2007-04-03 13:59     ` Srivatsa Vaddagiri
2007-04-03 15:03       ` Oleg Nesterov
2007-04-03 17:18         ` Srivatsa Vaddagiri
2007-04-04 15:28           ` Oleg Nesterov
2007-04-04 17:49             ` Srivatsa Vaddagiri
2007-04-05 12:20               ` Oleg Nesterov
2007-04-12  2:22           ` Srivatsa Vaddagiri
2007-04-12 10:01             ` Gautham R Shenoy
2007-04-12 16:00             ` Oleg Nesterov
2007-04-13  9:46               ` Gautham R Shenoy
2007-04-02  5:42 ` [PATCH 8/8] Make kernel threads freezeable for cpu-hotplug Gautham R Shenoy
2007-04-02  6:16 ` [RFC] Cpu-hotplug: Using the Process Freezer (try2) Ingo Molnar
2007-04-02  9:28   ` Srivatsa Vaddagiri
2007-04-02 11:18     ` Ingo Molnar
2007-04-02 12:42       ` Srivatsa Vaddagiri
2007-04-02 14:16         ` Gautham R Shenoy
2007-04-02 18:56         ` Ingo Molnar
2007-04-03 12:56           ` Srivatsa Vaddagiri
2007-04-03 14:15             ` Gautham R Shenoy
2007-04-03 19:25               ` Rafael J. Wysocki
2007-04-04  3:15               ` Srivatsa Vaddagiri
2007-04-04 10:04                 ` Ingo Molnar
2007-04-04 10:41                   ` Gautham R Shenoy
2007-04-04 11:49                     ` Ingo Molnar
2007-04-04 12:24                       ` Gautham R Shenoy
2007-04-02 11:19   ` Gautham R Shenoy
2007-04-02 11:27     ` Ingo Molnar
2007-04-02 22:12       ` Rafael J. Wysocki
2007-04-02 13:22   ` Pavel Machek
2007-04-03 12:01   ` Gautham R Shenoy
2007-04-03 19:34     ` Rafael J. Wysocki
2007-04-03 20:24       ` Andrew Morton
2007-04-04 10:06         ` utrace merge Ingo Molnar
2007-04-04 10:36           ` Christoph Hellwig
2007-04-04 18:41             ` Andrew Morton
2007-04-03 14:01   ` [RFC] Cpu-hotplug: Using the Process Freezer (try2) Gautham R Shenoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070403075939.GA29308@in.ibm.com \
    --to=ego@in.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dino@in.ibm.com \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    --cc=paulmck@us.ibm.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.org \
    --cc=vatsa@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox