aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcu/tree_plugin.h')
-rw-r--r--kernel/rcu/tree_plugin.h213
1 files changed, 0 insertions, 213 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 6ddb3c05e88f..1102765f91fd 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -643,100 +643,6 @@ static void rcu_read_unlock_special(struct task_struct *t)
643} 643}
644 644
645/* 645/*
646 * Dump detailed information for all tasks blocking the current RCU
647 * grace period on the specified rcu_node structure.
648 */
649static void rcu_print_detail_task_stall_rnp(struct rcu_node *rnp)
650{
651 unsigned long flags;
652 struct task_struct *t;
653
654 raw_spin_lock_irqsave_rcu_node(rnp, flags);
655 if (!rcu_preempt_blocked_readers_cgp(rnp)) {
656 raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
657 return;
658 }
659 t = list_entry(rnp->gp_tasks->prev,
660 struct task_struct, rcu_node_entry);
661 list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) {
662 /*
663 * We could be printing a lot while holding a spinlock.
664 * Avoid triggering hard lockup.
665 */
666 touch_nmi_watchdog();
667 sched_show_task(t);
668 }
669 raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
670}
671
672/*
673 * Dump detailed information for all tasks blocking the current RCU
674 * grace period.
675 */
676static void rcu_print_detail_task_stall(void)
677{
678 struct rcu_node *rnp = rcu_get_root();
679
680 rcu_print_detail_task_stall_rnp(rnp);
681 rcu_for_each_leaf_node(rnp)
682 rcu_print_detail_task_stall_rnp(rnp);
683}
684
685static void rcu_print_task_stall_begin(struct rcu_node *rnp)
686{
687 pr_err("\tTasks blocked on level-%d rcu_node (CPUs %d-%d):",
688 rnp->level, rnp->grplo, rnp->grphi);
689}
690
691static void rcu_print_task_stall_end(void)
692{
693 pr_cont("\n");
694}
695
696/*
697 * Scan the current list of tasks blocked within RCU read-side critical
698 * sections, printing out the tid of each.
699 */
700static int rcu_print_task_stall(struct rcu_node *rnp)
701{
702 struct task_struct *t;
703 int ndetected = 0;
704
705 if (!rcu_preempt_blocked_readers_cgp(rnp))
706 return 0;
707 rcu_print_task_stall_begin(rnp);
708 t = list_entry(rnp->gp_tasks->prev,
709 struct task_struct, rcu_node_entry);
710 list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) {
711 pr_cont(" P%d", t->pid);
712 ndetected++;
713 }
714 rcu_print_task_stall_end();
715 return ndetected;
716}
717
718/*
719 * Scan the current list of tasks blocked within RCU read-side critical
720 * sections, printing out the tid of each that is blocking the current
721 * expedited grace period.
722 */
723static int rcu_print_task_exp_stall(struct rcu_node *rnp)
724{
725 struct task_struct *t;
726 int ndetected = 0;
727
728 if (!rnp->exp_tasks)
729 return 0;
730 t = list_entry(rnp->exp_tasks->prev,
731 struct task_struct, rcu_node_entry);
732 list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) {
733 pr_cont(" P%d", t->pid);
734 ndetected++;
735 }
736 return ndetected;
737}
738
739/*
740 * Check that the list of blocked tasks for the newly completed grace 646 * Check that the list of blocked tasks for the newly completed grace
741 * period is in fact empty. It is a serious bug to complete a grace 647 * period is in fact empty. It is a serious bug to complete a grace
742 * period that still has RCU readers blocked! This function must be 648 * period that still has RCU readers blocked! This function must be
@@ -986,33 +892,6 @@ static bool rcu_preempt_need_deferred_qs(struct task_struct *t)
986static void rcu_preempt_deferred_qs(struct task_struct *t) { } 892static void rcu_preempt_deferred_qs(struct task_struct *t) { }
987 893
988/* 894/*
989 * Because preemptible RCU does not exist, we never have to check for
990 * tasks blocked within RCU read-side critical sections.
991 */
992static void rcu_print_detail_task_stall(void)
993{
994}
995
996/*
997 * Because preemptible RCU does not exist, we never have to check for
998 * tasks blocked within RCU read-side critical sections.
999 */
1000static int rcu_print_task_stall(struct rcu_node *rnp)
1001{
1002 return 0;
1003}
1004
1005/*
1006 * Because preemptible RCU does not exist, we never have to check for
1007 * tasks blocked within RCU read-side critical sections that are
1008 * blocking the current expedited grace period.
1009 */
1010static int rcu_print_task_exp_stall(struct rcu_node *rnp)
1011{
1012 return 0;
1013}
1014
1015/*
1016 * Because there is no preemptible RCU, there can be no readers blocked, 895 * Because there is no preemptible RCU, there can be no readers blocked,
1017 * so there is no need to check for blocked tasks. So check only for 896 * so there is no need to check for blocked tasks. So check only for
1018 * bogus qsmask values. 897 * bogus qsmask values.
@@ -1652,98 +1531,6 @@ static void rcu_cleanup_after_idle(void)
1652 1531
1653#endif /* #else #if !defined(CONFIG_RCU_FAST_NO_HZ) */ 1532#endif /* #else #if !defined(CONFIG_RCU_FAST_NO_HZ) */
1654 1533
1655#ifdef CONFIG_RCU_FAST_NO_HZ
1656
1657static void print_cpu_stall_fast_no_hz(char *cp, int cpu)
1658{
1659 struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
1660
1661 sprintf(cp, "last_accelerate: %04lx/%04lx, Nonlazy posted: %c%c%c",
1662 rdp->last_accelerate & 0xffff, jiffies & 0xffff,
1663 ".l"[rdp->all_lazy],
1664 ".L"[!rcu_segcblist_n_nonlazy_cbs(&rdp->cblist)],
1665 ".D"[!rdp->tick_nohz_enabled_snap]);
1666}
1667
1668#else /* #ifdef CONFIG_RCU_FAST_NO_HZ */
1669
1670static void print_cpu_stall_fast_no_hz(char *cp, int cpu)
1671{
1672 *cp = '\0';
1673}
1674
1675#endif /* #else #ifdef CONFIG_RCU_FAST_NO_HZ */
1676
1677/* Initiate the stall-info list. */
1678static void print_cpu_stall_info_begin(void)
1679{
1680 pr_cont("\n");
1681}
1682
1683/*
1684 * Print out diagnostic information for the specified stalled CPU.
1685 *
1686 * If the specified CPU is aware of the current RCU grace period, then
1687 * print the number of scheduling clock interrupts the CPU has taken
1688 * during the time that it has been aware. Otherwise, print the number
1689 * of RCU grace periods that this CPU is ignorant of, for example, "1"
1690 * if the CPU was aware of the previous grace period.
1691 *
1692 * Also print out idle and (if CONFIG_RCU_FAST_NO_HZ) idle-entry info.
1693 */
1694static void print_cpu_stall_info(int cpu)
1695{
1696 unsigned long delta;
1697 char fast_no_hz[72];
1698 struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu);
1699 char *ticks_title;
1700 unsigned long ticks_value;
1701
1702 /*
1703 * We could be printing a lot while holding a spinlock. Avoid
1704 * triggering hard lockup.
1705 */
1706 touch_nmi_watchdog();
1707
1708 ticks_value = rcu_seq_ctr(rcu_state.gp_seq - rdp->gp_seq);
1709 if (ticks_value) {
1710 ticks_title = "GPs behind";
1711 } else {
1712 ticks_title = "ticks this GP";
1713 ticks_value = rdp->ticks_this_gp;
1714 }
1715 print_cpu_stall_fast_no_hz(fast_no_hz, cpu);
1716 delta = rcu_seq_ctr(rdp->mynode->gp_seq - rdp->rcu_iw_gp_seq);
1717 pr_err("\t%d-%c%c%c%c: (%lu %s) idle=%03x/%ld/%#lx softirq=%u/%u fqs=%ld %s\n",
1718 cpu,
1719 "O."[!!cpu_online(cpu)],
1720 "o."[!!(rdp->grpmask & rdp->mynode->qsmaskinit)],
1721 "N."[!!(rdp->grpmask & rdp->mynode->qsmaskinitnext)],
1722 !IS_ENABLED(CONFIG_IRQ_WORK) ? '?' :
1723 rdp->rcu_iw_pending ? (int)min(delta, 9UL) + '0' :
1724 "!."[!delta],
1725 ticks_value, ticks_title,
1726 rcu_dynticks_snap(rdp) & 0xfff,
1727 rdp->dynticks_nesting, rdp->dynticks_nmi_nesting,
1728 rdp->softirq_snap, kstat_softirqs_cpu(RCU_SOFTIRQ, cpu),
1729 READ_ONCE(rcu_state.n_force_qs) - rcu_state.n_force_qs_gpstart,
1730 fast_no_hz);
1731}
1732
1733/* Terminate the stall-info list. */
1734static void print_cpu_stall_info_end(void)
1735{
1736 pr_err("\t");
1737}
1738
1739/* Zero ->ticks_this_gp and snapshot the number of RCU softirq handlers. */
1740static void zero_cpu_stall_ticks(struct rcu_data *rdp)
1741{
1742 rdp->ticks_this_gp = 0;
1743 rdp->softirq_snap = kstat_softirqs_cpu(RCU_SOFTIRQ, smp_processor_id());
1744 WRITE_ONCE(rdp->last_fqs_resched, jiffies);
1745}
1746
1747#ifdef CONFIG_RCU_NOCB_CPU 1534#ifdef CONFIG_RCU_NOCB_CPU
1748 1535
1749/* 1536/*