Skip to content

Commit e68ac2b

Browse files
calebsanderKAGA-KOKO
authored andcommitted
softirq: Remove unused 'action' parameter from action callback
When soft interrupt actions are called, they are passed a pointer to the struct softirq action which contains the action's function pointer. This pointer isn't useful, as the action callback already knows what function it is. And since each callback handles a specific soft interrupt, the callback also knows which soft interrupt number is running. No soft interrupt action callback actually uses this parameter, so remove it from the function pointer signature. This clarifies that soft interrupt actions are global routines and makes it slightly cheaper to call them. Signed-off-by: Caleb Sander Mateos <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 24d02c4 commit e68ac2b

File tree

10 files changed

+18
-19
lines changed

10 files changed

+18
-19
lines changed

block/blk-mq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ static void blk_complete_reqs(struct llist_head *list)
11281128
rq->q->mq_ops->complete(rq);
11291129
}
11301130

1131-
static __latent_entropy void blk_done_softirq(struct softirq_action *h)
1131+
static __latent_entropy void blk_done_softirq(void)
11321132
{
11331133
blk_complete_reqs(this_cpu_ptr(&blk_cpu_done));
11341134
}

include/linux/interrupt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ extern const char * const softirq_to_name[NR_SOFTIRQS];
594594

595595
struct softirq_action
596596
{
597-
void (*action)(struct softirq_action *);
597+
void (*action)(void);
598598
};
599599

600600
asmlinkage void do_softirq(void);
@@ -609,7 +609,7 @@ static inline void do_softirq_post_smp_call_flush(unsigned int unused)
609609
}
610610
#endif
611611

612-
extern void open_softirq(int nr, void (*action)(struct softirq_action *));
612+
extern void open_softirq(int nr, void (*action)(void));
613613
extern void softirq_init(void);
614614
extern void __raise_softirq_irqoff(unsigned int nr);
615615

kernel/rcu/tiny.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static inline bool rcu_reclaim_tiny(struct rcu_head *head)
105105
}
106106

107107
/* Invoke the RCU callbacks whose grace period has elapsed. */
108-
static __latent_entropy void rcu_process_callbacks(struct softirq_action *unused)
108+
static __latent_entropy void rcu_process_callbacks(void)
109109
{
110110
struct rcu_head *next, *list;
111111
unsigned long flags;

kernel/rcu/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2855,7 +2855,7 @@ static __latent_entropy void rcu_core(void)
28552855
queue_work_on(rdp->cpu, rcu_gp_wq, &rdp->strict_work);
28562856
}
28572857

2858-
static void rcu_core_si(struct softirq_action *h)
2858+
static void rcu_core_si(void)
28592859
{
28602860
rcu_core();
28612861
}

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12483,7 +12483,7 @@ static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf)
1248312483
* - indirectly from a remote scheduler_tick() for NOHZ idle balancing
1248412484
* through the SMP cross-call nohz_csd_func()
1248512485
*/
12486-
static __latent_entropy void sched_balance_softirq(struct softirq_action *h)
12486+
static __latent_entropy void sched_balance_softirq(void)
1248712487
{
1248812488
struct rq *this_rq = this_rq();
1248912489
enum cpu_idle_type idle = this_rq->idle_balance;

kernel/softirq.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ static void handle_softirqs(bool ksirqd)
551551
kstat_incr_softirqs_this_cpu(vec_nr);
552552

553553
trace_softirq_entry(vec_nr);
554-
h->action(h);
554+
h->action();
555555
trace_softirq_exit(vec_nr);
556556
if (unlikely(prev_count != preempt_count())) {
557557
pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
@@ -700,7 +700,7 @@ void __raise_softirq_irqoff(unsigned int nr)
700700
or_softirq_pending(1UL << nr);
701701
}
702702

703-
void open_softirq(int nr, void (*action)(struct softirq_action *))
703+
void open_softirq(int nr, void (*action)(void))
704704
{
705705
softirq_vec[nr].action = action;
706706
}
@@ -760,8 +760,7 @@ static bool tasklet_clear_sched(struct tasklet_struct *t)
760760
return false;
761761
}
762762

763-
static void tasklet_action_common(struct softirq_action *a,
764-
struct tasklet_head *tl_head,
763+
static void tasklet_action_common(struct tasklet_head *tl_head,
765764
unsigned int softirq_nr)
766765
{
767766
struct tasklet_struct *list;
@@ -805,16 +804,16 @@ static void tasklet_action_common(struct softirq_action *a,
805804
}
806805
}
807806

808-
static __latent_entropy void tasklet_action(struct softirq_action *a)
807+
static __latent_entropy void tasklet_action(void)
809808
{
810809
workqueue_softirq_action(false);
811-
tasklet_action_common(a, this_cpu_ptr(&tasklet_vec), TASKLET_SOFTIRQ);
810+
tasklet_action_common(this_cpu_ptr(&tasklet_vec), TASKLET_SOFTIRQ);
812811
}
813812

814-
static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
813+
static __latent_entropy void tasklet_hi_action(void)
815814
{
816815
workqueue_softirq_action(true);
817-
tasklet_action_common(a, this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ);
816+
tasklet_action_common(this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ);
818817
}
819818

820819
void tasklet_setup(struct tasklet_struct *t,

kernel/time/hrtimer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,7 @@ static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now,
17571757
}
17581758
}
17591759

1760-
static __latent_entropy void hrtimer_run_softirq(struct softirq_action *h)
1760+
static __latent_entropy void hrtimer_run_softirq(void)
17611761
{
17621762
struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
17631763
unsigned long flags;

kernel/time/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2440,7 +2440,7 @@ static void run_timer_base(int index)
24402440
/*
24412441
* This function runs timers and the timer-tq in bottom half context.
24422442
*/
2443-
static __latent_entropy void run_timer_softirq(struct softirq_action *h)
2443+
static __latent_entropy void run_timer_softirq(void)
24442444
{
24452445
run_timer_base(BASE_LOCAL);
24462446
if (IS_ENABLED(CONFIG_NO_HZ_COMMON)) {

lib/irq_poll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void irq_poll_complete(struct irq_poll *iop)
7575
}
7676
EXPORT_SYMBOL(irq_poll_complete);
7777

78-
static void __latent_entropy irq_poll_softirq(struct softirq_action *h)
78+
static void __latent_entropy irq_poll_softirq(void)
7979
{
8080
struct list_head *list = this_cpu_ptr(&blk_cpu_iopoll);
8181
int rearm = 0, budget = irq_poll_budget;

net/core/dev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5247,7 +5247,7 @@ int netif_rx(struct sk_buff *skb)
52475247
}
52485248
EXPORT_SYMBOL(netif_rx);
52495249

5250-
static __latent_entropy void net_tx_action(struct softirq_action *h)
5250+
static __latent_entropy void net_tx_action(void)
52515251
{
52525252
struct softnet_data *sd = this_cpu_ptr(&softnet_data);
52535253

@@ -6920,7 +6920,7 @@ static int napi_threaded_poll(void *data)
69206920
return 0;
69216921
}
69226922

6923-
static __latent_entropy void net_rx_action(struct softirq_action *h)
6923+
static __latent_entropy void net_rx_action(void)
69246924
{
69256925
struct softnet_data *sd = this_cpu_ptr(&softnet_data);
69266926
unsigned long time_limit = jiffies +

0 commit comments

Comments
 (0)