aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c7
-rw-r--r--kernel/printk.c17
-rw-r--r--kernel/sched_fair.c6
-rw-r--r--kernel/signal.c71
4 files changed, 65 insertions, 36 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 2727f9238359..6d8de051382b 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1722,7 +1722,12 @@ void cgroup_enable_task_cg_lists(void)
1722 use_task_css_set_links = 1; 1722 use_task_css_set_links = 1;
1723 do_each_thread(g, p) { 1723 do_each_thread(g, p) {
1724 task_lock(p); 1724 task_lock(p);
1725 if (list_empty(&p->cg_list)) 1725 /*
1726 * We should check if the process is exiting, otherwise
1727 * it will race with cgroup_exit() in that the list
1728 * entry won't be deleted though the process has exited.
1729 */
1730 if (!(p->flags & PF_EXITING) && list_empty(&p->cg_list))
1726 list_add(&p->cg_list, &p->cgroups->tasks); 1731 list_add(&p->cg_list, &p->cgroups->tasks);
1727 task_unlock(p); 1732 task_unlock(p);
1728 } while_each_thread(g, p); 1733 } while_each_thread(g, p);
diff --git a/kernel/printk.c b/kernel/printk.c
index c46a20a19a15..bdd4ea8c3f2b 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -643,8 +643,21 @@ static int acquire_console_semaphore_for_printk(unsigned int cpu)
643{ 643{
644 int retval = 0; 644 int retval = 0;
645 645
646 if (can_use_console(cpu)) 646 if (!try_acquire_console_sem()) {
647 retval = !try_acquire_console_sem(); 647 retval = 1;
648
649 /*
650 * If we can't use the console, we need to release
651 * the console semaphore by hand to avoid flushing
652 * the buffer. We need to hold the console semaphore
653 * in order to do this test safely.
654 */
655 if (!can_use_console(cpu)) {
656 console_locked = 0;
657 up(&console_sem);
658 retval = 0;
659 }
660 }
648 printk_cpu = UINT_MAX; 661 printk_cpu = UINT_MAX;
649 spin_unlock(&logbuf_lock); 662 spin_unlock(&logbuf_lock);
650 return retval; 663 return retval;
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 86a93376282c..0080968d3e4a 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -510,10 +510,8 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
510 510
511 if (!initial) { 511 if (!initial) {
512 /* sleeps upto a single latency don't count. */ 512 /* sleeps upto a single latency don't count. */
513 if (sched_feat(NEW_FAIR_SLEEPERS)) { 513 if (sched_feat(NEW_FAIR_SLEEPERS))
514 vruntime -= calc_delta_fair(sysctl_sched_latency, 514 vruntime -= sysctl_sched_latency;
515 &cfs_rq->load);
516 }
517 515
518 /* ensure we never gain time by being placed backwards. */ 516 /* ensure we never gain time by being placed backwards. */
519 vruntime = max_vruntime(se->vruntime, vruntime); 517 vruntime = max_vruntime(se->vruntime, vruntime);
diff --git a/kernel/signal.c b/kernel/signal.c
index 6af1210092c3..cc8303cd093d 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1757,6 +1757,45 @@ static int do_signal_stop(int signr)
1757 return 1; 1757 return 1;
1758} 1758}
1759 1759
1760static int ptrace_signal(int signr, siginfo_t *info,
1761 struct pt_regs *regs, void *cookie)
1762{
1763 if (!(current->ptrace & PT_PTRACED))
1764 return signr;
1765
1766 ptrace_signal_deliver(regs, cookie);
1767
1768 /* Let the debugger run. */
1769 ptrace_stop(signr, 0, info);
1770
1771 /* We're back. Did the debugger cancel the sig? */
1772 signr = current->exit_code;
1773 if (signr == 0)
1774 return signr;
1775
1776 current->exit_code = 0;
1777
1778 /* Update the siginfo structure if the signal has
1779 changed. If the debugger wanted something
1780 specific in the siginfo structure then it should
1781 have updated *info via PTRACE_SETSIGINFO. */
1782 if (signr != info->si_signo) {
1783 info->si_signo = signr;
1784 info->si_errno = 0;
1785 info->si_code = SI_USER;
1786 info->si_pid = task_pid_vnr(current->parent);
1787 info->si_uid = current->parent->uid;
1788 }
1789
1790 /* If the (new) signal is now blocked, requeue it. */
1791 if (sigismember(&current->blocked, signr)) {
1792 specific_send_sig_info(signr, info, current);
1793 signr = 0;
1794 }
1795
1796 return signr;
1797}
1798
1760int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, 1799int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
1761 struct pt_regs *regs, void *cookie) 1800 struct pt_regs *regs, void *cookie)
1762{ 1801{
@@ -1785,36 +1824,10 @@ relock:
1785 if (!signr) 1824 if (!signr)
1786 break; /* will return 0 */ 1825 break; /* will return 0 */
1787 1826
1788 if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { 1827 if (signr != SIGKILL) {
1789 ptrace_signal_deliver(regs, cookie); 1828 signr = ptrace_signal(signr, info, regs, cookie);
1790 1829 if (!signr)
1791 /* Let the debugger run. */
1792 ptrace_stop(signr, 0, info);
1793
1794 /* We're back. Did the debugger cancel the sig? */
1795 signr = current->exit_code;
1796 if (signr == 0)
1797 continue;
1798
1799 current->exit_code = 0;
1800
1801 /* Update the siginfo structure if the signal has
1802 changed. If the debugger wanted something
1803 specific in the siginfo structure then it should
1804 have updated *info via PTRACE_SETSIGINFO. */
1805 if (signr != info->si_signo) {
1806 info->si_signo = signr;
1807 info->si_errno = 0;
1808 info->si_code = SI_USER;
1809 info->si_pid = task_pid_vnr(current->parent);
1810 info->si_uid = current->parent->uid;
1811 }
1812
1813 /* If the (new) signal is now blocked, requeue it. */
1814 if (sigismember(&current->blocked, signr)) {
1815 specific_send_sig_info(signr, info, current);
1816 continue; 1830 continue;
1817 }
1818 } 1831 }
1819 1832
1820 ka = &current->sighand->action[signr-1]; 1833 ka = &current->sighand->action[signr-1];