diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-06-17 07:06:17 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-06-17 07:06:17 -0400 |
| commit | a3d06cc6aa3e765dc2bf98626f87272dcf641dca (patch) | |
| tree | aa3e49b58f08d6c0ea55cdca4fb5e6c8ba6ae333 /kernel | |
| parent | 0990b1c65729012a63e0eeca93aaaafea4e9a064 (diff) | |
| parent | 65795efbd380a832ae508b04dba8f8e53f0b84d9 (diff) | |
Merge branch 'linus' into perfcounters/core
Conflicts:
arch/x86/include/asm/kmap_types.h
include/linux/mm.h
include/asm-generic/kmap_types.h
Merge reason: We crossed changes with kmap_types.h cleanups in mainline.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/Makefile | 1 | ||||
| -rw-r--r-- | kernel/cpuset.c | 260 | ||||
| -rw-r--r-- | kernel/fork.c | 14 | ||||
| -rw-r--r-- | kernel/groups.c | 288 | ||||
| -rw-r--r-- | kernel/hrtimer.c | 58 | ||||
| -rw-r--r-- | kernel/kallsyms.c | 134 | ||||
| -rw-r--r-- | kernel/kfifo.c | 4 | ||||
| -rw-r--r-- | kernel/kthread.c | 2 | ||||
| -rw-r--r-- | kernel/module.c | 2 | ||||
| -rw-r--r-- | kernel/power/poweroff.c | 2 | ||||
| -rw-r--r-- | kernel/power/process.c | 5 | ||||
| -rw-r--r-- | kernel/printk.c | 33 | ||||
| -rw-r--r-- | kernel/profile.c | 8 | ||||
| -rw-r--r-- | kernel/rtmutex.c | 2 | ||||
| -rw-r--r-- | kernel/sched.c | 11 | ||||
| -rw-r--r-- | kernel/signal.c | 11 | ||||
| -rw-r--r-- | kernel/slow-work.c | 23 | ||||
| -rw-r--r-- | kernel/softirq.c | 11 | ||||
| -rw-r--r-- | kernel/sys.c | 283 | ||||
| -rw-r--r-- | kernel/sysctl.c | 22 | ||||
| -rw-r--r-- | kernel/time/clockevents.c | 14 | ||||
| -rw-r--r-- | kernel/time/clocksource.c | 20 | ||||
| -rw-r--r-- | kernel/time/tick-broadcast.c | 2 | ||||
| -rw-r--r-- | kernel/time/tick-oneshot.c | 17 | ||||
| -rw-r--r-- | kernel/time/tick-sched.c | 7 | ||||
| -rw-r--r-- | kernel/timer.c | 52 | ||||
| -rw-r--r-- | kernel/trace/Kconfig | 10 | ||||
| -rw-r--r-- | kernel/trace/ring_buffer.c | 3 | ||||
| -rw-r--r-- | kernel/trace/trace.c | 23 | ||||
| -rw-r--r-- | kernel/trace/trace_sysprof.c | 3 | ||||
| -rw-r--r-- | kernel/user.c | 67 |
31 files changed, 804 insertions, 588 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index 90b53f6dc22..9df4501cb92 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
| @@ -11,6 +11,7 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ | |||
| 11 | hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \ | 11 | hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \ |
| 12 | notifier.o ksysfs.o pm_qos_params.o sched_clock.o cred.o \ | 12 | notifier.o ksysfs.o pm_qos_params.o sched_clock.o cred.o \ |
| 13 | async.o | 13 | async.o |
| 14 | obj-y += groups.o | ||
| 14 | 15 | ||
| 15 | ifdef CONFIG_FUNCTION_TRACER | 16 | ifdef CONFIG_FUNCTION_TRACER |
| 16 | # Do not trace debug files and internal ftrace files | 17 | # Do not trace debug files and internal ftrace files |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index d5a7e17474e..7e75a41bd50 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
| @@ -97,12 +97,6 @@ struct cpuset { | |||
| 97 | 97 | ||
| 98 | struct cpuset *parent; /* my parent */ | 98 | struct cpuset *parent; /* my parent */ |
| 99 | 99 | ||
| 100 | /* | ||
| 101 | * Copy of global cpuset_mems_generation as of the most | ||
| 102 | * recent time this cpuset changed its mems_allowed. | ||
| 103 | */ | ||
| 104 | int mems_generation; | ||
| 105 | |||
| 106 | struct fmeter fmeter; /* memory_pressure filter */ | 100 | struct fmeter fmeter; /* memory_pressure filter */ |
| 107 | 101 | ||
| 108 | /* partition number for rebuild_sched_domains() */ | 102 | /* partition number for rebuild_sched_domains() */ |
| @@ -176,27 +170,6 @@ static inline int is_spread_slab(const struct cpuset *cs) | |||
| 176 | return test_bit(CS_SPREAD_SLAB, &cs->flags); | 170 | return test_bit(CS_SPREAD_SLAB, &cs->flags); |
| 177 | } | 171 | } |
| 178 | 172 | ||
| 179 | /* | ||
| 180 | * Increment this integer everytime any cpuset changes its | ||
| 181 | * mems_allowed value. Users of cpusets can track this generation | ||
| 182 | * number, and avoid having to lock and reload mems_allowed unless | ||
| 183 | * the cpuset they're using changes generation. | ||
| 184 | * | ||
| 185 | * A single, global generation is needed because cpuset_attach_task() could | ||
| 186 | * reattach a task to a different cpuset, which must not have its | ||
| 187 | * generation numbers aliased with those of that tasks previous cpuset. | ||
| 188 | * | ||
| 189 | * Generations are needed for mems_allowed because one task cannot | ||
| 190 | * modify another's memory placement. So we must enable every task, | ||
| 191 | * on every visit to __alloc_pages(), to efficiently check whether | ||
| 192 | * its current->cpuset->mems_allowed has changed, requiring an update | ||
| 193 | * of its current->mems_allowed. | ||
| 194 | * | ||
| 195 | * Since writes to cpuset_mems_generation are guarded by the cgroup lock | ||
| 196 | * there is no need to mark it atomic. | ||
| 197 | */ | ||
| 198 | static int cpuset_mems_generation; | ||
| 199 | |||
| 200 | static struct cpuset top_cpuset = { | 173 | static struct cpuset top_cpuset = { |
| 201 | .flags = ((1 << CS_CPU_EXCLUSIVE) | (1 << CS_MEM_EXCLUSIVE)), | 174 | .flags = ((1 << CS_CPU_EXCLUSIVE) | (1 << CS_MEM_EXCLUSIVE)), |
| 202 | }; | 175 | }; |
| @@ -228,8 +201,9 @@ static struct cpuset top_cpuset = { | |||
| 228 | * If a task is only holding callback_mutex, then it has read-only | 201 | * If a task is only holding callback_mutex, then it has read-only |
| 229 | * access to cpusets. | 202 | * access to cpusets. |
| 230 | * | 203 | * |
| 231 | * The task_struct fields mems_allowed and mems_generation may only | 204 | * Now, the task_struct fields mems_allowed and mempolicy may be changed |
| 232 | * be accessed in the context of that task, so require no locks. | 205 | * by other task, we use alloc_lock in the task_struct fields to protect |
| 206 | * them. | ||
| 233 | * | 207 | * |
| 234 | * The cpuset_common_file_read() handlers only hold callback_mutex across | 208 | * The cpuset_common_file_read() handlers only hold callback_mutex across |
| 235 | * small pieces of code, such as when reading out possibly multi-word | 209 | * small pieces of code, such as when reading out possibly multi-word |
| @@ -331,75 +305,22 @@ static void guarantee_online_mems(const struct cpuset *cs, nodemask_t *pmask) | |||
| 331 | BUG_ON(!nodes_intersects(*pmask, node_states[N_HIGH_MEMORY])); | 305 | BUG_ON(!nodes_intersects(*pmask, node_states[N_HIGH_MEMORY])); |
| 332 | } | 306 | } |
| 333 | 307 | ||
| 334 | /** | 308 | /* |
| 335 | * cpuset_update_task_memory_state - update task memory placement | 309 | * update task's spread flag if cpuset's page/slab spread flag is set |
| 336 | * | 310 | * |
| 337 | * If the current tasks cpusets mems_allowed changed behind our | 311 | * Called with callback_mutex/cgroup_mutex held |
| 338 | * backs, update current->mems_allowed, mems_generation and task NUMA | ||
| 339 | * mempolicy to the new value. | ||
| 340 | * | ||
| 341 | * Task mempolicy is updated by rebinding it relative to the | ||
| 342 | * current->cpuset if a task has its memory placement changed. | ||
| 343 | * Do not call this routine if in_interrupt(). | ||
| 344 | * | ||
| 345 | * Call without callback_mutex or task_lock() held. May be | ||
| 346 | * called with or without cgroup_mutex held. Thanks in part to | ||
| 347 | * 'the_top_cpuset_hack', the task's cpuset pointer will never | ||
| 348 | * be NULL. This routine also might acquire callback_mutex during | ||
| 349 | * call. | ||
| 350 | * | ||
| 351 | * Reading current->cpuset->mems_generation doesn't need task_lock | ||
| 352 | * to guard the current->cpuset derefence, because it is guarded | ||
| 353 | * from concurrent freeing of current->cpuset using RCU. | ||
| 354 | * | ||
| 355 | * The rcu_dereference() is technically probably not needed, | ||
| 356 | * as I don't actually mind if I see a new cpuset pointer but | ||
| 357 | * an old value of mems_generation. However this really only | ||
| 358 | * matters on alpha systems using cpusets heavily. If I dropped | ||
| 359 | * that rcu_dereference(), it would save them a memory barrier. | ||
| 360 | * For all other arch's, rcu_dereference is a no-op anyway, and for | ||
| 361 | * alpha systems not using cpusets, another planned optimization, | ||
| 362 | * avoiding the rcu critical section for tasks in the root cpuset | ||
| 363 | * which is statically allocated, so can't vanish, will make this | ||
| 364 | * irrelevant. Better to use RCU as intended, than to engage in | ||
| 365 | * some cute trick to save a memory barrier that is impossible to | ||
| 366 | * test, for alpha systems using cpusets heavily, which might not | ||
| 367 | * even exist. | ||
| 368 | * | ||
| 369 | * This routine is needed to update the per-task mems_allowed data, | ||
| 370 | * within the tasks context, when it is trying to allocate memory | ||
| 371 | * (in various mm/mempolicy.c routines) and notices that some other | ||
| 372 | * task has been modifying its cpuset. | ||
| 373 | */ | 312 | */ |
| 374 | 313 | static void cpuset_update_task_spread_flag(struct cpuset *cs, | |
| 375 | void cpuset_update_task_memory_state(void) | 314 | struct task_struct *tsk) |
| 376 | { | 315 | { |
| 377 | int my_cpusets_mem_gen; | 316 | if (is_spread_page(cs)) |
| 378 | struct task_struct *tsk = current; | 317 | tsk->flags |= PF_SPREAD_PAGE; |
| 379 | struct cpuset *cs; | 318 | else |
| 380 | 319 | tsk->flags &= ~PF_SPREAD_PAGE; | |
| 381 | rcu_read_lock(); | 320 | if (is_spread_slab(cs)) |
| 382 | my_cpusets_mem_gen = task_cs(tsk)->mems_generation; | 321 | tsk->flags |= PF_SPREAD_SLAB; |
| 383 | rcu_read_unlock(); | 322 | else |
| 384 | 323 | tsk->flags &= ~PF_SPREAD_SLAB; | |
| 385 | if (my_cpusets_mem_gen != tsk->cpuset_mems_generation) { | ||
| 386 | mutex_lock(&callback_mutex); | ||
| 387 | task_lock(tsk); | ||
| 388 | cs = task_cs(tsk); /* Maybe changed when task not locked */ | ||
| 389 | guarantee_online_mems(cs, &tsk->mems_allowed); | ||
| 390 | tsk->cpuset_mems_generation = cs->mems_generation; | ||
| 391 | if (is_spread_page(cs)) | ||
| 392 | tsk->flags |= PF_SPREAD_PAGE; | ||
| 393 | else | ||
| 394 | tsk->flags &= ~PF_SPREAD_PAGE; | ||
| 395 | if (is_spread_slab(cs)) | ||
| 396 | tsk->flags |= PF_SPREAD_SLAB; | ||
| 397 | else | ||
| 398 | tsk->flags &= ~PF_SPREAD_SLAB; | ||
| 399 | task_unlock(tsk); | ||
| 400 | mutex_unlock(&callback_mutex); | ||
| 401 | mpol_rebind_task(tsk, &tsk->mems_allowed); | ||
| 402 | } | ||
| 403 | } | 324 | } |
| 404 | 325 | ||
| 405 | /* | 326 | /* |
| @@ -1007,14 +928,6 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, | |||
| 1007 | * other task, the task_struct mems_allowed that we are hacking | 928 | * other task, the task_struct mems_allowed that we are hacking |
| 1008 | * is for our current task, which must allocate new pages for that | ||
