All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
@ 2011-08-20  9:44 Tejun Heo
  2011-08-20 16:33 ` Rafael J. Wysocki
  2011-08-20 16:33 ` Rafael J. Wysocki
  0 siblings, 2 replies; 12+ messages in thread
From: Tejun Heo @ 2011-08-20  9:44 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-kernel, linux-pm, arnd, oleg, lizf, paul, Matt Helsley,
	Martin Schwidefsky

Hello, Rafael.

Please consider pulling from the following branch to receive freezer
fixes and simplifications patchset[1].  The only changes from the
posting are addition of acked-by's, minor patch description updates
and rebase on top of pm-next (af0fa9cb79 "PM / Hibernate: Include
storage keys in hibernation image on s390").

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer

The HEAD should be 7b5b95b3f51a28ec008a295e5247436637220f41.  If
git.korg doesn't show it yet.  Please pull from master.korg.

  ssh://master.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer

FYI, this patchset will cause a conflict with s390 TIF flag fix patch.
The conflict is trivial and Stephen should be able to handle it
without any problem.  Also, I'm planning on doing some further work on
cgroup freezer and then will try to bridge it with job control.  If
that plan fans out, I might ask Oleg to pull from the pm tree.  This
shouldn't matter too much either way but it *might* be a good idea to
keep this line of patches in a separate branch.

Thank you.

[1] http://thread.gmane.org/gmane.linux.kernel/1181594

Tejun Heo (16):
      freezer: fix current->state restoration race in refrigerator()
      freezer: don't unnecessarily set PF_NOFREEZE explicitly
      freezer: unexport refrigerator() and update try_to_freeze() slightly
      freezer: implement and use kthread_freezable_should_stop()
      freezer: rename thaw_process() to __thaw_task() and simplify the implementation
      freezer: make exiting tasks properly unfreezable
      freezer: don't distinguish nosig tasks on thaw
      freezer: use dedicated lock instead of task_lock() + memory barrier
      freezer: make freezing indicate freeze condition in effect
      freezer: fix set_freezable[_with_signal]() race
      freezer: kill PF_FREEZING
      freezer: clean up freeze_processes() failure path
      cgroup_freezer: prepare for removal of TIF_FREEZE
      freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
      freezer: remove now unused TIF_FREEZE
      freezer: remove should_send_signal() and update frozen()

 Documentation/power/freezing-of-tasks.txt |   14 +-
 arch/alpha/include/asm/thread_info.h      |    2 -
 arch/arm/include/asm/thread_info.h        |    2 -
 arch/avr32/include/asm/thread_info.h      |    2 -
 arch/blackfin/include/asm/thread_info.h   |    2 -
 arch/cris/include/asm/thread_info.h       |    2 -
 arch/frv/include/asm/thread_info.h        |    2 -
 arch/h8300/include/asm/thread_info.h      |    2 -
 arch/ia64/include/asm/thread_info.h       |    2 -
 arch/m32r/include/asm/thread_info.h       |    2 -
 arch/m68k/include/asm/thread_info.h       |    1 -
 arch/microblaze/include/asm/thread_info.h |    2 -
 arch/mips/include/asm/thread_info.h       |    2 -
 arch/mn10300/include/asm/thread_info.h    |    2 -
 arch/parisc/include/asm/thread_info.h     |    2 -
 arch/powerpc/include/asm/thread_info.h    |    2 -
 arch/s390/include/asm/thread_info.h       |    2 -
 arch/sh/include/asm/thread_info.h         |    2 -
 arch/sparc/include/asm/thread_info_32.h   |    2 -
 arch/sparc/include/asm/thread_info_64.h   |    2 -
 arch/um/include/asm/thread_info.h         |    2 -
 arch/unicore32/include/asm/thread_info.h  |    2 -
 arch/x86/include/asm/thread_info.h        |    2 -
 arch/xtensa/include/asm/thread_info.h     |    2 -
 drivers/bluetooth/btmrvl_main.c           |    2 -
 drivers/mfd/twl4030-irq.c                 |    3 -
 drivers/mfd/twl6030-irq.c                 |    2 -
 drivers/net/irda/stir4200.c               |    2 +-
 drivers/platform/x86/thinkpad_acpi.c      |   15 +--
 drivers/staging/rts_pstor/rtsx.c          |    2 -
 fs/btrfs/async-thread.c                   |    2 +-
 fs/btrfs/disk-io.c                        |    8 +-
 fs/ext4/super.c                           |    3 +-
 fs/fs-writeback.c                         |    4 +-
 fs/gfs2/log.c                             |    4 +-
 fs/gfs2/quota.c                           |    4 +-
 fs/jbd/journal.c                          |    2 +-
 fs/jbd2/journal.c                         |    2 +-
 fs/jfs/jfs_logmgr.c                       |    2 +-
 fs/jfs/jfs_txnmgr.c                       |    4 +-
 fs/nilfs2/segment.c                       |    2 +-
 fs/xfs/linux-2.6/xfs_buf.c                |    2 +-
 include/linux/freezer.h                   |   78 +++++--------
 include/linux/kthread.h                   |    1 +
 include/linux/sched.h                     |    3 +-
 kernel/cgroup_freezer.c                   |   51 ++++-----
 kernel/exit.c                             |    8 +-
 kernel/fork.c                             |    1 -
 kernel/freezer.c                          |  179 +++++++++++++++++------------
 kernel/kthread.c                          |   25 ++++
 kernel/power/hibernate.c                  |   15 +--
 kernel/power/process.c                    |   65 ++++-------
 kernel/power/user.c                       |    4 +-
 mm/backing-dev.c                          |    8 +-
 54 files changed, 247 insertions(+), 315 deletions(-)

--
tejun

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-20  9:44 [GIT PULL pm-next] freezer: fix various bugs and simplify implementation Tejun Heo
  2011-08-20 16:33 ` Rafael J. Wysocki
@ 2011-08-20 16:33 ` Rafael J. Wysocki
  2011-08-21  9:12   ` Tejun Heo
  2011-08-21  9:12   ` Tejun Heo
  1 sibling, 2 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2011-08-20 16:33 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-kernel, linux-pm, arnd, oleg, lizf, paul, Matt Helsley,
	Martin Schwidefsky

Hi,

On Saturday, August 20, 2011, Tejun Heo wrote:
> Hello, Rafael.
> 
> Please consider pulling from the following branch to receive freezer
> fixes and simplifications patchset[1].  The only changes from the
> posting are addition of acked-by's, minor patch description updates
> and rebase on top of pm-next (af0fa9cb79 "PM / Hibernate: Include
> storage keys in hibernation image on s390").
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer
> 
> The HEAD should be 7b5b95b3f51a28ec008a295e5247436637220f41.  If
> git.korg doesn't show it yet.  Please pull from master.korg.
> 
>   ssh://master.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer

Pulled and stored in the pm-freezer branch in my tree, and merged into
the linux-next branch.

> FYI, this patchset will cause a conflict with s390 TIF flag fix patch.
> The conflict is trivial and Stephen should be able to handle it
> without any problem.  Also, I'm planning on doing some further work on
> cgroup freezer and then will try to bridge it with job control.  If
> that plan fans out, I might ask Oleg to pull from the pm tree.

I'm not sure if Linus likes it.  He generally doesn't want the trees
that he pulls from to be entangled this way.

> This shouldn't matter too much either way but it *might* be a good idea to
> keep this line of patches in a separate branch.

I'm going to keep it in the pm-freezer branch anyway (there may be patches
on top of it, though)

Thanks,
Rafael

 
> [1] http://thread.gmane.org/gmane.linux.kernel/1181594
> 
> Tejun Heo (16):
>       freezer: fix current->state restoration race in refrigerator()
>       freezer: don't unnecessarily set PF_NOFREEZE explicitly
>       freezer: unexport refrigerator() and update try_to_freeze() slightly
>       freezer: implement and use kthread_freezable_should_stop()
>       freezer: rename thaw_process() to __thaw_task() and simplify the implementation
>       freezer: make exiting tasks properly unfreezable
>       freezer: don't distinguish nosig tasks on thaw
>       freezer: use dedicated lock instead of task_lock() + memory barrier
>       freezer: make freezing indicate freeze condition in effect
>       freezer: fix set_freezable[_with_signal]() race
>       freezer: kill PF_FREEZING
>       freezer: clean up freeze_processes() failure path
>       cgroup_freezer: prepare for removal of TIF_FREEZE
>       freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
>       freezer: remove now unused TIF_FREEZE
>       freezer: remove should_send_signal() and update frozen()
> 
>  Documentation/power/freezing-of-tasks.txt |   14 +-
>  arch/alpha/include/asm/thread_info.h      |    2 -
>  arch/arm/include/asm/thread_info.h        |    2 -
>  arch/avr32/include/asm/thread_info.h      |    2 -
>  arch/blackfin/include/asm/thread_info.h   |    2 -
>  arch/cris/include/asm/thread_info.h       |    2 -
>  arch/frv/include/asm/thread_info.h        |    2 -
>  arch/h8300/include/asm/thread_info.h      |    2 -
>  arch/ia64/include/asm/thread_info.h       |    2 -
>  arch/m32r/include/asm/thread_info.h       |    2 -
>  arch/m68k/include/asm/thread_info.h       |    1 -
>  arch/microblaze/include/asm/thread_info.h |    2 -
>  arch/mips/include/asm/thread_info.h       |    2 -
>  arch/mn10300/include/asm/thread_info.h    |    2 -
>  arch/parisc/include/asm/thread_info.h     |    2 -
>  arch/powerpc/include/asm/thread_info.h    |    2 -
>  arch/s390/include/asm/thread_info.h       |    2 -
>  arch/sh/include/asm/thread_info.h         |    2 -
>  arch/sparc/include/asm/thread_info_32.h   |    2 -
>  arch/sparc/include/asm/thread_info_64.h   |    2 -
>  arch/um/include/asm/thread_info.h         |    2 -
>  arch/unicore32/include/asm/thread_info.h  |    2 -
>  arch/x86/include/asm/thread_info.h        |    2 -
>  arch/xtensa/include/asm/thread_info.h     |    2 -
>  drivers/bluetooth/btmrvl_main.c           |    2 -
>  drivers/mfd/twl4030-irq.c                 |    3 -
>  drivers/mfd/twl6030-irq.c                 |    2 -
>  drivers/net/irda/stir4200.c               |    2 +-
>  drivers/platform/x86/thinkpad_acpi.c      |   15 +--
>  drivers/staging/rts_pstor/rtsx.c          |    2 -
>  fs/btrfs/async-thread.c                   |    2 +-
>  fs/btrfs/disk-io.c                        |    8 +-
>  fs/ext4/super.c                           |    3 +-
>  fs/fs-writeback.c                         |    4 +-
>  fs/gfs2/log.c                             |    4 +-
>  fs/gfs2/quota.c                           |    4 +-
>  fs/jbd/journal.c                          |    2 +-
>  fs/jbd2/journal.c                         |    2 +-
>  fs/jfs/jfs_logmgr.c                       |    2 +-
>  fs/jfs/jfs_txnmgr.c                       |    4 +-
>  fs/nilfs2/segment.c                       |    2 +-
>  fs/xfs/linux-2.6/xfs_buf.c                |    2 +-
>  include/linux/freezer.h                   |   78 +++++--------
>  include/linux/kthread.h                   |    1 +
>  include/linux/sched.h                     |    3 +-
>  kernel/cgroup_freezer.c                   |   51 ++++-----
>  kernel/exit.c                             |    8 +-
>  kernel/fork.c                             |    1 -
>  kernel/freezer.c                          |  179 +++++++++++++++++------------
>  kernel/kthread.c                          |   25 ++++
>  kernel/power/hibernate.c                  |   15 +--
>  kernel/power/process.c                    |   65 ++++-------
>  kernel/power/user.c                       |    4 +-
>  mm/backing-dev.c                          |    8 +-
>  54 files changed, 247 insertions(+), 315 deletions(-)
> 
> --
> tejun
> 
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-20  9:44 [GIT PULL pm-next] freezer: fix various bugs and simplify implementation Tejun Heo
@ 2011-08-20 16:33 ` Rafael J. Wysocki
  2011-08-20 16:33 ` Rafael J. Wysocki
  1 sibling, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2011-08-20 16:33 UTC (permalink / raw)
  To: Tejun Heo
  Cc: arnd, paul, lizf, linux-kernel, oleg, Martin Schwidefsky, linux-pm

Hi,

On Saturday, August 20, 2011, Tejun Heo wrote:
> Hello, Rafael.
> 
> Please consider pulling from the following branch to receive freezer
> fixes and simplifications patchset[1].  The only changes from the
> posting are addition of acked-by's, minor patch description updates
> and rebase on top of pm-next (af0fa9cb79 "PM / Hibernate: Include
> storage keys in hibernation image on s390").
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer
> 
> The HEAD should be 7b5b95b3f51a28ec008a295e5247436637220f41.  If
> git.korg doesn't show it yet.  Please pull from master.korg.
> 
>   ssh://master.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer

Pulled and stored in the pm-freezer branch in my tree, and merged into
the linux-next branch.

> FYI, this patchset will cause a conflict with s390 TIF flag fix patch.
> The conflict is trivial and Stephen should be able to handle it
> without any problem.  Also, I'm planning on doing some further work on
> cgroup freezer and then will try to bridge it with job control.  If
> that plan fans out, I might ask Oleg to pull from the pm tree.

I'm not sure if Linus likes it.  He generally doesn't want the trees
that he pulls from to be entangled this way.

> This shouldn't matter too much either way but it *might* be a good idea to
> keep this line of patches in a separate branch.

I'm going to keep it in the pm-freezer branch anyway (there may be patches
on top of it, though)

Thanks,
Rafael

 
> [1] http://thread.gmane.org/gmane.linux.kernel/1181594
> 
> Tejun Heo (16):
>       freezer: fix current->state restoration race in refrigerator()
>       freezer: don't unnecessarily set PF_NOFREEZE explicitly
>       freezer: unexport refrigerator() and update try_to_freeze() slightly
>       freezer: implement and use kthread_freezable_should_stop()
>       freezer: rename thaw_process() to __thaw_task() and simplify the implementation
>       freezer: make exiting tasks properly unfreezable
>       freezer: don't distinguish nosig tasks on thaw
>       freezer: use dedicated lock instead of task_lock() + memory barrier
>       freezer: make freezing indicate freeze condition in effect
>       freezer: fix set_freezable[_with_signal]() race
>       freezer: kill PF_FREEZING
>       freezer: clean up freeze_processes() failure path
>       cgroup_freezer: prepare for removal of TIF_FREEZE
>       freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
>       freezer: remove now unused TIF_FREEZE
>       freezer: remove should_send_signal() and update frozen()
> 
>  Documentation/power/freezing-of-tasks.txt |   14 +-
>  arch/alpha/include/asm/thread_info.h      |    2 -
>  arch/arm/include/asm/thread_info.h        |    2 -
>  arch/avr32/include/asm/thread_info.h      |    2 -
>  arch/blackfin/include/asm/thread_info.h   |    2 -
>  arch/cris/include/asm/thread_info.h       |    2 -
>  arch/frv/include/asm/thread_info.h        |    2 -
>  arch/h8300/include/asm/thread_info.h      |    2 -
>  arch/ia64/include/asm/thread_info.h       |    2 -
>  arch/m32r/include/asm/thread_info.h       |    2 -
>  arch/m68k/include/asm/thread_info.h       |    1 -
>  arch/microblaze/include/asm/thread_info.h |    2 -
>  arch/mips/include/asm/thread_info.h       |    2 -
>  arch/mn10300/include/asm/thread_info.h    |    2 -
>  arch/parisc/include/asm/thread_info.h     |    2 -
>  arch/powerpc/include/asm/thread_info.h    |    2 -
>  arch/s390/include/asm/thread_info.h       |    2 -
>  arch/sh/include/asm/thread_info.h         |    2 -
>  arch/sparc/include/asm/thread_info_32.h   |    2 -
>  arch/sparc/include/asm/thread_info_64.h   |    2 -
>  arch/um/include/asm/thread_info.h         |    2 -
>  arch/unicore32/include/asm/thread_info.h  |    2 -
>  arch/x86/include/asm/thread_info.h        |    2 -
>  arch/xtensa/include/asm/thread_info.h     |    2 -
>  drivers/bluetooth/btmrvl_main.c           |    2 -
>  drivers/mfd/twl4030-irq.c                 |    3 -
>  drivers/mfd/twl6030-irq.c                 |    2 -
>  drivers/net/irda/stir4200.c               |    2 +-
>  drivers/platform/x86/thinkpad_acpi.c      |   15 +--
>  drivers/staging/rts_pstor/rtsx.c          |    2 -
>  fs/btrfs/async-thread.c                   |    2 +-
>  fs/btrfs/disk-io.c                        |    8 +-
>  fs/ext4/super.c                           |    3 +-
>  fs/fs-writeback.c                         |    4 +-
>  fs/gfs2/log.c                             |    4 +-
>  fs/gfs2/quota.c                           |    4 +-
>  fs/jbd/journal.c                          |    2 +-
>  fs/jbd2/journal.c                         |    2 +-
>  fs/jfs/jfs_logmgr.c                       |    2 +-
>  fs/jfs/jfs_txnmgr.c                       |    4 +-
>  fs/nilfs2/segment.c                       |    2 +-
>  fs/xfs/linux-2.6/xfs_buf.c                |    2 +-
>  include/linux/freezer.h                   |   78 +++++--------
>  include/linux/kthread.h                   |    1 +
>  include/linux/sched.h                     |    3 +-
>  kernel/cgroup_freezer.c                   |   51 ++++-----
>  kernel/exit.c                             |    8 +-
>  kernel/fork.c                             |    1 -
>  kernel/freezer.c                          |  179 +++++++++++++++++------------
>  kernel/kthread.c                          |   25 ++++
>  kernel/power/hibernate.c                  |   15 +--
>  kernel/power/process.c                    |   65 ++++-------
>  kernel/power/user.c                       |    4 +-
>  mm/backing-dev.c                          |    8 +-
>  54 files changed, 247 insertions(+), 315 deletions(-)
> 
> --
> tejun
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-20 16:33 ` Rafael J. Wysocki
  2011-08-21  9:12   ` Tejun Heo
@ 2011-08-21  9:12   ` Tejun Heo
  2011-08-21 18:03     ` Rafael J. Wysocki
  2011-08-21 18:03     ` Rafael J. Wysocki
  1 sibling, 2 replies; 12+ messages in thread
From: Tejun Heo @ 2011-08-21  9:12 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-kernel, linux-pm, arnd, oleg, lizf, paul, Matt Helsley,
	Martin Schwidefsky

Hello, Rafafel.

On Sat, Aug 20, 2011 at 06:33:38PM +0200, Rafael J. Wysocki wrote:
> >   ssh://master.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer
> 
> Pulled and stored in the pm-freezer branch in my tree, and merged into
> the linux-next branch.

Cool.

> > FYI, this patchset will cause a conflict with s390 TIF flag fix patch.
> > The conflict is trivial and Stephen should be able to handle it
> > without any problem.  Also, I'm planning on doing some further work on
> > cgroup freezer and then will try to bridge it with job control.  If
> > that plan fans out, I might ask Oleg to pull from the pm tree.
> 
> I'm not sure if Linus likes it.  He generally doesn't want the trees
> that he pulls from to be entangled this way.

The job control portion has to go through Linus anyway, so let's see
how that flies.

> > This shouldn't matter too much either way but it *might* be a good idea to
> > keep this line of patches in a separate branch.
> 
> I'm going to keep it in the pm-freezer branch anyway (there may be patches
> on top of it, though)

Yeah, I'm pretty sure it will need some fix too.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-20 16:33 ` Rafael J. Wysocki
@ 2011-08-21  9:12   ` Tejun Heo
  2011-08-21  9:12   ` Tejun Heo
  1 sibling, 0 replies; 12+ messages in thread
From: Tejun Heo @ 2011-08-21  9:12 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: arnd, paul, lizf, linux-kernel, oleg, Martin Schwidefsky, linux-pm

Hello, Rafafel.

On Sat, Aug 20, 2011 at 06:33:38PM +0200, Rafael J. Wysocki wrote:
> >   ssh://master.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer
> 
> Pulled and stored in the pm-freezer branch in my tree, and merged into
> the linux-next branch.

Cool.

> > FYI, this patchset will cause a conflict with s390 TIF flag fix patch.
> > The conflict is trivial and Stephen should be able to handle it
> > without any problem.  Also, I'm planning on doing some further work on
> > cgroup freezer and then will try to bridge it with job control.  If
> > that plan fans out, I might ask Oleg to pull from the pm tree.
> 
> I'm not sure if Linus likes it.  He generally doesn't want the trees
> that he pulls from to be entangled this way.

The job control portion has to go through Linus anyway, so let's see
how that flies.

> > This shouldn't matter too much either way but it *might* be a good idea to
> > keep this line of patches in a separate branch.
> 
> I'm going to keep it in the pm-freezer branch anyway (there may be patches
> on top of it, though)

