Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Ingo Molnar:
"Two fixes: tighten up a jump-labels warning to not trigger on certain
modules and fix confusing (and non-existent) mutex API documentation"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
jump_label: Disable jump labels in __exit code
locking/mutex: Improve documentation

+37 -13
+2 -2
include/linux/jump_label.h
··· 151 151 extern struct jump_entry __stop___jump_table[]; 152 152 153 153 extern void jump_label_init(void); 154 - extern void jump_label_invalidate_init(void); 154 + extern void jump_label_invalidate_initmem(void); 155 155 extern void jump_label_lock(void); 156 156 extern void jump_label_unlock(void); 157 157 extern void arch_jump_label_transform(struct jump_entry *entry, ··· 199 199 static_key_initialized = true; 200 200 } 201 201 202 - static inline void jump_label_invalidate_init(void) {} 202 + static inline void jump_label_invalidate_initmem(void) {} 203 203 204 204 static __always_inline bool static_key_false(struct static_key *key) 205 205 {
+1 -1
init/main.c
··· 1001 1001 /* need to finish all async __init code before freeing the memory */ 1002 1002 async_synchronize_full(); 1003 1003 ftrace_free_init_mem(); 1004 - jump_label_invalidate_init(); 1004 + jump_label_invalidate_initmem(); 1005 1005 free_initmem(); 1006 1006 mark_readonly(); 1007 1007 system_state = SYSTEM_RUNNING;
+4 -3
kernel/jump_label.c
··· 16 16 #include <linux/jump_label_ratelimit.h> 17 17 #include <linux/bug.h> 18 18 #include <linux/cpu.h> 19 + #include <asm/sections.h> 19 20 20 21 #ifdef HAVE_JUMP_LABEL 21 22 ··· 422 421 cpus_read_unlock(); 423 422 } 424 423 425 - /* Disable any jump label entries in __init code */ 426 - void __init jump_label_invalidate_init(void) 424 + /* Disable any jump label entries in __init/__exit code */ 425 + void __init jump_label_invalidate_initmem(void) 427 426 { 428 427 struct jump_entry *iter_start = __start___jump_table; 429 428 struct jump_entry *iter_stop = __stop___jump_table; 430 429 struct jump_entry *iter; 431 430 432 431 for (iter = iter_start; iter < iter_stop; iter++) { 433 - if (init_kernel_text(iter->code)) 432 + if (init_section_contains((void *)(unsigned long)iter->code, 1)) 434 433 iter->code = 0; 435 434 } 436 435 }
+30 -7
kernel/locking/mutex.c
··· 1082 1082 __mutex_lock_interruptible_slowpath(struct mutex *lock); 1083 1083 1084 1084 /** 1085 - * mutex_lock_interruptible - acquire the mutex, interruptible 1086 - * @lock: the mutex to be acquired 1085 + * mutex_lock_interruptible() - Acquire the mutex, interruptible by signals. 1086 + * @lock: The mutex to be acquired. 1087 1087 * 1088 - * Lock the mutex like mutex_lock(), and return 0 if the mutex has 1089 - * been acquired or sleep until the mutex becomes available. If a 1090 - * signal arrives while waiting for the lock then this function 1091 - * returns -EINTR. 1088 + * Lock the mutex like mutex_lock(). If a signal is delivered while the 1089 + * process is sleeping, this function will return without acquiring the 1090 + * mutex. 1092 1091 * 1093 - * This function is similar to (but not equivalent to) down_interruptible(). 1092 + * Context: Process context. 1093 + * Return: 0 if the lock was successfully acquired or %-EINTR if a 1094 + * signal arrived. 1094 1095 */ 1095 1096 int __sched mutex_lock_interruptible(struct mutex *lock) 1096 1097 { ··· 1105 1104 1106 1105 EXPORT_SYMBOL(mutex_lock_interruptible); 1107 1106 1107 + /** 1108 + * mutex_lock_killable() - Acquire the mutex, interruptible by fatal signals. 1109 + * @lock: The mutex to be acquired. 1110 + * 1111 + * Lock the mutex like mutex_lock(). If a signal which will be fatal to 1112 + * the current process is delivered while the process is sleeping, this 1113 + * function will return without acquiring the mutex. 1114 + * 1115 + * Context: Process context. 1116 + * Return: 0 if the lock was successfully acquired or %-EINTR if a 1117 + * fatal signal arrived. 1118 + */ 1108 1119 int __sched mutex_lock_killable(struct mutex *lock) 1109 1120 { 1110 1121 might_sleep(); ··· 1128 1115 } 1129 1116 EXPORT_SYMBOL(mutex_lock_killable); 1130 1117 1118 + /** 1119 + * mutex_lock_io() - Acquire the mutex and mark the process as waiting for I/O 1120 + * @lock: The mutex to be acquired. 1121 + * 1122 + * Lock the mutex like mutex_lock(). While the task is waiting for this 1123 + * mutex, it will be accounted as being in the IO wait state by the 1124 + * scheduler. 1125 + * 1126 + * Context: Process context. 1127 + */ 1131 1128 void __sched mutex_lock_io(struct mutex *lock) 1132 1129 { 1133 1130 int token;