diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-20 15:52:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-20 15:52:55 -0500 |
commit | 828cad8ea05d194d8a9452e0793261c2024c23a2 (patch) | |
tree | 0ad7c7e044cdcfe75d78da0b52eb2358d4686e02 /kernel/locking/mutex.c | |
parent | 60c906bab124a0627fba04c9ca5e61bba4747c0c (diff) | |
parent | bb3bac2ca9a3a5b7fa601781adf70167a0449d75 (diff) |
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler updates from Ingo Molnar:
"The main changes in this (fairly busy) cycle were:
- There was a class of scheduler bugs related to forgetting to update
the rq-clock timestamp which can cause weird and hard to debug
problems, so there's a new debug facility for this: which uncovered
a whole lot of bugs which convinced us that we want to keep the
debug facility.
(Peter Zijlstra, Matt Fleming)
- Various cputime related updates: eliminate cputime and use u64
nanoseconds directly, simplify and improve the arch interfaces,
implement delayed accounting more widely, etc. - (Frederic
Weisbecker)
- Move code around for better structure plus cleanups (Ingo Molnar)
- Move IO schedule accounting deeper into the scheduler plus related
changes to improve the situation (Tejun Heo)
- ... plus a round of sched/rt and sched/deadline fixes, plus other
fixes, updats and cleanups"
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (85 commits)
sched/core: Remove unlikely() annotation from sched_move_task()
sched/autogroup: Rename auto_group.[ch] to autogroup.[ch]
sched/topology: Split out scheduler topology code from core.c into topology.c
sched/core: Remove unnecessary #include headers
sched/rq_clock: Consolidate the ordering of the rq_clock methods
delayacct: Include <uapi/linux/taskstats.h>
sched/core: Clean up comments
sched/rt: Show the 'sched_rr_timeslice' SCHED_RR timeslice tuning knob in milliseconds
sched/clock: Add dummy clear_sched_clock_stable() stub function
sched/cputime: Remove generic asm headers
sched/cputime: Remove unused nsec_to_cputime()
s390, sched/cputime: Remove unused cputime definitions
powerpc, sched/cputime: Remove unused cputime definitions
s390, sched/cputime: Make arch_cpu_idle_time() to return nsecs
ia64, sched/cputime: Remove unused cputime definitions
ia64: Convert vtime to use nsec units directly
ia64, sched/cputime: Move the nsecs based cputime headers to the last arch using it
sched/cputime: Remove jiffies based cputime
sched/cputime, vtime: Return nsecs instead of cputime_t to account
sched/cputime: Complete nsec conversion of tick based accounting
...
Diffstat (limited to 'kernel/locking/mutex.c')
-rw-r--r-- | kernel/locking/mutex.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c index 9b349619f431..8464a5cbab97 100644 --- a/kernel/locking/mutex.c +++ b/kernel/locking/mutex.c | |||
@@ -783,6 +783,20 @@ mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass) | |||
783 | } | 783 | } |
784 | EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested); | 784 | EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested); |
785 | 785 | ||
786 | void __sched | ||
787 | mutex_lock_io_nested(struct mutex *lock, unsigned int subclass) | ||
788 | { | ||
789 | int token; | ||
790 | |||
791 | might_sleep(); | ||
792 | |||
793 | token = io_schedule_prepare(); | ||
794 | __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, | ||
795 | subclass, NULL, _RET_IP_, NULL, 0); | ||
796 | io_schedule_finish(token); | ||
797 | } | ||
798 | EXPORT_SYMBOL_GPL(mutex_lock_io_nested); | ||
799 | |||
786 | static inline int | 800 | static inline int |
787 | ww_mutex_deadlock_injection(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) | 801 | ww_mutex_deadlock_injection(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) |
788 | { | 802 | { |
@@ -950,6 +964,16 @@ int __sched mutex_lock_killable(struct mutex *lock) | |||
950 | } | 964 | } |
951 | EXPORT_SYMBOL(mutex_lock_killable); | 965 | EXPORT_SYMBOL(mutex_lock_killable); |
952 | 966 | ||
967 | void __sched mutex_lock_io(struct mutex *lock) | ||
968 | { | ||
969 | int token; | ||
970 | |||
971 | token = io_schedule_prepare(); | ||
972 | mutex_lock(lock); | ||
973 | io_schedule_finish(token); | ||
974 | } | ||
975 | EXPORT_SYMBOL_GPL(mutex_lock_io); | ||
976 | |||
953 | static noinline void __sched | 977 | static noinline void __sched |
954 | __mutex_lock_slowpath(struct mutex *lock) | 978 | __mutex_lock_slowpath(struct mutex *lock) |
955 | { | 979 | { |