Yeah, I'm pretty sure it will need some fix too.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-21  9:12   ` Tejun Heo
  2011-08-21 18:03     ` Rafael J. Wysocki
@ 2011-08-21 18:03     ` Rafael J. Wysocki
  2011-08-22  9:58       ` Tejun Heo
  2011-08-22  9:58       ` Tejun Heo
  1 sibling, 2 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2011-08-21 18:03 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-kernel, linux-pm, arnd, oleg, lizf, paul, Matt Helsley,
	Martin Schwidefsky

On Sunday, August 21, 2011, Tejun Heo wrote:
> Hello, Rafafel.
> 
> On Sat, Aug 20, 2011 at 06:33:38PM +0200, Rafael J. Wysocki wrote:
> > >   ssh://master.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer
> > 
> > Pulled and stored in the pm-freezer branch in my tree, and merged into
> > the linux-next branch.
> 
> Cool.
> 
> > > FYI, this patchset will cause a conflict with s390 TIF flag fix patch.
> > > The conflict is trivial and Stephen should be able to handle it
> > > without any problem.  Also, I'm planning on doing some further work on
> > > cgroup freezer and then will try to bridge it with job control.  If
> > > that plan fans out, I might ask Oleg to pull from the pm tree.
> > 
> > I'm not sure if Linus likes it.  He generally doesn't want the trees
> > that he pulls from to be entangled this way.
> 
> The job control portion has to go through Linus anyway, so let's see
> how that flies.
> 
> > > This shouldn't matter too much either way but it *might* be a good idea to
> > > keep this line of patches in a separate branch.
> > 
> > I'm going to keep it in the pm-freezer branch anyway (there may be patches
> > on top of it, though)
> 
> Yeah, I'm pretty sure it will need some fix too.

