]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/sched.h
Merge branch 'v28-range-hrtimers-for-linus-v2' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-omap-h63xx.git] / include / linux / sched.h
index 26d7a5f2d0bae18cb50e5e99dda8e877caf6368a..5ca620573d47c35c707b115cdb44ca2fb243d519 100644 (file)
@@ -287,7 +287,6 @@ extern void trap_init(void);
 extern void account_process_tick(struct task_struct *task, int user);
 extern void update_process_times(int user);
 extern void scheduler_tick(void);
-extern void hrtick_resched(void);
 
 extern void sched_show_task(struct task_struct *p);
 
@@ -352,7 +351,7 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
 extern void arch_unmap_area(struct mm_struct *, unsigned long);
 extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
 
-#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
+#if USE_SPLIT_PTLOCKS
 /*
  * The mm counters are not protected by its page_table_lock,
  * so must be incremented atomically.
@@ -363,7 +362,7 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
 #define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member)
 #define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member)
 
-#else  /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
+#else  /* !USE_SPLIT_PTLOCKS */
 /*
  * The mm counters are protected by its page_table_lock,
  * so can be incremented directly.
@@ -374,7 +373,7 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
 #define inc_mm_counter(mm, member) (mm)->_##member++
 #define dec_mm_counter(mm, member) (mm)->_##member--
 
-#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
+#endif /* !USE_SPLIT_PTLOCKS */
 
 #define get_mm_rss(mm)                                 \
        (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss))
@@ -403,12 +402,21 @@ extern int get_dumpable(struct mm_struct *mm);
 #define MMF_DUMP_MAPPED_PRIVATE        4
 #define MMF_DUMP_MAPPED_SHARED 5
 #define MMF_DUMP_ELF_HEADERS   6
+#define MMF_DUMP_HUGETLB_PRIVATE 7
+#define MMF_DUMP_HUGETLB_SHARED  8
 #define MMF_DUMP_FILTER_SHIFT  MMF_DUMPABLE_BITS
-#define MMF_DUMP_FILTER_BITS   5
+#define MMF_DUMP_FILTER_BITS   7
 #define MMF_DUMP_FILTER_MASK \
        (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)
 #define MMF_DUMP_FILTER_DEFAULT \
