perf: Drop the obsolete profile naming for trace events
[safe/jmp/linux-2.6] / include / linux / sched.h
index 94858df..46c6f8d 100644 (file)
@@ -97,7 +97,7 @@ struct sched_param {
 struct exec_domain;
 struct futex_pi_state;
 struct robust_list_head;
-struct bio;
+struct bio_list;
 struct fs_struct;
 struct bts_context;
 struct perf_event_context;
@@ -192,9 +192,13 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 #define TASK_DEAD              64
 #define TASK_WAKEKILL          128
 #define TASK_WAKING            256
+#define TASK_STATE_MAX         512
 
 #define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW"
 
+extern char ___assert_task_state[1 - 2*!!(
+               sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)];
+
 /* Convenience macros for the sake of set_task_state */
 #define TASK_KILLABLE          (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)
 #define TASK_STOPPED           (TASK_WAKEKILL | __TASK_STOPPED)
@@ -306,6 +310,7 @@ extern void sched_show_task(struct task_struct *p);
 #ifdef CONFIG_DETECT_SOFTLOCKUP
 extern void softlockup_tick(void);
 extern void touch_softlockup_watchdog(void);
+extern void touch_softlockup_watchdog_sync(void);
 extern void touch_all_softlockup_watchdogs(void);
 extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write,
                                    void __user *buffer,
@@ -319,6 +324,9 @@ static inline void softlockup_tick(void)
 static inline void touch_softlockup_watchdog(void)
 {
 }
+static inline void touch_softlockup_watchdog_sync(void)
+{
+}
 static inline void touch_all_softlockup_watchdogs(void)
 {
 }
@@ -373,6 +381,8 @@ extern int sysctl_max_map_count;
 
 #include <linux/aio.h>
 
+#ifdef CONFIG_MMU
+extern void arch_pick_mmap_layout(struct mm_struct *mm);
 extern unsigned long
 arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
                       unsigned long, unsigned long);
@@ -382,61 +392,10 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
                          unsigned long flags);
 extern void arch_unmap_area(struct mm_struct *, unsigned long);
 extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
+#else
+static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
+#endif
 
-#if USE_SPLIT_PTLOCKS
-/*
- * The mm counters are not protected by its page_table_lock,
- * so must be incremented atomically.
- */
-#define set_mm_counter(mm, member, value) atomic_long_set(&(mm)->_##member, value)
-#define get_mm_counter(mm, member) ((unsigned long)atomic_long_read(&(mm)->_##member))
-#define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member)
-#define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member)
-#define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member)
-
-#else  /* !USE_SPLIT_PTLOCKS */
-/*
- * The mm counters are protected by its page_table_lock,
- * so can be incremented directly.
- */
-#define set_mm_counter(mm, member, value) (mm)->_##member = (value)
-#define get_mm_counter(mm, member) ((mm)->_##member)
-#define add_mm_counter(mm, member, value) (mm)->_##member += (value)
-#define inc_mm_counter(mm, member) (mm)->_##member++
-#define dec_mm_counter(mm, member) (mm)->_##member--
-
-#endif /* !USE_SPLIT_PTLOCKS */
-
-#define get_mm_rss(mm)                                 \
-       (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss))
-#define update_hiwater_rss(mm) do {                    \
-       unsigned long _rss = get_mm_rss(mm);            \
-       if ((mm)->hiwater_rss < _rss)                   \
-               (mm)->hiwater_rss = _rss;               \
-} while (0)
-#define update_hiwater_vm(mm)  do {                    \
-       if ((mm)->hiwater_vm < (mm)->total_vm)          \
-               (mm)->hiwater_vm = (mm)->total_vm;      \
-} while (0)
-
-static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
-{
-       return max(mm->hiwater_rss, get_mm_rss(mm));
-}
-
-static inline void setmax_mm_hiwater_rss(unsigned long *maxrss,
-                                        struct mm_struct *mm)
-{
-       unsigned long hiwater_rss = get_mm_hiwater_rss(mm);
-
-       if (*maxrss < hiwater_rss)
-               *maxrss = hiwater_rss;
-}
-
-static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
-{
-       return max(mm->hiwater_vm, mm->total_vm);
-}
 
 extern void set_dumpable(struct mm_struct *mm, int value);
 extern int get_dumpable(struct mm_struct *mm);
@@ -727,14 +686,6 @@ struct user_struct {
        uid_t uid;
        struct user_namespace *user_ns;
 
-#ifdef CONFIG_USER_SCHED
-       struct task_group *tg;
-#ifdef CONFIG_SYSFS
-       struct kobject kobj;
-       struct delayed_work work;
-#endif
-#endif
-
 #ifdef CONFIG_PERF_EVENTS
        atomic_long_t locked_vm;
 #endif
@@ -865,7 +816,10 @@ static inline int sd_balance_for_mc_power(void)
        if (sched_smt_power_savings)
                return SD_POWERSAVINGS_BALANCE;
 
-       return SD_PREFER_SIBLING;
+       if (!sched_mc_power_savings)
+               return SD_PREFER_SIBLING;
+
+       return 0;
 }
 
 static inline int sd_balance_for_package_power(void)
@@ -1071,7 +1025,8 @@ struct sched_domain;
 struct sched_class {
        const struct sched_class *next;
 
-       void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup);
+       void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup,
+                             bool head);
        void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
        void (*yield_task) (struct rq *rq);
 
