#include <linux/sched/prio.h>
-#include <linux/capability.h>
#include <linux/mutex.h>
#include <linux/plist.h>
#include <linux/mm_types_task.h>
/* Task command name length */
#define TASK_COMM_LEN 16
-extern void sched_init(void);
-extern void sched_init_smp(void);
-
extern cpumask_var_t cpu_isolated_map;
extern int runqueue_is_locked(int cpu);
-extern void cpu_init (void);
-extern void trap_init(void);
-extern void update_process_times(int user);
extern void scheduler_tick(void);
#define MAX_SCHEDULE_TIMEOUT LONG_MAX
struct wake_q_node *next;
};
-/* Track pages that require TLB flushes */
-struct tlbflush_unmap_batch {
- /*
- * Each bit set is a CPU that potentially has a TLB entry for one of
- * the PFNs being flushed. See set_tlb_ubc_flush_pending().
- */
- struct cpumask cpumask;
-
- /* True if any bit in cpumask is set */
- bool flush_required;
-
- /*
- * If true then the PTE was dirty when unmapped. The entry must be
- * flushed before IO is initiated or a stale TLB entry potentially
- * allows an update without redirtying the page.
- */
- bool writable;
-};
-
struct task_struct {
#ifdef CONFIG_THREAD_INFO_IN_TASK
/*
unsigned long numa_pages_migrated;
#endif /* CONFIG_NUMA_BALANCING */
-#ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
struct tlbflush_unmap_batch tlb_ubc;
-#endif
struct rcu_head rcu;
extern struct pid *cad_pid;
-extern void free_task(struct task_struct *tsk);
-#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
-
-extern void __put_task_struct(struct task_struct *t);
-
-static inline void put_task_struct(struct task_struct *t)
-{
- if (atomic_dec_and_test(&t->usage))
- __put_task_struct(t);
-}
-
-struct task_struct *task_rcu_dereference(struct task_struct **ptask);
-struct task_struct *try_get_task_struct(struct task_struct **ptask);
-
/*
* Per process flags
*/
#define cpu_relax_yield() cpu_relax()
#endif
-/* sched_exec is called by processes performing an exec */
-#ifdef CONFIG_SMP
-extern void sched_exec(void);
-#else
-#define sched_exec() {}
-#endif
-
extern int yield_to(struct task_struct *p, bool preempt);
extern void set_user_nice(struct task_struct *p, long nice);
extern int task_prio(const struct task_struct *p);
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
-extern int task_can_switch_user(struct user_struct *up,
- struct task_struct *tsk);
-
#ifndef TASK_SIZE_OF
#define TASK_SIZE_OF(tsk) TASK_SIZE
#endif