diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-11-23 15:09:02 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-11-23 15:09:02 -0500 |
commit | 986b11c3ee9e0eace25fe74a502205f7fe8c179b (patch) | |
tree | 2271bc519eac458fd92799f5731e2ef604f69341 /fs | |
parent | bb58dd5d1ffad6c2d21c69698ba766dad4ae54e6 (diff) | |
parent | 24b7ead3fb0bae267c2ee50898eb4c13aedd1e9f (diff) |
Merge branch 'pm-freezer' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc into pm-freezer
* 'pm-freezer' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc: (24 commits)
freezer: fix wait_event_freezable/__thaw_task races
freezer: kill unused set_freezable_with_signal()
dmatest: don't use set_freezable_with_signal()
usb_storage: don't use set_freezable_with_signal()
freezer: remove unused @sig_only from freeze_task()
freezer: use lock_task_sighand() in fake_signal_wake_up()
freezer: restructure __refrigerator()
freezer: fix set_freezable[_with_signal]() race
freezer: remove should_send_signal() and update frozen()
freezer: remove now unused TIF_FREEZE
freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
cgroup_freezer: prepare for removal of TIF_FREEZE
freezer: clean up freeze_processes() failure path
freezer: kill PF_FREEZING
freezer: test freezable conditions while holding freezer_lock
freezer: make freezing indicate freeze condition in effect
freezer: use dedicated lock instead of task_lock() + memory barrier
freezer: don't distinguish nosig tasks on thaw
freezer: remove racy clear_freeze_flag() and set PF_NOFREEZE on dead tasks
freezer: rename thaw_process() to __thaw_task() and simplify the implementation
...
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/async-thread.c | 2 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 8 | ||||
-rw-r--r-- | fs/ext4/super.c | 3 | ||||
-rw-r--r-- | fs/fs-writeback.c | 4 | ||||
-rw-r--r-- | fs/gfs2/log.c | 4 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 4 | ||||
-rw-r--r-- | fs/jbd/journal.c | 2 | ||||
-rw-r--r-- | fs/jbd2/journal.c | 2 | ||||
-rw-r--r-- | fs/jfs/jfs_logmgr.c | 2 | ||||
-rw-r--r-- | fs/jfs/jfs_txnmgr.c | 4 | ||||
-rw-r--r-- | fs/nilfs2/segment.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_buf.c | 2 |
12 files changed, 16 insertions, 23 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 7ec14097fef1..98ab240072e5 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c | |||
@@ -340,7 +340,7 @@ again: | |||
340 | if (freezing(current)) { | 340 | if (freezing(current)) { |
341 | worker->working = 0; | 341 | worker->working = 0; |
342 | spin_unlock_irq(&worker->lock); | 342 | spin_unlock_irq(&worker->lock); |
343 | refrigerator(); | 343 | try_to_freeze(); |
344 | } else { | 344 | } else { |
345 | spin_unlock_irq(&worker->lock); | 345 | spin_unlock_irq(&worker->lock); |
346 | if (!kthread_should_stop()) { | 346 | if (!kthread_should_stop()) { |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 632f8f3cc9db..b09175901521 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1579,9 +1579,7 @@ static int cleaner_kthread(void *arg) | |||
1579 | btrfs_run_defrag_inodes(root->fs_info); | 1579 | btrfs_run_defrag_inodes(root->fs_info); |
1580 | } | 1580 | } |
1581 | 1581 | ||
1582 | if (freezing(current)) { | 1582 | if (!try_to_freeze()) { |
1583 | refrigerator(); | ||
1584 | } else { | ||
1585 | set_current_state(TASK_INTERRUPTIBLE); | 1583 | set_current_state(TASK_INTERRUPTIBLE); |
1586 | if (!kthread_should_stop()) | 1584 | if (!kthread_should_stop()) |
1587 | schedule(); | 1585 | schedule(); |
@@ -1635,9 +1633,7 @@ sleep: | |||
1635 | wake_up_process(root->fs_info->cleaner_kthread); | 1633 | wake_up_process(root->fs_info->cleaner_kthread); |
1636 | mutex_unlock(&root->fs_info->transaction_kthread_mutex); | 1634 | mutex_unlock(&root->fs_info->transaction_kthread_mutex); |
1637 | 1635 | ||
1638 | if (freezing(current)) { | 1636 | if (!try_to_freeze()) { |
1639 | refrigerator(); | ||
1640 | } else { | ||
1641 | set_current_state(TASK_INTERRUPTIBLE); | 1637 | set_current_state(TASK_INTERRUPTIBLE); |
1642 | if (!kthread_should_stop() && | 1638 | if (!kthread_should_stop() && |
1643 | !btrfs_transaction_blocked(root->fs_info)) | 1639 | !btrfs_transaction_blocked(root->fs_info)) |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 3858767ec672..1c7bbd00e7e5 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -2884,8 +2884,7 @@ cont_thread: | |||
2884 | } | 2884 | } |
2885 | mutex_unlock(&eli->li_list_mtx); | 2885 | mutex_unlock(&eli->li_list_mtx); |
2886 | 2886 | ||
2887 | if (freezing(current)) | 2887 | try_to_freeze(); |
2888 | refrigerator(); | ||
2889 | 2888 | ||
2890 | cur = jiffies; | 2889 | cur = jiffies; |
2891 | if ((time_after_eq(cur, next_wakeup)) || | 2890 | if ((time_after_eq(cur, next_wakeup)) || |
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 73c3992b2bb4..271fde50f0ee 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -947,7 +947,7 @@ int bdi_writeback_thread(void *data) | |||
947 | 947 | ||
948 | trace_writeback_thread_start(bdi); | 948 | trace_writeback_thread_start(bdi); |
949 | 949 | ||
950 | while (!kthread_should_stop()) { | 950 | while (!kthread_freezable_should_stop(NULL)) { |
951 | /* | 951 | /* |
952 | * Remove own delayed wake-up timer, since we are already awake | 952 | * Remove own delayed wake-up timer, since we are already awake |
953 | * and we'll take care of the preriodic write-back. | 953 | * and we'll take care of the preriodic write-back. |
@@ -977,8 +977,6 @@ int bdi_writeback_thread(void *data) | |||
977 | */ | 977 | */ |
978 | schedule(); | 978 | schedule(); |
979 | } | 979 | } |
980 | |||
981 | try_to_freeze(); | ||
982 | } | 980 | } |
983 | 981 | ||
984 | /* Flush any work that raced with us exiting */ | 982 | /* Flush any work that raced with us exiting */ |
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 598646434362..8154d42e4647 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
@@ -951,8 +951,8 @@ int gfs2_logd(void *data) | |||
951 | wake_up(&sdp->sd_log_waitq); | 951 | wake_up(&sdp->sd_log_waitq); |
952 | 952 | ||
953 | t = gfs2_tune_get(sdp, gt_logd_secs) * HZ; | 953 | t = gfs2_tune_get(sdp, gt_logd_secs) * HZ; |
954 | if (freezing(current)) | 954 | |
955 | refrigerator(); | 955 | try_to_freeze(); |
956 | 956 | ||
957 | do { | 957 | do { |
958 | prepare_to_wait(&sdp->sd_logd_waitq, &wait, | 958 | prepare_to_wait(&sdp->sd_logd_waitq, &wait, |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 7e528dc14f85..d49669e92652 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -1427,8 +1427,8 @@ int gfs2_quotad(void *data) | |||
1427 | /* Check for & recover partially truncated inodes */ | 1427 | /* Check for & recover partially truncated inodes */ |
1428 | quotad_check_trunc_list(sdp); | 1428 | quotad_check_trunc_list(sdp); |
1429 | 1429 | ||
1430 | if (freezing(current)) | 1430 | try_to_freeze(); |
1431 | refrigerator(); | 1431 | |
1432 | t = min(quotad_timeo, statfs_timeo); | 1432 | t = min(quotad_timeo, statfs_timeo); |
1433 | 1433 | ||
1434 | prepare_to_wait(&sdp->sd_quota_wait, &wait, TASK_INTERRUPTIBLE); | 1434 | prepare_to_wait(&sdp->sd_quota_wait, &wait, TASK_INTERRUPTIBLE); |
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index fea8dd661d2b..a96cff0c5f1d 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -166,7 +166,7 @@ loop: | |||
166 | */ | 166 | */ |
167 | jbd_debug(1, "Now suspending kjournald\n"); | 167 | jbd_debug(1, "Now suspending kjournald\n"); |
168 | spin_unlock(&journal->j_state_lock); | 168 | spin_unlock(&journal->j_state_lock); |
169 | refrigerator(); | 169 | try_to_freeze(); |
170 | spin_lock(&journal->j_state_lock); | 170 | spin_lock(&journal->j_state_lock); |
171 | } else { | 171 | } else { |
172 | /* | 172 | /* |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 0fa0123151d3..c0a5f9f1b127 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -173,7 +173,7 @@ loop: | |||
173 | */ | 173 | */ |
174 | jbd_debug(1, "Now suspending kjournald2\n"); | 174 | jbd_debug(1, "Now suspending kjournald2\n"); |
175 | write_unlock(&journal->j_state_lock); | 175 | write_unlock(&journal->j_state_lock); |
176 | refrigerator(); | 176 | try_to_freeze(); |
177 | write_lock(&journal->j_state_lock); | 177 | write_lock(&journal->j_state_lock); |
178 | } else { | 178 | } else { |
179 | /* | 179 | /* |
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index cc5f811ed383..2eb952c41a69 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c | |||
@@ -2349,7 +2349,7 @@ int jfsIOWait(void *arg) | |||
2349 | 2349 | ||
2350 | if (freezing(current)) { | 2350 | if (freezing(current)) { |
2351 | spin_unlock_irq(&log_redrive_lock); | 2351 | spin_unlock_irq(&log_redrive_lock); |
2352 | refrigerator(); | 2352 | try_to_freeze(); |
2353 | } else { | 2353 | } else { |
2354 | set_current_state(TASK_INTERRUPTIBLE); | 2354 | set_current_state(TASK_INTERRUPTIBLE); |
2355 | spin_unlock_irq(&log_redrive_lock); | 2355 | spin_unlock_irq(&log_redrive_lock); |
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c index af9606057dde..bb8b661bcc50 100644 --- a/fs/jfs/jfs_txnmgr.c +++ b/fs/jfs/jfs_txnmgr.c | |||
@@ -2800,7 +2800,7 @@ int jfs_lazycommit(void *arg) | |||
2800 | 2800 | ||
2801 | if (freezing(current)) { | 2801 | if (freezing(current)) { |
2802 | LAZY_UNLOCK(flags); | 2802 | LAZY_UNLOCK(flags); |
2803 | refrigerator(); | 2803 | try_to_freeze(); |
2804 | } else { | 2804 | } else { |
2805 | DECLARE_WAITQUEUE(wq, current); | 2805 | DECLARE_WAITQUEUE(wq, current); |
2806 | 2806 | ||
@@ -2994,7 +2994,7 @@ int jfs_sync(void *arg) | |||
2994 | 2994 | ||
2995 | if (freezing(current)) { | 2995 | if (freezing(current)) { |
2996 | TXN_UNLOCK(); | 2996 | TXN_UNLOCK(); |
2997 | refrigerator(); | 2997 | try_to_freeze(); |
2998 | } else { | 2998 | } else { |
2999 | set_current_state(TASK_INTERRUPTIBLE); | 2999 | set_current_state(TASK_INTERRUPTIBLE); |
3000 | TXN_UNLOCK(); | 3000 | TXN_UNLOCK(); |
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index bb24ab6c282f..0e72ad6f22aa 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -2470,7 +2470,7 @@ static int nilfs_segctor_thread(void *arg) | |||
2470 | 2470 | ||
2471 | if (freezing(current)) { | 2471 | if (freezing(current)) { |
2472 | spin_unlock(&sci->sc_state_lock); | 2472 | spin_unlock(&sci->sc_state_lock); |
2473 | refrigerator(); | 2473 | try_to_freeze(); |
2474 | spin_lock(&sci->sc_state_lock); | 2474 | spin_lock(&sci->sc_state_lock); |
2475 | } else { | 2475 | } else { |
2476 | DEFINE_WAIT(wait); | 2476 | DEFINE_WAIT(wait); |
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index cf0ac056815f..018829936d6d 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
@@ -1703,7 +1703,7 @@ xfsbufd( | |||
1703 | 1703 | ||
1704 | if (unlikely(freezing(current))) { | 1704 | if (unlikely(freezing(current))) { |
1705 | set_bit(XBT_FORCE_SLEEP, &target->bt_flags); | 1705 | set_bit(XBT_FORCE_SLEEP, &target->bt_flags); |
1706 | refrigerator(); | 1706 | try_to_freeze(); |
1707 | } else { | 1707 | } else { |
1708 | clear_bit(XBT_FORCE_SLEEP, &target->bt_flags); | 1708 | clear_bit(XBT_FORCE_SLEEP, &target->bt_flags); |
1709 | } | 1709 | } |