From 584dbdb69f380ac8fbd889650a2e90b5e94eade1 Mon Sep 17 00:00:00 2001 From: Luis Gerhorst <luis.gerhorst@fau.de> Date: Tue, 12 Jun 2018 21:41:47 +0200 Subject: [PATCH] Checkpoints in all softirqs --- block/blk-softirq.c | 4 ++++ kernel/rcu/tree.c | 4 ++++ kernel/sched/fair.c | 4 ++++ kernel/softirq.c | 6 ++++++ kernel/time/timer.c | 4 ++++ lib/irq_poll.c | 4 ++++ net/core/dev.c | 6 ++++++ 7 files changed, 32 insertions(+) diff --git a/block/blk-softirq.c b/block/blk-softirq.c index 06cf9807f49a3..9960f8e3468e4 100644 --- a/block/blk-softirq.c +++ b/block/blk-softirq.c @@ -12,6 +12,8 @@ #include "blk.h" +#include <linux/measuremore.h> + static DEFINE_PER_CPU(struct list_head, blk_cpu_done); /* @@ -20,6 +22,8 @@ static DEFINE_PER_CPU(struct list_head, blk_cpu_done); */ static __latent_entropy void blk_done_softirq(struct softirq_action *h) { + memo_checkpoint("block_softirq"); + struct list_head *cpu_list, local_list; local_irq_disable(); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index d1a02877a42c7..fbc8f7a9258a9 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -59,6 +59,8 @@ #include "tree.h" #include "rcu.h" +#include <linux/measuremore.h> + #ifdef MODULE_PARAM_PREFIX #undef MODULE_PARAM_PREFIX #endif @@ -3028,6 +3030,8 @@ __rcu_process_callbacks(struct rcu_state *rsp) */ static __latent_entropy void rcu_process_callbacks(struct softirq_action *unused) { + memo_checkpoint("rcu_softirq"); + struct rcu_state *rsp; if (cpu_is_offline(smp_processor_id())) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3d862f5b0331c..3247e639d2cd9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -35,6 +35,8 @@ #include "sched.h" +#include <linux/measuremore.h> + /* * Targeted preemption latency for CPU-bound tasks: * (default: 6ms * (1 + ilog(ncpus)), units: nanoseconds) @@ -8493,6 +8495,8 @@ static void nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle) { } */ static __latent_entropy void run_rebalance_domains(struct softirq_action *h) { + memo_checkpoint("sched_softirq"); + struct rq *this_rq = this_rq(); enum cpu_idle_type idle = this_rq->idle_balance ? CPU_IDLE : CPU_NOT_IDLE; diff --git a/kernel/softirq.c b/kernel/softirq.c index 5b081b282f07d..41dd27566ea0a 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -30,6 +30,8 @@ #define CREATE_TRACE_POINTS #include <trace/events/irq.h> +#include <linux/measuremore.h> + /* - No shared variables, all the data are CPU local. - If a softirq needs serialization, let it serialize itself @@ -484,6 +486,8 @@ EXPORT_SYMBOL(__tasklet_hi_schedule_first); static __latent_entropy void tasklet_action(struct softirq_action *a) { + memo_checkpoint("tasklet_softirq"); + struct tasklet_struct *list; local_irq_disable(); @@ -522,6 +526,8 @@ static __latent_entropy void tasklet_hi_action(struct softirq_action *a) { struct tasklet_struct *list; + memo_checkpoint("hi_softirq"); + local_irq_disable(); list = __this_cpu_read(tasklet_hi_vec.head); __this_cpu_write(tasklet_hi_vec.head, NULL); diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 7c477912f36da..8eb4f1a4f8881 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -54,6 +54,8 @@ #define CREATE_TRACE_POINTS #include <trace/events/timer.h> +#include <linux/measuremore.h> + __visible u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES; EXPORT_SYMBOL(jiffies_64); @@ -1666,6 +1668,8 @@ static inline void __run_timers(struct timer_base *base) */ static __latent_entropy void run_timer_softirq(struct softirq_action *h) { + memo_checkpoint("timer_softirq"); + struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); /* diff --git a/lib/irq_poll.c b/lib/irq_poll.c index 1d6565e810309..86cec747036d3 100644 --- a/lib/irq_poll.c +++ b/lib/irq_poll.c @@ -11,6 +11,8 @@ #include <linux/irq_poll.h> #include <linux/delay.h> +#include <linux/measuremore.h> + static unsigned int irq_poll_budget __read_mostly = 256; static DEFINE_PER_CPU(struct list_head, blk_cpu_iopoll); @@ -76,6 +78,8 @@ EXPORT_SYMBOL(irq_poll_complete); static void __latent_entropy irq_poll_softirq(struct softirq_action *h) { + memo_checkpoint("irq_poll_softirq"); + struct list_head *list = this_cpu_ptr(&blk_cpu_iopoll); int rearm = 0, budget = irq_poll_budget; unsigned long start_time = jiffies; diff --git a/net/core/dev.c b/net/core/dev.c index 272f84ad16e05..1920bb341b9e0 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -144,6 +144,8 @@ #include "net-sysfs.h" +#include <linux/measuremore.h> + /* Instead of increasing this, you should create a hash table. */ #define MAX_GRO_SKBS 8 @@ -3895,6 +3897,8 @@ EXPORT_SYMBOL(netif_rx_ni); static __latent_entropy void net_tx_action(struct softirq_action *h) { + memo_checkpoint("net_tx_softirq"); + struct softnet_data *sd = this_cpu_ptr(&softnet_data); if (sd->completion_queue) { @@ -5261,6 +5265,8 @@ static int napi_poll(struct napi_struct *n, struct list_head *repoll) static __latent_entropy void net_rx_action(struct softirq_action *h) { + memo_checkpoint("net_rx_softirq"); + struct softnet_data *sd = this_cpu_ptr(&softnet_data); unsigned long time_limit = jiffies + 2; int budget = netdev_budget; -- GitLab