Skip to content

Commit 27a3b73

Browse files
committed
Merge branches 'core-urgent-for-linus', 'perf-urgent-for-linus' and 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: debugobjects: Fix boot crash when kmemleak and debugobjects enabled * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: jump_label: Fix jump_label update for modules oprofile, x86: Fix race in nmi handler while starting counters * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sched: Disable (revert) SCHED_LOAD_SCALE increase sched, cgroups: Fix MIN_SHARES on 64-bit boxen
4 parents 85746e4 + 161b6ae + 140fe3b + e4c2fb0 commit 27a3b73

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

arch/x86/oprofile/nmi_int.c

+10-4
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ static void nmi_cpu_start(void *dummy)
112112
static int nmi_start(void)
113113
{
114114
get_online_cpus();
115-
on_each_cpu(nmi_cpu_start, NULL, 1);
116115
ctr_running = 1;
116+
/* make ctr_running visible to the nmi handler: */
117+
smp_mb();
118+
on_each_cpu(nmi_cpu_start, NULL, 1);
117119
put_online_cpus();
118120
return 0;
119121
}
@@ -504,15 +506,18 @@ static int nmi_setup(void)
504506

505507
nmi_enabled = 0;
506508
ctr_running = 0;
507-
barrier();
509+
/* make variables visible to the nmi handler: */
510+
smp_mb();
508511
err = register_die_notifier(&profile_exceptions_nb);
509512
if (err)
510513
goto fail;
511514

512515
get_online_cpus();
513516
register_cpu_notifier(&oprofile_cpu_nb);
514-
on_each_cpu(nmi_cpu_setup, NULL, 1);
515517
nmi_enabled = 1;
518+
/* make nmi_enabled visible to the nmi handler: */
519+
smp_mb();
520+
on_each_cpu(nmi_cpu_setup, NULL, 1);
516521
put_online_cpus();
517522

518523
return 0;
@@ -531,7 +536,8 @@ static void nmi_shutdown(void)
531536
nmi_enabled = 0;
532537
ctr_running = 0;
533538
put_online_cpus();
534-
barrier();
539+
/* make variables visible to the nmi handler: */
540+
smp_mb();
535541
unregister_die_notifier(&profile_exceptions_nb);
536542
msrs = &get_cpu_var(cpu_msrs);
537543
model->shutdown(msrs);

include/linux/sched.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ enum cpu_idle_type {
808808
* when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the
809809
* increased costs.
810810
*/
811-
#if BITS_PER_LONG > 32
811+
#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load */
812812
# define SCHED_LOAD_RESOLUTION 10
813813
# define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION)
814814
# define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION)

kernel/jump_label.c

+9-5
Original file line numberDiff line numberDiff line change
@@ -375,15 +375,19 @@ int jump_label_text_reserved(void *start, void *end)
375375

376376
static void jump_label_update(struct jump_label_key *key, int enable)
377377
{
378-
struct jump_entry *entry = key->entries;
379-
380-
/* if there are no users, entry can be NULL */
381-
if (entry)
382-
__jump_label_update(key, entry, __stop___jump_table, enable);
378+
struct jump_entry *entry = key->entries, *stop = __stop___jump_table;
383379

384380
#ifdef CONFIG_MODULES
381+
struct module *mod = __module_address((jump_label_t)key);
382+
385383
__jump_label_mod_update(key, enable);
384+
385+
if (mod)
386+
stop = mod->jump_entries + mod->num_jump_entries;
386387
#endif
388+
/* if there are no users, entry can be NULL */
389+
if (entry)
390+
__jump_label_update(key, entry, stop, enable);
387391
}
388392

389393
#endif

kernel/sched.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ static DEFINE_SPINLOCK(task_group_lock);
292292
* (The default weight is 1024 - so there's no practical
293293
* limitation from this.)
294294
*/
295-
#define MIN_SHARES 2
296-
#define MAX_SHARES (1UL << (18 + SCHED_LOAD_RESOLUTION))
295+
#define MIN_SHARES (1UL << 1)
296+
#define MAX_SHARES (1UL << 18)
297297

298298
static int root_task_group_load = ROOT_TASK_GROUP_LOAD;
299299
#endif
@@ -8450,10 +8450,7 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
84508450
if (!tg->se[0])
84518451
return -EINVAL;
84528452

8453-
if (shares < MIN_SHARES)
8454-
shares = MIN_SHARES;
8455-
else if (shares > MAX_SHARES)
8456-
shares = MAX_SHARES;
8453+
shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES));
84578454

84588455
mutex_lock(&shares_mutex);
84598456
if (tg->shares == shares)

lib/debugobjects.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static void free_object(struct debug_obj *obj)
198198
* initialized:
199199
*/
200200
if (obj_pool_free > ODEBUG_POOL_SIZE && obj_cache)
201-
sched = !work_pending(&debug_obj_work);
201+
sched = keventd_up() && !work_pending(&debug_obj_work);
202202
hlist_add_head(&obj->node, &obj_pool);
203203
obj_pool_free++;
204204
obj_pool_used--;

0 commit comments

Comments
 (0)