-       ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED))
+       ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED) |\
+        (1 << MMF_DUMP_HUGETLB_PRIVATE) | MMF_DUMP_MASK_DEFAULT_ELF)
+
+#ifdef CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS
+# define MMF_DUMP_MASK_DEFAULT_ELF     (1 << MMF_DUMP_ELF_HEADERS)
+#else
+# define MMF_DUMP_MASK_DEFAULT_ELF     0
+#endif
 
 struct sighand_struct {
        atomic_t                count;
@@ -430,7 +438,7 @@ struct pacct_struct {
  * @utime:             time spent in user mode, in &cputime_t units
  * @stime:             time spent in kernel mode, in &cputime_t units
  * @sum_exec_runtime:  total time spent on the CPU, in nanoseconds
- * 
+ *
  * This structure groups together three kinds of CPU time that are
  * tracked for threads and thread groups.  Most things considering
  * CPU time want to group these counts together and treat all three
@@ -454,15 +462,9 @@ struct task_cputime {
  * This structure contains the version of task_cputime, above, that is
  * used for thread group CPU clock calculations.
  */
-#ifdef CONFIG_SMP
 struct thread_group_cputime {
        struct task_cputime *totals;
 };
-#else
-struct thread_group_cputime {
-       struct task_cputime totals;
-};
-#endif
 
 /*
  * NOTE! "signal_struct" does not have it's own
@@ -490,8 +492,8 @@ struct signal_struct {
         * - everyone except group_exit_task is stopped during signal delivery
         *   of fatal signals, group_exit_task processes the signal.
         */
-       struct task_struct      *group_exit_task;
        int                     notify_count;
+       struct task_struct      *group_exit_task;
 
        /* thread group stop support, overloads group_exit_code too */
        int                     group_stop_count;
@@ -864,6 +866,9 @@ struct sched_domain {
        unsigned int ttwu_move_affine;
        unsigned int ttwu_move_balance;
 #endif
+#ifdef CONFIG_SCHED_DEBUG
+       char *name;
+#endif
 };
 
 extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
@@ -937,7 +942,7 @@ struct sched_class {
        void (*yield_task) (struct rq *rq);
        int  (*select_task_rq)(struct task_struct *p, int sync);
 
-       void (*check_preempt_curr) (struct rq *rq, struct task_struct *p);
+       void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync);
 
        struct task_struct * (*pick_next_task) (struct rq *rq);
        void (*put_prev_task) (struct rq *rq, struct task_struct *p);
@@ -1050,8 +1055,8 @@ struct sched_entity {
 
 struct sched_rt_entity {
        struct list_head run_list;
-       unsigned int time_slice;
        unsigned long timeout;
+       unsigned int time_slice;
        int nr_cpus_allowed;
 
        struct sched_rt_entity *back;
@@ -1340,6 +1345,12 @@ struct task_struct {
        int latency_record_count;
        struct latency_record latency_record[LT_SAVECOUNT];
 #endif
+       /*
+        * time slack values; these are used to round up poll() and
+        * select() etc timeout values. These are in nanoseconds.
+        */
+       unsigned long timer_slack_ns;
+       unsigned long default_timer_slack_ns;
 };
 
 /*
@@ -1659,6 +1670,7 @@ extern unsigned int sysctl_sched_features;
 extern unsigned int sysctl_sched_migration_cost;
 extern unsigned int sysctl_sched_nr_migrate;
 extern unsigned int sysctl_sched_shares_ratelimit;
+extern unsigned int sysctl_sched_shares_thresh;
 
 int sched_nr_latency_handler(struct ctl_table *table, int write,
                struct file *file, void __user *buffer, size_t *length,
@@ -2124,22 +2136,20 @@ static inline int spin_needbreak(spinlock_t *lock)
 /*
  * Thread group CPU time accounting.
  */
-#ifdef CONFIG_SMP
 
-extern int thread_group_cputime_alloc_smp(struct task_struct *);
-extern void thread_group_cputime_smp(struct task_struct *, struct task_cputime *);
+extern int thread_group_cputime_alloc(struct task_struct *);
+extern void thread_group_cputime(struct task_struct *, struct task_cputime *);
 
 static inline void thread_group_cputime_init(struct signal_struct *sig)
 {
        sig->cputime.totals = NULL;
 }
 
-static inline int thread_group_cputime_clone_thread(struct task_struct *curr,
-                                                   struct task_struct *new)
+static inline int thread_group_cputime_clone_thread(struct task_struct *curr)
 {
        if (curr->signal->cputime.totals)
                return 0;
-       return thread_group_cputime_alloc_smp(curr);
+       return thread_group_cputime_alloc(curr);
 }
 
 static inline void thread_group_cputime_free(struct signal_struct *sig)
@@ -2147,171 +2157,6 @@ static inline void thread_group_cputime_free(struct signal_struct *sig)
        free_percpu(sig->cputime.totals);
 }
 
-/**
- * thread_group_cputime - Sum the thread group time fields across all CPUs.
- *
- * This is a wrapper for the real routine, thread_group_cputime_smp().  See
- * that routine for details.
- */
-static inline void thread_group_cputime(
-       struct task_struct *tsk,
-       struct task_cputime *times)
-{
-       thread_group_cputime_smp(tsk, times);
-}
-
-/**
- * thread_group_cputime_account_user - Maintain utime for a thread group.
- *
- * @tgtimes:   Pointer to thread_group_cputime structure.
- * @cputime:   Time value by which to increment the utime field of that
- *             structure.
- *
- * If thread group time is being maintained, get the structure for the
- * running CPU and update the utime field there.
- */
-static inline void thread_group_cputime_account_user(
-       struct thread_group_cputime *tgtimes,
-       cputime_t cputime)
-{
-       if (tgtimes->totals) {
-               struct task_cputime *times;
-
-               times = per_cpu_ptr(tgtimes->totals, get_cpu());
-               times->utime = cputime_add(times->utime, cputime);
-               put_cpu_no_resched();
-       }
-}
-
-/**
- * thread_group_cputime_account_system - Maintain stime for a thread group.
- *
- * @tgtimes:   Pointer to thread_group_cputime structure.
- * @cputime:   Time value by which to increment the stime field of that
- *             structure.
- *
- * If thread group time is being maintained, get the structure for the
- * running CPU and update the stime field there.
- */
-static inline void thread_group_cputime_account_system(
-       struct thread_group_cputime *tgtimes,
-       cputime_t cputime)
-{
-       if (tgtimes->totals) {
-               struct task_cputime *times;
-
-               times = per_cpu_ptr(tgtimes->totals, get_cpu());
-               times->stime = cputime_add(times->stime, cputime);
-               put_cpu_no_resched();
-       }
-}
-
-/**
- * thread_group_cputime_account_exec_runtime - Maintain exec runtime for a
- *                                             thread group.
- *
- * @tgtimes:   Pointer to thread_group_cputime structure.
- * @ns:                Time value by which to increment the sum_exec_runtime field
- *             of that structure.
- *
- * If thread group time is being maintained, get the structure for the
- * running CPU and update the sum_exec_runtime field there.
- */
-static inline void thread_group_cputime_account_exec_runtime(
-       struct thread_group_cputime *tgtimes,
-       unsigned long long ns)
-{
-       if (tgtimes->totals) {
-               struct task_cputime *times;
-
-               times = per_cpu_ptr(tgtimes->totals, get_cpu());
-               times->sum_exec_runtime += ns;
-               put_cpu_no_resched();
-       }
-}
-
-#else /* CONFIG_SMP */
-
-static inline void thread_group_cputime_init(struct signal_struct *sig)
-{
-       sig->cputime.totals.utime = cputime_zero;
-       sig->cputime.totals.stime = cputime_zero;
-       sig->cputime.totals.sum_exec_runtime = 0;
-}
-
-static inline int thread_group_cputime_alloc(struct task_struct *tsk)
-{
-       return 0;
-}
-
-static inline void thread_group_cputime_free(struct signal_struct *sig)
-{
-}
-
-static inline int thread_group_cputime_clone_thread(struct task_struct *curr,
-                                                    struct task_struct *tsk)
-{
-}
-
-static inline void thread_group_cputime(struct task_struct *tsk,
-                                        struct task_cputime *cputime)
-{
-       *cputime = tsk->signal->cputime.totals;
-}
-
-static inline void thread_group_cputime_account_user(
-       struct thread_group_cputime *tgtimes,
-       cputime_t cputime)
-{
-       tgtimes->totals->utime = cputime_add(tgtimes->totals->utime, cputime);
-}
-
-static inline void thread_group_cputime_account_system(
-       struct thread_group_cputime *tgtimes,
-       cputime_t cputime)
-{
-       tgtimes->totals->stime = cputime_add(tgtimes->totals->stime, cputime);
-}
-
-static inline void thread_group_cputime_account_exec_runtime(
-       struct thread_group_cputime *tgtimes,
-       unsigned long long ns)
-{
-       tgtimes->totals->sum_exec_runtime += ns;
-}
-
-#endif /* CONFIG_SMP */
-
-static inline void account_group_user_time(struct task_struct *tsk,
-                                           cputime_t cputime)
-{
-       struct signal_struct *sig;
-
-       sig = tsk->signal;
-       if (likely(sig))
-               thread_group_cputime_account_user(&sig->cputime, cputime);
-}
-
-static inline void account_group_system_time(struct task_struct *tsk,
-                                             cputime_t cputime)
-{
-       struct signal_struct *sig;
-
-       sig = tsk->signal;
-       if (likely(sig))
-               thread_group_cputime_account_system(&sig->cputime, cputime);
-}
-
-static inline void account_group_exec_runtime(struct task_struct *tsk,
-                                              unsigned long long ns)
-{
-       struct signal_struct *sig;
-
-       sig = tsk->signal;
-       if (likely(sig))
-               thread_group_cputime_account_exec_runtime(&sig->cputime, ns);
-}
-
 /*
  * Reevaluate whether the task has signals pending delivery.
  * Wake the task if so.