Index: linux-2.6.30-bfs/include/linux/sched.h =================================================================== --- linux-2.6.30-bfs.orig/include/linux/sched.h 2009-09-03 20:15:35.649305458 +1000 +++ linux-2.6.30-bfs/include/linux/sched.h 2009-09-03 20:32:54.830303876 +1000 @@ -2140,10 +2140,7 @@ return task_thread_info(p)->cpu; } -static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) -{ - task_thread_info(p)->cpu = cpu; -} +extern void set_task_cpu(struct task_struct *p, unsigned int cpu); #else Index: linux-2.6.30-bfs/kernel/sched_bfs.c =================================================================== --- linux-2.6.30-bfs.orig/kernel/sched_bfs.c 2009-09-03 20:12:55.924303703 +1000 +++ linux-2.6.30-bfs/kernel/sched_bfs.c 2009-09-03 20:49:52.036428536 +1000 @@ -642,6 +642,20 @@ grq.nr_running--; } +#ifdef CONFIG_SMP +void set_task_cpu(struct task_struct *p, unsigned int cpu) +{ + trace_sched_migrate_task(p, task_cpu(p), cpu); + /* + * After ->cpu is set up to a new value, task_grq_lock(p, ...) can be + * successfuly executed on another CPU. We must ensure that updates of + * per-task data have been completed by this moment. + */ + smp_wmb(); + task_thread_info(p)->cpu = cpu; +} +#endif + /* * Move a task off the global queue and take it to a cpu for it will * become the running task. @@ -973,6 +987,7 @@ success = 1; out_running: + trace_sched_wakeup(rq, p, success); p->state = TASK_RUNNING; out_unlock: task_grq_unlock(&flags); @@ -1074,6 +1089,7 @@ set_task_cpu(p, task_cpu(parent)); activate_task(p); + trace_sched_wakeup_new(rq, p, 1); if (!(clone_flags & CLONE_VM) && rq->curr == parent) { /* * The VM isn't cloned, so we're in a good position to @@ -1274,6 +1290,7 @@ struct mm_struct *mm, *oldmm; prepare_task_switch(rq, prev, next); + trace_sched_switch(rq, prev, next); mm = next->mm; oldmm = prev->active_mm; /* @@ -3574,6 +3591,7 @@ #else task_thread_info(idle)->preempt_count = 0; #endif + ftrace_graph_init_task(idle); } /* Index: linux-2.6.30-bfs/init/Kconfig =================================================================== --- linux-2.6.30-bfs.orig/init/Kconfig 2009-09-03 20:51:35.288429062 +1000 +++ linux-2.6.30-bfs/init/Kconfig 2009-09-03 20:54:26.497428689 +1000 @@ -435,6 +435,120 @@ config HAVE_UNSTABLE_SCHED_CLOCK bool +menuconfig CGROUPS + boolean "Control Group support" + help + This option adds support for grouping sets of processes together, for + use with process control subsystems such as Cpusets, memory + controls or device isolation. + See + - Documentation/cgroups/ (features for grouping, isolation + and resource control) + + Say N if unsure. + +if CGROUPS + +config CGROUP_DEBUG + bool "Example debug cgroup subsystem" + depends on CGROUPS + default n + help + This option enables a simple cgroup subsystem that + exports useful debugging information about the cgroups + framework. + + Say N if unsure. + +config CGROUP_NS + bool "Namespace cgroup subsystem" + depends on CGROUPS + help + Provides a simple namespace cgroup subsystem to + provide hierarchical naming of sets of namespaces, + for instance virtual servers and checkpoint/restart + jobs. + +config CGROUP_FREEZER + bool "Freezer cgroup subsystem" + depends on CGROUPS + help + Provides a way to freeze and unfreeze all tasks in a + cgroup. + +config CGROUP_DEVICE + bool "Device controller for cgroups" + depends on CGROUPS && EXPERIMENTAL + help + Provides a cgroup implementing whitelists for devices which + a process in the cgroup can mknod or open. + +config CPUSETS + bool "Cpuset support" + depends on CGROUPS + help + This option will let you create and manage CPUSETs which + allow dynamically partitioning a system into sets of CPUs and + Memory Nodes and assigning tasks to run only within those sets. + This is primarily useful on large SMP or NUMA systems. + + Say N if unsure. + +config PROC_PID_CPUSET + bool "Include legacy /proc//cpuset file" + depends on CPUSETS + default y + +config RESOURCE_COUNTERS + bool "Resource counters" + help + This option enables controller independent resource accounting + infrastructure that works with cgroups. + depends on CGROUPS + +config CGROUP_MEM_RES_CTLR + bool "Memory Resource Controller for Control Groups" + depends on CGROUPS && RESOURCE_COUNTERS + select MM_OWNER + help + Provides a memory resource controller that manages both anonymous + memory and page cache. (See Documentation/cgroups/memory.txt) + + Note that setting this option increases fixed memory overhead + associated with each page of memory in the system. By this, + 20(40)bytes/PAGE_SIZE on 32(64)bit system will be occupied by memory + usage tracking struct at boot. Total amount of this is printed out + at boot. + + Only enable when you're ok with these trade offs and really + sure you need the memory resource controller. Even when you enable + this, you can set "cgroup_disable=memory" at your boot option to + disable memory resource controller and you can avoid overheads. + (and lose benefits of memory resource controller) + + This config option also selects MM_OWNER config option, which + could in turn add some fork/exit overhead. + +config CGROUP_MEM_RES_CTLR_SWAP + bool "Memory Resource Controller Swap Extension(EXPERIMENTAL)" + depends on CGROUP_MEM_RES_CTLR && SWAP && EXPERIMENTAL + help + Add swap management feature to memory resource controller. When you + enable this, you can limit mem+swap usage per cgroup. In other words, + when you disable this, memory resource controller has no cares to + usage of swap...a process can exhaust all of the swap. This extension + is useful when you want to avoid exhaustion swap but this itself + adds more overheads and consumes memory for remembering information. + Especially if you use 32bit system or small memory system, please + be careful about enabling this. When memory resource controller + is disabled by boot option, this will be automatically disabled and + there will be no overhead from this. Even when you set this config=y, + if boot option "noswapaccount" is set, swap will not be accounted. + Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page + size is 4096bytes, 512k per 1Gbytes of swap. + +endif # CGROUPS + config MM_OWNER bool