Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched: [PATCH] sched: debug feature - make the sched-domains tree runtime-tweakable [PATCH] sched: add above_background_load() function [PATCH] sched: update Documentation/sched-stats.txt [PATCH] sched: mark sysrq_sched_debug_show() static [PATCH] sched: make cpu_clock() not use the rq clock [PATCH] sched: remove unused rq->load_balance_class [PATCH] sched: arch preempt notifier mechanism [PATCH] sched: increase SCHED_LOAD_SCALE_FUZZ
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <linux/thread_info.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
#ifdef CONFIG_DEBUG_PREEMPT
|
||||
extern void fastcall add_preempt_count(int val);
|
||||
@@ -60,4 +61,47 @@ do { \
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PREEMPT_NOTIFIERS
|
||||
|
||||
struct preempt_notifier;
|
||||
|
||||
/**
|
||||
* preempt_ops - notifiers called when a task is preempted and rescheduled
|
||||
* @sched_in: we're about to be rescheduled:
|
||||
* notifier: struct preempt_notifier for the task being scheduled
|
||||
* cpu: cpu we're scheduled on
|
||||
* @sched_out: we've just been preempted
|
||||
* notifier: struct preempt_notifier for the task being preempted
|
||||
* next: the task that's kicking us out
|
||||
*/
|
||||
struct preempt_ops {
|
||||
void (*sched_in)(struct preempt_notifier *notifier, int cpu);
|
||||
void (*sched_out)(struct preempt_notifier *notifier,
|
||||
struct task_struct *next);
|
||||
};
|
||||
|
||||
/**
|
||||
* preempt_notifier - key for installing preemption notifiers
|
||||
* @link: internal use
|
||||
* @ops: defines the notifier functions to be called
|
||||
*
|
||||
* Usually used in conjunction with container_of().
|
||||
*/
|
||||
struct preempt_notifier {
|
||||
struct hlist_node link;
|
||||
struct preempt_ops *ops;
|
||||
};
|
||||
|
||||
void preempt_notifier_register(struct preempt_notifier *notifier);
|
||||
void preempt_notifier_unregister(struct preempt_notifier *notifier);
|
||||
|
||||
static inline void preempt_notifier_init(struct preempt_notifier *notifier,
|
||||
struct preempt_ops *ops)
|
||||
{
|
||||
INIT_HLIST_NODE(¬ifier->link);
|
||||
notifier->ops = ops;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_PREEMPT_H */
|
||||
|
||||
+22
-1
@@ -681,7 +681,7 @@ enum cpu_idle_type {
|
||||
#define SCHED_LOAD_SHIFT 10
|
||||
#define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT)
|
||||
|
||||
#define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 5)
|
||||
#define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 1)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */
|
||||
@@ -786,6 +786,22 @@ extern int partition_sched_domains(cpumask_t *partition1,
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
/*
|
||||
* A runqueue laden with a single nice 0 task scores a weighted_cpuload of
|
||||
* SCHED_LOAD_SCALE. This function returns 1 if any cpu is laden with a
|
||||
* task of nice 0 or enough lower priority tasks to bring up the
|
||||
* weighted_cpuload
|
||||
*/
|
||||
static inline int above_background_load(void)
|
||||
{
|
||||
unsigned long cpu;
|
||||
|
||||
for_each_online_cpu(cpu) {
|
||||
if (weighted_cpuload(cpu) >= SCHED_LOAD_SCALE)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct io_context; /* See blkdev.h */
|
||||
struct cpuset;
|
||||
@@ -935,6 +951,11 @@ struct task_struct {
|
||||
struct sched_class *sched_class;
|
||||
struct sched_entity se;
|
||||
|
||||
#ifdef CONFIG_PREEMPT_NOTIFIERS
|
||||
/* list of struct preempt_notifier: */
|
||||
struct hlist_head preempt_notifiers;
|
||||
#endif
|
||||
|
||||
unsigned short ioprio;
|
||||
#ifdef CONFIG_BLK_DEV_IO_TRACE
|
||||
unsigned int btrace_seq;
|
||||
|
||||
Reference in New Issue
Block a user