From: Philippe Gerum Date: Sun, 3 Dec 2017 11:00:22 +0000 (+0100) Subject: kernel: ipipe: add domain event notifications X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fdcdc1455a6f891c8abd976ba6142f8506ca564d;p=platform%2Fkernel%2Flinux-exynos.git kernel: ipipe: add domain event notifications --- diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 5a8019befafd..5efcef6234c9 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -218,6 +218,9 @@ struct kvm_vcpu { struct kvm *kvm; #ifdef CONFIG_PREEMPT_NOTIFIERS struct preempt_notifier preempt_notifier; +#endif +#ifdef CONFIG_IPIPE + struct ipipe_vm_notifier ipipe_notifier; #endif int cpu; int vcpu_id; diff --git a/kernel/exit.c b/kernel/exit.c index e3a08761eb40..3ca20c9e4385 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -820,6 +821,7 @@ void __noreturn do_exit(long code) */ raw_spin_lock_irq(&tsk->pi_lock); raw_spin_unlock_irq(&tsk->pi_lock); + __ipipe_report_exit(tsk); if (unlikely(in_atomic())) { pr_info("note: %s[%d] exited with preempt_count %d\n", diff --git a/kernel/fork.c b/kernel/fork.c index 500ce64517d9..59dd6b8df0b6 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -557,6 +558,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) #endif setup_thread_stack(tsk, orig); + __ipipe_init_threadflags(task_thread_info(tsk)); + __ipipe_init_threadinfo(&task_thread_info(tsk)->ipipe_data); clear_user_return_notifier(tsk); clear_tsk_need_resched(tsk); set_task_stack_end_magic(tsk); @@ -924,6 +927,7 @@ static inline void __mmput(struct mm_struct *mm) exit_aio(mm); ksm_exit(mm); khugepaged_exit(mm); /* must run before exit_mmap */ + __ipipe_report_cleanup(mm); exit_mmap(mm); mm_put_huge_zero_page(mm); set_mm_exe_file(mm, NULL); @@ -1927,6 +1931,7 @@ static __latent_entropy struct task_struct *copy_process( proc_fork_connector(p); cgroup_post_fork(p); cgroup_threadgroup_change_end(current); + __ipipe_init_taskinfo(p); perf_event_fork(p); trace_task_newtask(p, clone_flags); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2119b43b92cc..81c4e580a823 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1109,10 +1109,13 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, } /* Can the task run on the task's current CPU? If so, we're done */ - if (cpumask_test_cpu(task_cpu(p), new_mask)) + if (cpumask_test_cpu(task_cpu(p), new_mask)) { + __ipipe_report_setaffinity(p, task_cpu(p)); goto out; + } dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask); + __ipipe_report_setaffinity(p, dest_cpu); if (task_running(rq, p) || p->state == TASK_WAKING) { struct migration_arg arg = { p, dest_cpu }; /* Need help from migration thread: drop lock and wait. */ diff --git a/kernel/signal.c b/kernel/signal.c index 1facff1dbbae..67bff1125724 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -661,6 +662,10 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) void signal_wake_up_state(struct task_struct *t, unsigned int state) { set_tsk_thread_flag(t, TIF_SIGPENDING); + + /* TIF_SIGPENDING must be prior to reporting. */ + __ipipe_report_sigwake(t); + /* * TASK_WAKEKILL also means wake it up in the stopped/traced/killable * case. We don't check t->state here because there is a race with it @@ -884,8 +889,11 @@ static inline int wants_signal(int sig, struct task_struct *p) return 0; if (sig == SIGKILL) return 1; - if (task_is_stopped_or_traced(p)) + if (task_is_stopped_or_traced(p)) { + if (!signal_pending(p)) + __ipipe_report_sigwake(p); return 0; + } return task_curr(p) || !signal_pending(p); }