diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 23 | ||||
-rw-r--r-- | kernel/sched.c | 4 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 16 |
3 files changed, 25 insertions, 18 deletions
diff --git a/kernel/module.c b/kernel/module.c index 8c6b42840dd1..5d2d28197c82 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2062,6 +2062,12 @@ static void dynamic_debug_setup(struct _ddebug *debug, unsigned int num) | |||
2062 | #endif | 2062 | #endif |
2063 | } | 2063 | } |
2064 | 2064 | ||
2065 | static void dynamic_debug_remove(struct _ddebug *debug) | ||
2066 | { | ||
2067 | if (debug) | ||
2068 | ddebug_remove_module(debug->modname); | ||
2069 | } | ||
2070 | |||
2065 | static void *module_alloc_update_bounds(unsigned long size) | 2071 | static void *module_alloc_update_bounds(unsigned long size) |
2066 | { | 2072 | { |
2067 | void *ret = module_alloc(size); | 2073 | void *ret = module_alloc(size); |
@@ -2124,6 +2130,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2124 | void *ptr = NULL; /* Stops spurious gcc warning */ | 2130 | void *ptr = NULL; /* Stops spurious gcc warning */ |
2125 | unsigned long symoffs, stroffs, *strmap; | 2131 | unsigned long symoffs, stroffs, *strmap; |
2126 | void __percpu *percpu; | 2132 | void __percpu *percpu; |
2133 | struct _ddebug *debug = NULL; | ||
2134 | unsigned int num_debug = 0; | ||
2127 | 2135 | ||
2128 | mm_segment_t old_fs; | 2136 | mm_segment_t old_fs; |
2129 | 2137 | ||
@@ -2476,15 +2484,9 @@ static noinline struct module *load_module(void __user *umod, | |||
2476 | kfree(strmap); | 2484 | kfree(strmap); |
2477 | strmap = NULL; | 2485 | strmap = NULL; |
2478 | 2486 | ||
2479 | if (!mod->taints) { | 2487 | if (!mod->taints) |
2480 | struct _ddebug *debug; | ||
2481 | unsigned int num_debug; | ||
2482 | |||
2483 | debug = section_objs(hdr, sechdrs, secstrings, "__verbose", | 2488 | debug = section_objs(hdr, sechdrs, secstrings, "__verbose", |
2484 | sizeof(*debug), &num_debug); | 2489 | sizeof(*debug), &num_debug); |
2485 | if (debug) | ||
2486 | dynamic_debug_setup(debug, num_debug); | ||
2487 | } | ||
2488 | 2490 | ||
2489 | err = module_finalize(hdr, sechdrs, mod); | 2491 | err = module_finalize(hdr, sechdrs, mod); |
2490 | if (err < 0) | 2492 | if (err < 0) |
@@ -2526,10 +2528,13 @@ static noinline struct module *load_module(void __user *umod, | |||
2526 | goto unlock; | 2528 | goto unlock; |
2527 | } | 2529 | } |
2528 | 2530 | ||
2531 | if (debug) | ||
2532 | dynamic_debug_setup(debug, num_debug); | ||
2533 | |||
2529 | /* Find duplicate symbols */ | 2534 | /* Find duplicate symbols */ |
2530 | err = verify_export_symbols(mod); | 2535 | err = verify_export_symbols(mod); |
2531 | if (err < 0) | 2536 | if (err < 0) |
2532 | goto unlock; | 2537 | goto ddebug; |
2533 | 2538 | ||
2534 | list_add_rcu(&mod->list, &modules); | 2539 | list_add_rcu(&mod->list, &modules); |
2535 | mutex_unlock(&module_mutex); | 2540 | mutex_unlock(&module_mutex); |
@@ -2557,6 +2562,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2557 | mutex_lock(&module_mutex); | 2562 | mutex_lock(&module_mutex); |
2558 | /* Unlink carefully: kallsyms could be walking list. */ | 2563 | /* Unlink carefully: kallsyms could be walking list. */ |
2559 | list_del_rcu(&mod->list); | 2564 | list_del_rcu(&mod->list); |
2565 | ddebug: | ||
2566 | dynamic_debug_remove(debug); | ||
2560 | unlock: | 2567 | unlock: |
2561 | mutex_unlock(&module_mutex); | 2568 | mutex_unlock(&module_mutex); |
2562 | synchronize_sched(); | 2569 | synchronize_sched(); |
diff --git a/kernel/sched.c b/kernel/sched.c index cb816e36cc8b..f52a8801b7a2 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2873,9 +2873,9 @@ unsigned long nr_iowait(void) | |||
2873 | return sum; | 2873 | return sum; |
2874 | } | 2874 | } |
2875 | 2875 | ||
2876 | unsigned long nr_iowait_cpu(void) | 2876 | unsigned long nr_iowait_cpu(int cpu) |
2877 | { | 2877 | { |
2878 | struct rq *this = this_rq(); | 2878 | struct rq *this = cpu_rq(cpu); |
2879 | return atomic_read(&this->nr_iowait); | 2879 | return atomic_read(&this->nr_iowait); |
2880 | } | 2880 | } |
2881 | 2881 | ||
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 783fbadf2202..813993b5fb61 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -154,14 +154,14 @@ static void tick_nohz_update_jiffies(ktime_t now) | |||
154 | * Updates the per cpu time idle statistics counters | 154 | * Updates the per cpu time idle statistics counters |
155 | */ | 155 | */ |
156 | static void | 156 | static void |
157 | update_ts_time_stats(struct tick_sched *ts, ktime_t now, u64 *last_update_time) | 157 | update_ts_time_stats(int cpu, struct tick_sched *ts, ktime_t now, u64 *last_update_time) |
158 | { | 158 | { |
159 | ktime_t delta; | 159 | ktime_t delta; |
160 | 160 | ||
161 | if (ts->idle_active) { | 161 | if (ts->idle_active) { |
162 | delta = ktime_sub(now, ts->idle_entrytime); | 162 | delta = ktime_sub(now, ts->idle_entrytime); |
163 | ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); | 163 | ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); |
164 | if (nr_iowait_cpu() > 0) | 164 | if (nr_iowait_cpu(cpu) > 0) |
165 | ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime, delta); | 165 | ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime, delta); |
166 | ts->idle_entrytime = now; | 166 | ts->idle_entrytime = now; |
167 | } | 167 | } |
@@ -175,19 +175,19 @@ static void tick_nohz_stop_idle(int cpu, ktime_t now) | |||
175 | { | 175 | { |
176 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); | 176 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); |
177 | 177 | ||
178 | update_ts_time_stats(ts, now, NULL); | 178 | update_ts_time_stats(cpu, ts, now, NULL); |
179 | ts->idle_active = 0; | 179 | ts->idle_active = 0; |
180 | 180 | ||
181 | sched_clock_idle_wakeup_event(0); | 181 | sched_clock_idle_wakeup_event(0); |
182 | } | 182 | } |
183 | 183 | ||
184 | static ktime_t tick_nohz_start_idle(struct tick_sched *ts) | 184 | static ktime_t tick_nohz_start_idle(int cpu, struct tick_sched *ts) |
185 | { | 185 | { |
186 | ktime_t now; | 186 | ktime_t now; |
187 | 187 | ||
188 | now = ktime_get(); | 188 | now = ktime_get(); |
189 | 189 | ||
190 | update_ts_time_stats(ts, now, NULL); | 190 | update_ts_time_stats(cpu, ts, now, NULL); |
191 | 191 | ||
192 | ts->idle_entrytime = now; | 192 | ts->idle_entrytime = now; |
193 | ts->idle_active = 1; | 193 | ts->idle_active = 1; |
@@ -216,7 +216,7 @@ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time) | |||
216 | if (!tick_nohz_enabled) | 216 | if (!tick_nohz_enabled) |
217 | return -1; | 217 | return -1; |
218 | 218 | ||
219 | update_ts_time_stats(ts, ktime_get(), last_update_time); | 219 | update_ts_time_stats(cpu, ts, ktime_get(), last_update_time); |
220 | 220 | ||
221 | return ktime_to_us(ts->idle_sleeptime); | 221 | return ktime_to_us(ts->idle_sleeptime); |
222 | } | 222 | } |
@@ -242,7 +242,7 @@ u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time) | |||
242 | if (!tick_nohz_enabled) | 242 | if (!tick_nohz_enabled) |
243 | return -1; | 243 | return -1; |
244 | 244 | ||
245 | update_ts_time_stats(ts, ktime_get(), last_update_time); | 245 | update_ts_time_stats(cpu, ts, ktime_get(), last_update_time); |
246 | 246 | ||
247 | return ktime_to_us(ts->iowait_sleeptime); | 247 | return ktime_to_us(ts->iowait_sleeptime); |
248 | } | 248 | } |
@@ -284,7 +284,7 @@ void tick_nohz_stop_sched_tick(int inidle) | |||
284 | */ | 284 | */ |
285 | ts->inidle = 1; | 285 | ts->inidle = 1; |
286 | 286 | ||
287 | now = tick_nohz_start_idle(ts); | 287 | now = tick_nohz_start_idle(cpu, ts); |
288 | 288 | ||
289 | /* | 289 | /* |
290 | * If this cpu is offline and it is the one which updates | 290 | * If this cpu is offline and it is the one which updates |