@@ -1083,14 +1038,6 @@ struct sched_class {
 #ifdef CONFIG_SMP
        int  (*select_task_rq)(struct task_struct *p, int sd_flag, int flags);
 
-       unsigned long (*load_balance) (struct rq *this_rq, int this_cpu,
-                       struct rq *busiest, unsigned long max_load_move,
-                       struct sched_domain *sd, enum cpu_idle_type idle,
-                       int *all_pinned, int *this_best_prio);
-
-       int (*move_one_task) (struct rq *this_rq, int this_cpu,
-                             struct rq *busiest, struct sched_domain *sd,
-                             enum cpu_idle_type idle);
        void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
        void (*post_schedule) (struct rq *this_rq);
        void (*task_waking) (struct rq *this_rq, struct task_struct *task);
@@ -1273,7 +1220,9 @@ struct task_struct {
        struct plist_node pushable_tasks;
 
        struct mm_struct *mm, *active_mm;
-
+#if defined(SPLIT_RSS_COUNTING)
+       struct task_rss_stat    rss_stat;
+#endif
 /* task state */
        int exit_state;
        int exit_code, exit_signal;
@@ -1360,7 +1309,7 @@ struct task_struct {
        char comm[TASK_COMM_LEN]; /* executable name excluding path
                                     - access with [gs]et_task_comm (which lock
                                       it with task_lock())
-                                    - initialized normally by flush_old_exec */
+                                    - initialized normally by setup_new_exec */
 /* file system info */
        int link_count, total_link_count;
 #ifdef CONFIG_SYSVIPC
@@ -1449,13 +1398,11 @@ struct task_struct {
        gfp_t lockdep_reclaim_gfp;
 #endif
 
-#ifdef CONFIG_FS_JOURNAL_INFO
 /* journalling filesystem info */
        void *journal_info;
-#endif
 
 /* stacked block device info */
-       struct bio *bio_list, **bio_tail;
+       struct bio_list *bio_list;
 
 /* VM state */
        struct reclaim_state *reclaim_state;
@@ -1547,10 +1494,18 @@ struct task_struct {
        unsigned long trace_recursion;
 #endif /* CONFIG_TRACING */
        unsigned long stack_start;
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */
+       struct memcg_batch_info {
+               int do_batch;   /* incremented when batch uncharge started */
+               struct mem_cgroup *memcg; /* target memcg of uncharge */
+               unsigned long bytes;            /* uncharged usage */
+               unsigned long memsw_bytes; /* uncharged mem+swap usage */
+       } memcg_batch;
+#endif
 };
 
 /* Future-safe accessor for struct task_struct's cpus_allowed. */
-#define tsk_cpumask(tsk) (&(tsk)->cpus_allowed)
+#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
 
 /*
  * Priority of a process goes from 0..MAX_PRIO-1, valid RT
@@ -2078,7 +2033,6 @@ extern int kill_proc_info(int, struct siginfo *, pid_t);
 extern int do_notify_parent(struct task_struct *, int);
 extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
 extern void force_sig(int, struct task_struct *);
-extern void force_sig_specific(int, struct task_struct *);
 extern int send_sig(int, struct task_struct *, int);
 extern void zap_other_threads(struct task_struct *p);
 extern struct sigqueue *sigqueue_alloc(void);
@@ -2097,11 +2051,6 @@ static inline int kill_cad_pid(int sig, int priv)
 #define SEND_SIG_PRIV  ((struct siginfo *) 1)
 #define SEND_SIG_FORCED        ((struct siginfo *) 2)
 
-static inline int is_si_special(const struct siginfo *info)
-{
-       return info <= SEND_SIG_FORCED;
-}
-
 /*
  * True if we are on the alternate signal stack.
  */
@@ -2487,8 +2436,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
 
 #endif /* CONFIG_SMP */
 
-extern void arch_pick_mmap_layout(struct mm_struct *mm);
-
 #ifdef CONFIG_TRACING
 extern void
 __trace_special(void *__tr, void *__data,
@@ -2506,13 +2453,9 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
 
 extern void normalize_rt_tasks(void);
 
-#ifdef CONFIG_GROUP_SCHED
+#ifdef CONFIG_CGROUP_SCHED
 
 extern struct task_group init_task_group;
-#ifdef CONFIG_USER_SCHED
-extern struct task_group root_task_group;
-extern void set_tg_uid(struct user_struct *user);
-#endif
 
 extern struct task_group *sched_create_group(struct task_group *parent);
 extern void sched_destroy_group(struct task_group *tg);
@@ -2597,6 +2540,28 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p)
 }
 #endif /* CONFIG_MM_OWNER */
 
+static inline unsigned long task_rlimit(const struct task_struct *tsk,
+               unsigned int limit)
+{
+       return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur);
+}
+
+static inline unsigned long task_rlimit_max(const struct task_struct *tsk,
+               unsigned int limit)
+{
+       return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max);
+}
+
+static inline unsigned long rlimit(unsigned int limit)
+{
+       return task_rlimit(current, limit);
+}
+
+static inline unsigned long rlimit_max(unsigned int limit)
+{
+       return task_rlimit_max(current, limit);
+}
+
 #endif /* __KERNEL__ */
 
 #endif