public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Andrew Morton <akpm@osdl.org>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	Ingo Molnar <mingo@elte.hu>,
	dipankar@in.ibm.com, Gautham Shenoy <ego@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Fw: Re: [mm PATCH 4/6] RCU: (now) CPU hotplug
Date: Sat, 3 Feb 2007 20:39:29 -0800	[thread overview]
Message-ID: <20070204043929.GG5647@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070203001745.GB1712@elf.ucw.cz>

On Sat, Feb 03, 2007 at 01:17:45AM +0100, Pavel Machek wrote:
> Hi!
> 
> > > Part of what I need to look at.  ;-)
> > 
> > OK.  This just might be feasible.  That said, there is a lot of code
> > containing PF_NOFREEZE that I am not familiar with.  That said, here
> > are my thoughts -- this is in addition to the changes to freeze_processes()
> > and thaw_processes() called out earlier.
> > 
> > Thoughts?
> 
> Looks ok to me.

Cool!

> > o	Introduce a mutex to prevent overlapping freezes -- or find
> > 	out what the heck prevents them at present!!!  (I don't see
> > 	anything.)  
> 
> swsusp is protected by some giant "doing suspend" mutex. Other users
> may be buggy :-).

Ah!  Any reason not to have locking at the level of the
freeze_processes()/thaw_processes() functions?

> > o	Replace all the "current->flags |= PF_NOFREEZE" statements with
> > 	"exempt_from_freeze(current, int pfe)" or some such.  This would
> > 	set the flags bit and also store the pfe argument into the pf_exempt
> > 	field.
> 
> I'd suggest step 0, remove as many PF_NOFREEZE as possible... ok, you
> seem to be doing that one.

Well, in my little corner of the kernel, anyway.  ;-)

> > o	init/do_mounts_initrd.c line 57 handle_initrd().
> > 	This looks to be short term anyway, so OK to leave.
> > 	But does kernel_execve() clear PF_NOFREEZE?
> > 
> > 	But it should be OK to freeze the init process when doing CPU
> > 	hotplug ops, right?
> 
> That looks bogus. If it is short term, it can as well live _without_
> PF_NOFREEZE. Noone should suspend system at that stage, right?

I agree that any attempt to freeze that early in boot would be
at best an act of extreme bravery!

> > o	kernel/softlockup.c line 88 watchdog().  Well, we wouldn't
> > 	want false alarms when freezing for hotplug.  Perhaps
> > 	temporarily disabling timestamp checking while doing hotplug
> > 	would do the trick.  But if hotplug takes the time required
> > 	to trigger softlockup (seconds!), we are broken anyway.
> > 	The fix would be to speed up the freezing process.
> 
> Freezing _can_ take seconds. We do sync in between freezing userspace
> and kernel, for example. We avoid freezing in some difficult situations
> by waiting for I/O to complete....

OK.  Point taken.

> > o	net/bluetooth/bnep/core.c line 476 bnep_session().  Suspending
> > 	to a bluetooth device???  These guys got -hair-!!!  I bet this
> > 	one can tolerate being frozen for hotplugging CPUs -- though
> > 	I could imagine the bluetooth protocol needing some TLC after
> > 	such an event.  But I don't know enough about bluetooth to do
> > 	more than raise the possibility.
> 
> Should be fixed. Someone was probably lazy.
> 
> > o	net/bluetooth/cmtp/core.c line 290 cmtp_session().  Same as
> > 	for bnep_session(), at least as far as I can tell.
> > 
> > o	net/bluetooth/hidp/core.c line 476 hidp_session().  Same as
> > 	for bnep_session(), AFAICT.
> > 
> > o	net/bluetooth/rfcomm/core.c line 1940 rfcomm_run(). Same as
> > 	for bnep_session(), AFAICT.
> 
> Someone was definitely lazy :-).
> 								Pavel

OK, so we should think in terms of moving these to try_to_freeze(),
then.

						Thanx, Paul

  reply	other threads:[~2007-02-04  4:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070124011519.GG1613@linux.vnet.ibm.com>
     [not found] ` <20070124090111.GC27221@in.ibm.com>
     [not found]   ` <20070124161559.GA1762@linux.vnet.ibm.com>
     [not found]     ` <20070124210645.GA19650@in.ibm.com>
2007-01-26 19:11       ` Fw: Re: [mm PATCH 4/6] RCU: (now) CPU hotplug Dipankar Sarma
2007-01-26 19:28         ` Andrew Morton
2007-01-26 19:46           ` Dipankar Sarma
2007-01-26 20:17             ` Andrew Morton
2007-01-26 20:44               ` Dipankar Sarma
2007-01-26 21:29                 ` Andrew Morton
2007-01-28 22:47                   ` Paul E. McKenney
2007-01-28 23:30                     ` Andrew Morton
2007-01-29  2:40                       ` Paul E. McKenney
2007-01-29 19:12                       ` Ingo Molnar
2007-01-30  2:45                         ` Paul E. McKenney
2007-01-30  7:33                           ` Ingo Molnar
2007-01-30 16:02                             ` Paul E. McKenney
2007-01-30 16:44                               ` Rafael J. Wysocki
2007-01-30 18:27                                 ` Andrew Morton
2007-01-30 19:49                                   ` Paul E. McKenney
2007-01-31 23:10                                     ` Paul E. McKenney
2007-02-03  0:17                                       ` Pavel Machek
2007-02-04  4:39                                         ` Paul E. McKenney [this message]
2007-02-04 11:08                                           ` Rafael J. Wysocki
2007-02-04 12:53                                             ` Pavel Machek
2007-02-04 13:46                                               ` Rafael J. Wysocki
2007-02-04 13:50                                                 ` Pavel Machek
2007-02-04 13:59                                                   ` Rafael J. Wysocki
2007-02-03  0:01                                 ` Pavel Machek
2007-02-03 22:27                                   ` Rafael J. Wysocki
2007-02-04  0:31                                     ` Paul E. McKenney
2007-01-30 14:02                           ` Gautham R Shenoy
2007-01-30 16:47                             ` Paul E. McKenney

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=20070204043929.GG5647@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@osdl.org \
    --cc=dipankar@in.ibm.com \
    --cc=ego@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    /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