diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-28 07:00:53 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-28 07:00:53 -0400 |
| commit | 207bc1181b1c03ab6ecb55bca5b307606dd1d6bc (patch) | |
| tree | 018365e826918d709beae86717db5ee9e4215bc6 | |
| parent | e8b6cb3947430d62538d88f615c007a51aeb23fe (diff) | |
| parent | 2b15af6f953012aac49984ead3f8ec744d941540 (diff) | |
Merge branch 'freezer'
* freezer:
af_unix: use freezable blocking calls in read
sigtimedwait: use freezable blocking call
nanosleep: use freezable blocking call
futex: use freezable blocking call
select: use freezable blocking call
epoll: use freezable blocking call
binder: use freezable blocking calls
freezer: add new freezable helpers using freezer_do_not_count()
freezer: convert freezable helpers to static inline where possible
freezer: convert freezable helpers to freezer_do_not_count()
freezer: skip waking up tasks with PF_FREEZER_SKIP set
freezer: shorten freezer sleep time using exponential backoff
lockdep: check that no locks held at freeze time
lockdep: remove task argument from debug_check_no_locks_held
freezer: add unsafe versions of freezable helpers for CIFS
freezer: add unsafe versions of freezable helpers for NFS
| -rw-r--r-- | drivers/staging/android/binder.c | 5 | ||||
| -rw-r--r-- | fs/cifs/transport.c | 2 | ||||
| -rw-r--r-- | fs/eventpoll.c | 4 | ||||
| -rw-r--r-- | fs/nfs/inode.c | 2 | ||||
| -rw-r--r-- | fs/nfs/nfs3proc.c | 2 | ||||
| -rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
| -rw-r--r-- | fs/select.c | 4 | ||||
| -rw-r--r-- | include/linux/debug_locks.h | 4 | ||||
| -rw-r--r-- | include/linux/freezer.h | 171 | ||||
| -rw-r--r-- | kernel/exit.c | 2 | ||||
| -rw-r--r-- | kernel/freezer.c | 12 | ||||
| -rw-r--r-- | kernel/futex.c | 3 | ||||
| -rw-r--r-- | kernel/hrtimer.c | 3 | ||||
| -rw-r--r-- | kernel/lockdep.c | 17 | ||||
| -rw-r--r-- | kernel/power/process.c | 26 | ||||
| -rw-r--r-- | kernel/signal.c | 2 | ||||
| -rw-r--r-- | net/sunrpc/sched.c | 2 | ||||
| -rw-r--r-- | net/unix/af_unix.c | 3 |
18 files changed, 200 insertions, 68 deletions
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index 1567ac296b39..1ffc2ebdf612 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
| 21 | #include <linux/fdtable.h> | 21 | #include <linux/fdtable.h> |
| 22 | #include <linux/file.h> | 22 | #include <linux/file.h> |
| 23 | #include <linux/freezer.h> | ||
| 23 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
| 24 | #include <linux/list.h> | 25 | #include <linux/list.h> |
| 25 | #include <linux/miscdevice.h> | 26 | #include <linux/miscdevice.h> |
| @@ -2140,13 +2141,13 @@ retry: | |||
| 2140 | if (!binder_has_proc_work(proc, thread)) | 2141 | if (!binder_has_proc_work(proc, thread)) |
| 2141 | ret = -EAGAIN; | 2142 | ret = -EAGAIN; |
| 2142 | } else | 2143 | } else |
| 2143 | ret = wait_event_interruptible_exclusive(proc->wait, binder_has_proc_work(proc, thread)); | 2144 | ret = wait_event_freezable_exclusive(proc->wait, binder_has_proc_work(proc, thread)); |
| 2144 | } else { | 2145 | } else { |
| 2145 | if (non_block) { | 2146 | if (non_block) { |
| 2146 | if (!binder_has_thread_work(thread)) | 2147 | if (!binder_has_thread_work(thread)) |
| 2147 | ret = -EAGAIN; | 2148 | ret = -EAGAIN; |
| 2148 | } else | 2149 | } else |
| 2149 | ret = wait_event_interruptible(thread->wait, binder_has_thread_work(thread)); | 2150 | ret = wait_event_freezable(thread->wait, binder_has_thread_work(thread)); |
| 2150 | } | 2151 | } |
| 2151 | 2152 | ||
| 2152 | binder_lock(__func__); | 2153 | binder_lock(__func__); |
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index bfbf4700d160..b70aa7c91394 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
| @@ -447,7 +447,7 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ) | |||
| 447 | { | 447 | { |
| 448 | int error; | 448 | int error; |
| 449 | 449 | ||
| 450 | error = wait_event_freezekillable(server->response_q, | 450 | error = wait_event_freezekillable_unsafe(server->response_q, |
| 451 | midQ->mid_state != MID_REQUEST_SUBMITTED); | 451 | midQ->mid_state != MID_REQUEST_SUBMITTED); |
| 452 | if (error < 0) | 452 | if (error < 0) |
| 453 | return -ERESTARTSYS; | 453 | return -ERESTARTSYS; |
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index deecc7294a67..0cff4434880d 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
| 35 | #include <linux/anon_inodes.h> | 35 | #include <linux/anon_inodes.h> |
| 36 | #include <linux/device.h> | 36 | #include <linux/device.h> |
| 37 | #include <linux/freezer.h> | ||
| 37 | #include <asm/uaccess.h> | 38 | #include <asm/uaccess.h> |
| 38 | #include <asm/io.h> | 39 | #include <asm/io.h> |
| 39 | #include <asm/mman.h> | 40 | #include <asm/mman.h> |
| @@ -1602,7 +1603,8 @@ fetch_events: | |||
| 1602 | } | 1603 | } |
| 1603 | 1604 | ||
| 1604 | spin_unlock_irqrestore(&ep->lock, flags); | 1605 | spin_unlock_irqrestore(&ep->lock, flags); |
| 1605 | if (!schedule_hrtimeout_range(to, slack, HRTIMER_MODE_ABS)) | 1606 | if (!freezable_schedule_hrtimeout_range(to, slack, |
| 1607 | HRTIMER_MODE_ABS)) | ||
| 1606 | timed_out = 1; | 1608 | timed_out = 1; |
| 1607 | 1609 | ||
| 1608 | spin_lock_irqsave(&ep->lock, flags); | 1610 | spin_lock_irqsave(&ep->lock, flags); |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index c1c7a9d78722..ce727047ee87 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
| @@ -79,7 +79,7 @@ int nfs_wait_bit_killable(void *word) | |||
| 79 | { | 79 | { |
| 80 | if (fatal_signal_pending(current)) | 80 | if (fatal_signal_pending(current)) |
| 81 | return -ERESTARTSYS; | 81 | return -ERESTARTSYS; |
| 82 | freezable_schedule(); | 82 | freezable_schedule_unsafe(); |
| 83 | return 0; | 83 | return 0; |
| 84 | } | 84 | } |
| 85 | EXPORT_SYMBOL_GPL(nfs_wait_bit_killable); | 85 | EXPORT_SYMBOL_GPL(nfs_wait_bit_killable); |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 43ea96ced28c..ce90eb4775c2 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
| @@ -33,7 +33,7 @@ nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) | |||
| 33 | res = rpc_call_sync(clnt, msg, flags); | 33 | res = rpc_call_sync(clnt, msg, flags); |
| 34 | if (res != -EJUKEBOX) | 34 | if (res != -EJUKEBOX) |
| 35 | break; | 35 | break; |
| 36 | freezable_schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME); | 36 | freezable_schedule_timeout_killable_unsafe(NFS_JUKEBOX_RETRY_TIME); |
| 37 | res = -ERESTARTSYS; | 37 | res = -ERESTARTSYS; |
| 38 | } while (!fatal_signal_pending(current)); | 38 | } while (!fatal_signal_pending(current)); |
| 39 | return res; | 39 | return res; |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index d7ba5616989c..28241a42f363 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -268,7 +268,7 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout) | |||
| 268 | *timeout = NFS4_POLL_RETRY_MIN; | 268 | *timeout = NFS4_POLL_RETRY_MIN; |
| 269 | if (*timeout > NFS4_POLL_RETRY_MAX) | 269 | if (*timeout > NFS4_POLL_RETRY_MAX) |
| 270 | *timeout = NFS4_POLL_RETRY_MAX; | 270 | *timeout = NFS4_POLL_RETRY_MAX; |
| 271 | freezable_schedule_timeout_killable(*timeout); | 271 | freezable_schedule_timeout_killable_unsafe(*timeout); |
| 272 | if (fatal_signal_pending(current)) | 272 | if (fatal_signal_pending(current)) |
| 273 | res = -ERESTARTSYS; | 273 | res = -ERESTARTSYS; |
| 274 | *timeout <<= 1; | 274 | *timeout <<= 1; |
| @@ -4528,7 +4528,7 @@ int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4 | |||
| 4528 | static unsigned long | 4528 | static unsigned long |
| 4529 | nfs4_set_lock_task_retry(unsigned long timeout) | 4529 | nfs4_set_lock_task_retry(unsigned long timeout) |
| 4530 | { | 4530 | { |
| 4531 | freezable_schedule_timeout_killable(timeout); | 4531 | freezable_schedule_timeout_killable_unsafe(timeout); |
| 4532 | timeout <<= 1; | 4532 | timeout <<= 1; |
| 4533 | if (timeout > NFS4_LOCK_MAXTIMEOUT) | 4533 | if (timeout > NFS4_LOCK_MAXTIMEOUT) |
| 4534 | return NFS4_LOCK_MAXTIMEOUT; | 4534 | return NFS4_LOCK_MAXTIMEOUT; |
diff --git a/fs/select.c b/fs/select.c index 8c1c96c27062..6b14dc7df3a4 100644 --- a/fs/select.c +++ b/fs/select.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/rcupdate.h> | 27 | #include <linux/rcupdate.h> |
| 28 | #include <linux/hrtimer.h> | 28 | #include <linux/hrtimer.h> |
| 29 | #include <linux/sched/rt.h> | 29 | #include <linux/sched/rt.h> |
| 30 | #include <linux/freezer.h> | ||
| 30 | 31 | ||
| 31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
| 32 | 33 | ||
| @@ -236,7 +237,8 @@ int poll_schedule_timeout(struct poll_wqueues *pwq, int state, | |||
| 236 | 237 | ||
| 237 | set_current_state(state); | 238 | set_current_state(state); |
| 238 | if (!pwq->triggered) | 239 | if (!pwq->triggered) |
| 239 | rc = schedule_hrtimeout_range(expires, slack, HRTIMER_MODE_ABS); | 240 | rc = freezable_schedule_hrtimeout_range(expires, slack, |
| 241 | HRTIMER_MODE_ABS); | ||
| 240 | __set_current_state(TASK_RUNNING); | 242 | __set_current_state(TASK_RUNNING); |
| 241 | 243 | ||
| 242 | /* | 244 | /* |
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 21ca773f77bf..822c1354f3a6 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
| @@ -51,7 +51,7 @@ struct task_struct; | |||
| 51 | extern void debug_show_all_locks(void); | 51 | extern void debug_show_all_locks(void); |
| 52 | extern void debug_show_held_locks(struct task_struct *task); | 52 | extern void debug_show_held_locks(struct task_struct *task); |
| 53 | extern void debug_check_no_locks_freed(const void *from, unsigned long len); | 53 | extern void debug_check_no_locks_freed(const void *from, unsigned long len); |
| 54 | extern void debug_check_no_locks_held(struct task_struct *task); | 54 | extern void debug_check_no_locks_held(void); |
| 55 | #else | 55 | #else |
| 56 | static inline void debug_show_all_locks(void) | 56 | static inline void debug_show_all_locks(void) |
| 57 | { | 57 | { |
| @@ -67,7 +67,7 @@ debug_check_no_locks_freed(const void *from, unsigned long len) | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | static inline void | 69 | static inline void |
| 70 | debug_check_no_locks_held(struct task_struct *task) | 70 | debug_check_no_locks_held(void) |
| 71 | { | ||
