@@ -584,8 +584,13 @@ extern const char * const softirq_to_name[NR_SOFTIRQS];
struct softirq_action
{
void (*action)(struct softirq_action *);
+ u64 start;
+ u64 timo;
};
+extern struct softirq_action softirq_action_now(void);
+extern bool softirq_needs_break(struct softirq_action *action);
+
asmlinkage void do_softirq(void);
asmlinkage void __do_softirq(void);
@@ -533,6 +533,20 @@ static inline bool __softirq_needs_break(u64 start, u64 timo)
return false;
}
+bool softirq_needs_break(struct softirq_action *h)
+{
+ return __softirq_needs_break(h->start, h->timo);
+}
+
+struct softirq_action softirq_action_now(void)
+{
+ struct softirq_action h = {
+ .start = sched_clock(),
+ .timo = MAX_SOFTIRQ_TIME,
+ };
+ return h;
+}
+
asmlinkage __visible void __softirq_entry __do_softirq(void)
{
unsigned int max_restart = MAX_SOFTIRQ_RESTART;
@@ -572,6 +586,8 @@ asmlinkage __visible void __softirq_entry __do_softirq(void)
__clear_bit(vec_nr, &pending);
h = softirq_vec + vec_nr;
+ h->start = start;
+ h->timo = timo;
prev_count = preempt_count();