Speaking of which, the addition of might_sleep() to try_to_freeze()
causes a badly looking backtrace to appear during reboot on ARM,
so I'd prefer it to go into __refrigerator().

Please tell me what you think of the patch below.

Rafael

---
From: Rafael J. Wysocki <rjw@sisk.pl>
Subject: PM / Freezer: Move might_sleep() from try_to_freeze()

There are some code paths that call try_to_freeze() from interrupt
context, but doing so they know that the current process cannot
possible be freezing (e.g. during reboot on ARM).  However, the
recently added might_sleep() annotation in try_to_freeze()
triggers in those cases, making it look like there were bugs in
those places, which really isn't the case.

Therefore move might_sleep() from try_to_freeze() to
__refrigerator() so that it doesn't produce false positives.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 include/linux/freezer.h |    1 -
 kernel/freezer.c        |    2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

Index: linux/include/linux/freezer.h
===================================================================
--- linux.orig/include/linux/freezer.h
+++ linux/include/linux/freezer.h
@@ -41,7 +41,6 @@ extern void thaw_processes(void);
 
 static inline bool try_to_freeze(void)
 {
-	might_sleep();
 	if (likely(!freezing(current)))
 		return false;
 	return __refrigerator(false);
Index: linux/kernel/freezer.c
===================================================================
--- linux.orig/kernel/freezer.c
+++ linux/kernel/freezer.c
@@ -54,6 +54,8 @@ bool __refrigerator(bool check_kthr_stop
 	bool was_frozen = false;
 	long save;
 
+	might_sleep();
+
 	/*
 	 * No point in checking freezing() again - the caller already did.
 	 * Proceed to enter FROZEN.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-21  9:12   ` Tejun Heo
@ 2011-08-21 18:03     ` Rafael J. Wysocki
  2011-08-21 18:03     ` Rafael J. Wysocki
  1 sibling, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2011-08-21 18:03 UTC (permalink / raw)
  To: Tejun Heo
  Cc: arnd, paul, lizf, linux-kernel, oleg, Martin Schwidefsky, linux-pm

On Sunday, August 21, 2011, Tejun Heo wrote:
> Hello, Rafafel.
> 
> On Sat, Aug 20, 2011 at 06:33:38PM +0200, Rafael J. Wysocki wrote:
> > >   ssh://master.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer
> > 
> > Pulled and stored in the pm-freezer branch in my tree, and merged into
> > the linux-next branch.
> 
> Cool.
> 
> > > FYI, this patchset will cause a conflict with s390 TIF flag fix patch.
> > > The conflict is trivial and Stephen should be able to handle it
> > > without any problem.  Also, I'm planning on doing some further work on
> > > cgroup freezer and then will try to bridge it with job control.  If
> > > that plan fans out, I might ask Oleg to pull from the pm tree.
> > 
> > I'm not sure if Linus likes it.  He generally doesn't want the trees
> > that he pulls from to be entangled this way.
> 
> The job control portion has to go through Linus anyway, so let's see
> how that flies.
> 
> > > This shouldn't matter too much either way but it *might* be a good idea to
> > > keep this line of patches in a separate branch.
> > 
> > I'm going to keep it in the pm-freezer branch anyway (there may be patches
> > on top of it, though)
> 
> Yeah, I'm pretty sure it will need some fix too.

Speaking of which, the addition of might_sleep() to try_to_freeze()
causes a badly looking backtrace to appear during reboot on ARM,
so I'd prefer it to go into __refrigerator().

Please tell me what you think of the patch below.

Rafael

---
From: Rafael J. Wysocki <rjw@sisk.pl>
Subject: PM / Freezer: Move might_sleep() from try_to_freeze()

There are some code paths that call try_to_freeze() from interrupt
context, but doing so they know that the current process cannot
possible be freezing (e.g. during reboot on ARM).  However, the
recently added might_sleep() annotation in try_to_freeze()
triggers in those cases, making it look like there were bugs in
those places, which really isn't the case.

Therefore move might_sleep() from try_to_freeze() to
__refrigerator() so that it doesn't produce false positives.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 include/linux/freezer.h |    1 -
 kernel/freezer.c        |    2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

Index: linux/include/linux/freezer.h
===================================================================
--- linux.orig/include/linux/freezer.h
+++ linux/include/linux/freezer.h
@@ -41,7 +41,6 @@ extern void thaw_processes(void);
 
 static inline bool try_to_freeze(void)
 {
-	might_sleep();
 	if (likely(!freezing(current)))
 		return false;
 	return __refrigerator(false);
Index: linux/kernel/freezer.c
===================================================================
--- linux.orig/kernel/freezer.c
+++ linux/kernel/freezer.c
@@ -54,6 +54,8 @@ bool __refrigerator(bool check_kthr_stop
 	bool was_frozen = false;
 	long save;
 
+	might_sleep();
+
 	/*
 	 * No point in checking freezing() again - the caller already did.
 	 * Proceed to enter FROZEN.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-21 18:03     ` Rafael J. Wysocki
  2011-08-22  9:58       ` Tejun Heo
@ 2011-08-22  9:58       ` Tejun Heo
  2011-08-22 18:50         ` Rafael J. Wysocki
  2011-08-22 18:50         ` Rafael J. Wysocki
  1 sibling, 2 replies; 12+ messages in thread
From: Tejun Heo @ 2011-08-22  9:58 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-kernel, linux-pm, arnd, oleg, lizf, paul, Matt Helsley,
	Martin Schwidefsky

Hello, Rafael.

On Sun, Aug 21, 2011 at 08:03:14PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@sisk.pl>
> Subject: PM / Freezer: Move might_sleep() from try_to_freeze()
> 
> There are some code paths that call try_to_freeze() from interrupt
> context, but doing so they know that the current process cannot
> possible be freezing (e.g. during reboot on ARM).  However, the
> recently added might_sleep() annotation in try_to_freeze()
> triggers in those cases, making it look like there were bugs in
> those places, which really isn't the case.
> 
> Therefore move might_sleep() from try_to_freeze() to
> __refrigerator() so that it doesn't produce false positives.

Hmmm... I can't quite agree with this change.  Some invocations of
try_to_freeze() can be very difficult to trigger.  Freezing isn't a
frequent operation after some try_to_freeze() can be buried in weird
places.  might_sleep() is exactly to detect context bugs in these
situations.  If a code path is called from both sleepable and
unsleepable context and it knows that the latter wouldn't happen if
the system is freezing, that code path should conditionalize
invocation of try_to_freeze() based on its knowledge of context.  That
way, all other normal cases get the might_sleep() protection and the
peculiar logic in that code path is explicitly described - win win.

Can you please point me to where the problem was?

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-21 18:03     ` Rafael J. Wysocki
@ 2011-08-22  9:58       ` Tejun Heo
  2011-08-22  9:58       ` Tejun Heo
  1 sibling, 0 replies; 12+ messages in thread
From: Tejun Heo @ 2011-08-22  9:58 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: arnd, paul, lizf, linux-kernel, oleg, Martin Schwidefsky, linux-pm

Hello, Rafael.

On Sun, Aug 21, 2011 at 08:03:14PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@sisk.pl>
> Subject: PM / Freezer: Move might_sleep() from try_to_freeze()
> 
> There are some code paths that call try_to_freeze() from interrupt
> context, but doing so they know that the current process cannot
> possible be freezing (e.g. during reboot on ARM).  However, the
> recently added might_sleep() annotation in try_to_freeze()
> triggers in those cases, making it look like there were bugs in
> those places, which really isn't the case.
> 
> Therefore move might_sleep() from try_to_freeze() to
> __refrigerator() so that it doesn't produce false positives.

Hmmm... I can't quite agree with this change.  Some invocations of
try_to_freeze() can be very difficult to trigger.  Freezing isn't a
frequent operation after some try_to_freeze() can be buried in weird
places.  might_sleep() is exactly to detect context bugs in these
situations.  If a code path is called from both sleepable and
unsleepable context and it knows that the latter wouldn't happen if
the system is freezing, that code path should conditionalize
invocation of try_to_freeze() based on its knowledge of context.  That
way, all other normal cases get the might_sleep() protection and the
peculiar logic in that code path is explicitly described - win win.

Can you please point me to where the problem was?

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-22  9:58       ` Tejun Heo
  2011-08-22 18:50         ` Rafael J. Wysocki
@ 2011-08-22 18:50         ` Rafael J. Wysocki
  1 sibling, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2011-08-22 18:50 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-kernel, linux-pm, arnd, oleg, lizf, paul, Matt Helsley,
	Martin Schwidefsky

On Monday, August 22, 2011, Tejun Heo wrote:
> Hello, Rafael.
> 
> On Sun, Aug 21, 2011 at 08:03:14PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > Subject: PM / Freezer: Move might_sleep() from try_to_freeze()
> > 
> > There are some code paths that call try_to_freeze() from interrupt
> > context, but doing so they know that the current process cannot
> > possible be freezing (e.g. during reboot on ARM).  However, the
> > recently added might_sleep() annotation in try_to_freeze()
> > triggers in those cases, making it look like there were bugs in
> > those places, which really isn't the case.
> > 
> > Therefore move might_sleep() from try_to_freeze() to
> > __refrigerator() so that it doesn't produce false positives.
> 
> Hmmm... I can't quite agree with this change.  Some invocations of
> try_to_freeze() can be very difficult to trigger.  Freezing isn't a
> frequent operation after some try_to_freeze() can be buried in weird
> places.  might_sleep() is exactly to detect context bugs in these
> situations.  If a code path is called from both sleepable and
> unsleepable context and it knows that the latter wouldn't happen if
> the system is freezing, that code path should conditionalize
> invocation of try_to_freeze() based on its knowledge of context.  That
> way, all other normal cases get the might_sleep() protection and the
> peculiar logic in that code path is explicitly described - win win.
> 
> Can you please point me to where the problem was?

Apparently, during reboot on ARM try_to_freeze() is called via
do_signal() with interrupts disabled.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
  2011-08-22  9:58       ` Tejun Heo
@ 2011-08-22 18:50         ` Rafael J. Wysocki
  2011-08-22 18:50         ` Rafael J. Wysocki
  1 sibling, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2011-08-22 18:50 UTC (permalink / raw)
  To: Tejun Heo
  Cc: arnd, paul, lizf, linux-kernel, oleg, Martin Schwidefsky, linux-pm

On Monday, August 22, 2011, Tejun Heo wrote:
> Hello, Rafael.
> 
> On Sun, Aug 21, 2011 at 08:03:14PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > Subject: PM / Freezer: Move might_sleep() from try_to_freeze()
> > 
> > There are some code paths that call try_to_freeze() from interrupt
> > context, but doing so they know that the current process cannot
> > possible be freezing (e.g. during reboot on ARM).  However, the
> > recently added might_sleep() annotation in try_to_freeze()
> > triggers in those cases, making it look like there were bugs in
> > those places, which really isn't the case.
> > 
> > Therefore move might_sleep() from try_to_freeze() to
> > __refrigerator() so that it doesn't produce false positives.
> 
> Hmmm... I can't quite agree with this change.  Some invocations of
> try_to_freeze() can be very difficult to trigger.  Freezing isn't a
> frequent operation after some try_to_freeze() can be buried in weird
> places.  might_sleep() is exactly to detect context bugs in these
> situations.  If a code path is called from both sleepable and
> unsleepable context and it knows that the latter wouldn't happen if
> the system is freezing, that code path should conditionalize
> invocation of try_to_freeze() based on its knowledge of context.  That
> way, all other normal cases get the might_sleep() protection and the
> peculiar logic in that code path is explicitly described - win win.
> 
> Can you please point me to where the problem was?

Apparently, during reboot on ARM try_to_freeze() is called via
do_signal() with interrupts disabled.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [GIT PULL pm-next] freezer: fix various bugs and simplify implementation
@ 2011-08-20  9:44 Tejun Heo
  0 siblings, 0 replies; 12+ messages in thread
From: Tejun Heo @ 2011-08-20  9:44 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: arnd, paul, lizf, linux-kernel, oleg, Martin Schwidefsky, linux-pm

Hello, Rafael.

Please consider pulling from the following branch to receive freezer
fixes and simplifications patchset[1].  The only changes from the
posting are addition of acked-by's, minor patch description updates
and rebase on top of pm-next (af0fa9cb79 "PM / Hibernate: Include
storage keys in hibernation image on s390").

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer

The HEAD should be 7b5b95b3f51a28ec008a295e5247436637220f41.  If
git.korg doesn't show it yet.  Please pull from master.korg.

  ssh://master.kernel.org/pub/scm/linux/kernel/git/tj/misc.git freezer

FYI, this patchset will cause a conflict with s390 TIF flag fix patch.
The conflict is trivial and Stephen should be able to handle it
without any problem.  Also, I'm planning on doing some further work on
cgroup freezer and then will try to bridge it with job control.  If
that plan fans out, I might ask Oleg to pull from the pm tree.  This
shouldn't matter too much either way but it *might* be a good idea to
keep this line of patches in a separate branch.

Thank you.

[1] http://thread.gmane.org/gmane.linux.kernel/1181594

Tejun Heo (16):
      freezer: fix current->state restoration race in refrigerator()
      freezer: don't unnecessarily set PF_NOFREEZE explicitly
      freezer: unexport refrigerator() and update try_to_freeze() slightly
      freezer: implement and use kthread_freezable_should_stop()
      freezer: rename thaw_process() to __thaw_task() and simplify the implementation
      freezer: make exiting tasks properly unfreezable
      freezer: don't distinguish nosig tasks on thaw
      freezer: use dedicated lock instead of task_lock() + memory barrier
      freezer: make freezing indicate freeze condition in effect
      freezer: fix set_freezable[_with_signal]() race
      freezer: kill PF_FREEZING
      freezer: clean up freeze_processes() failure path
      cgroup_freezer: prepare for removal of TIF_FREEZE
      freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
      freezer: remove now unused TIF_FREEZE
      freezer: remove should_send_signal() and update frozen()

 Documentation/power/freezing-of-tasks.txt |   14 +-
 arch/alpha/include/asm/thread_info.h      |    2 -
 arch/arm/include/asm/thread_info.h        |    2 -
 arch/avr32/include/asm/thread_info.h      |    2 -
 arch/blackfin/include/asm/thread_info.h   |    2 -
 arch/cris/include/asm/thread_info.h       |    2 -
 arch/frv/include/asm/thread_info.h        |    2 -
 arch/h8300/include/asm/thread_info.h      |    2 -
 arch/ia64/include/asm/thread_info.h       |    2 -
 arch/m32r/include/asm/thread_info.h       |    2 -
 arch/m68k/include/asm/thread_info.h       |    1 -
 arch/microblaze/include/asm/thread_info.h |    2 -
 arch/mips/include/asm/thread_info.h       |    2 -
 arch/mn10300/include/asm/thread_info.h    |    2 -
 arch/parisc/include/asm/thread_info.h     |    2 -
 arch/powerpc/include/asm/thread_info.h    |    2 -
 arch/s390/include/asm/thread_info.h       |    2 -
 arch/sh/include/asm/thread_info.h         |    2 -
 arch/sparc/include/asm/thread_info_32.h   |    2 -
 arch/sparc/include/asm/thread_info_64.h   |    2 -
 arch/um/include/asm/thread_info.h         |    2 -
 arch/unicore32/include/asm/thread_info.h  |    2 -
 arch/x86/include/asm/thread_info.h        |    2 -
 arch/xtensa/include/asm/thread_info.h     |    2 -
 drivers/bluetooth/btmrvl_main.c           |    2 -
 drivers/mfd/twl4030-irq.c                 |    3 -
 drivers/mfd/twl6030-irq.c                 |    2 -
 drivers/net/irda/stir4200.c               |    2 +-
 drivers/platform/x86/thinkpad_acpi.c      |   15 +--
 drivers/staging/rts_pstor/rtsx.c          |    2 -
 fs/btrfs/async-thread.c                   |    2 +-
 fs/btrfs/disk-io.c                        |    8 +-
 fs/ext4/super.c                           |    3 +-
 fs/fs-writeback.c                         |    4 +-
 fs/gfs2/log.c                             |    4 +-
 fs/gfs2/quota.c                           |    4 +-
 fs/jbd/journal.c                          |    2 +-
 fs/jbd2/journal.c                         |    2 +-
 fs/jfs/jfs_logmgr.c                       |    2 +-
 fs/jfs/jfs_txnmgr.c                       |    4 +-
 fs/nilfs2/segment.c                       |    2 +-
 fs/xfs/linux-2.6/xfs_buf.c                |    2 +-
 include/linux/freezer.h                   |   78 +++++--------
 include/linux/kthread.h                   |    1 +
 include/linux/sched.h                     |    3 +-
 kernel/cgroup_freezer.c                   |   51 ++++-----
 kernel/exit.c                             |    8 +-
 kernel/fork.c                             |    1 -
 kernel/freezer.c                          |  179 +++++++++++++++++------------
 kernel/kthread.c                          |   25 ++++
 kernel/power/hibernate.c                  |   15 +--
 kernel/power/process.c                    |   65 ++++-------
 kernel/power/user.c                       |    4 +-
 mm/backing-dev.c                          |    8 +-
 54 files changed, 247 insertions(+), 315 deletions(-)

--
tejun

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-08-22 18:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-20  9:44 [GIT PULL pm-next] freezer: fix various bugs and simplify implementation Tejun Heo
2011-08-20 16:33 ` Rafael J. Wysocki
2011-08-20 16:33 ` Rafael J. Wysocki
2011-08-21  9:12   ` Tejun Heo
2011-08-21  9:12   ` Tejun Heo
2011-08-21 18:03     ` Rafael J. Wysocki
2011-08-21 18:03     ` Rafael J. Wysocki
2011-08-22  9:58       ` Tejun Heo
2011-08-22  9:58       ` Tejun Heo
2011-08-22 18:50         ` Rafael J. Wysocki
2011-08-22 18:50         ` Rafael J. Wysocki
2011-08-20  9:44 Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.