Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <csander@purestorage.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/all/20240815171549.3260003-1-csander@purestorage.com

authored by

Caleb Sander Mateos and committed by
Thomas Gleixner
e68ac2b4 24d02c4e

+18 -19
+1 -1
block/blk-mq.c
··· 1128 1128 rq->q->mq_ops->complete(rq); 1129 1129 } 1130 1130 1131 - static __latent_entropy void blk_done_softirq(struct softirq_action *h) 1131 + static __latent_entropy void blk_done_softirq(void) 1132 1132 { 1133 1133 blk_complete_reqs(this_cpu_ptr(&blk_cpu_done)); 1134 1134 }
+2 -2
include/linux/interrupt.h
··· 594 594 595 595 struct softirq_action 596 596 { 597 - void (*action)(struct softirq_action *); 597 + void (*action)(void); 598 598 }; 599 599 600 600 asmlinkage void do_softirq(void); ··· 609 609 } 610 610 #endif 611 611 612 - extern void open_softirq(int nr, void (*action)(struct softirq_action *)); 612 + extern void open_softirq(int nr, void (*action)(void)); 613 613 extern void softirq_init(void); 614 614 extern void __raise_softirq_irqoff(unsigned int nr); 615 615
+1 -1
kernel/rcu/tiny.c
··· 105 105 } 106 106 107 107 /* 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) 109 109 { 110 110 struct rcu_head *next, *list; 111 111 unsigned long flags;
+1 -1
kernel/rcu/tree.c
··· 2855 2855 queue_work_on(rdp->cpu, rcu_gp_wq, &rdp->strict_work); 2856 2856 } 2857 2857 2858 - static void rcu_core_si(struct softirq_action *h) 2858 + static void rcu_core_si(void) 2859 2859 { 2860 2860 rcu_core(); 2861 2861 }
+1 -1
kernel/sched/fair.c
··· 12483 12483 * - indirectly from a remote scheduler_tick() for NOHZ idle balancing 12484 12484 * through the SMP cross-call nohz_csd_func() 12485 12485 */ 12486 - static __latent_entropy void sched_balance_softirq(struct softirq_action *h) 12486 + static __latent_entropy void sched_balance_softirq(void) 12487 12487 { 12488 12488 struct rq *this_rq = this_rq(); 12489 12489 enum cpu_idle_type idle = this_rq->idle_balance;
+7 -8
kernel/softirq.c
··· 551 551 kstat_incr_softirqs_this_cpu(vec_nr); 552 552 553 553 trace_softirq_entry(vec_nr); 554 - h->action(h); 554 + h->action(); 555 555 trace_softirq_exit(vec_nr); 556 556 if (unlikely(prev_count != preempt_count())) { 557 557 pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n", ··· 700 700 or_softirq_pending(1UL << nr); 701 701 } 702 702 703 - void open_softirq(int nr, void (*action)(struct softirq_action *)) 703 + void open_softirq(int nr, void (*action)(void)) 704 704 { 705 705 softirq_vec[nr].action = action; 706 706 } ··· 760 760 return false; 761 761 } 762 762 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, 765 764 unsigned int softirq_nr) 766 765 { 767 766 struct tasklet_struct *list; ··· 804 805 } 805 806 } 806 807 807 - static __latent_entropy void tasklet_action(struct softirq_action *a) 808 + static __latent_entropy void tasklet_action(void) 808 809 { 809 810 workqueue_softirq_action(false); 810 - tasklet_action_common(a, this_cpu_ptr(&tasklet_vec), TASKLET_SOFTIRQ); 811 + tasklet_action_common(this_cpu_ptr(&tasklet_vec), TASKLET_SOFTIRQ); 811 812 } 812 813 813 - static __latent_entropy void tasklet_hi_action(struct softirq_action *a) 814 + static __latent_entropy void tasklet_hi_action(void) 814 815 { 815 816 workqueue_softirq_action(true); 816 - tasklet_action_common(a, this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ); 817 + tasklet_action_common(this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ); 817 818 } 818 819 819 820 void tasklet_setup(struct tasklet_struct *t,
+1 -1
kernel/time/hrtimer.c
··· 1757 1757 } 1758 1758 } 1759 1759 1760 - static __latent_entropy void hrtimer_run_softirq(struct softirq_action *h) 1760 + static __latent_entropy void hrtimer_run_softirq(void) 1761 1761 { 1762 1762 struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); 1763 1763 unsigned long flags;
+1 -1
kernel/time/timer.c
··· 2440 2440 /* 2441 2441 * This function runs timers and the timer-tq in bottom half context. 2442 2442 */ 2443 - static __latent_entropy void run_timer_softirq(struct softirq_action *h) 2443 + static __latent_entropy void run_timer_softirq(void) 2444 2444 { 2445 2445 run_timer_base(BASE_LOCAL); 2446 2446 if (IS_ENABLED(CONFIG_NO_HZ_COMMON)) {
+1 -1
lib/irq_poll.c
··· 75 75 } 76 76 EXPORT_SYMBOL(irq_poll_complete); 77 77 78 - static void __latent_entropy irq_poll_softirq(struct softirq_action *h) 78 + static void __latent_entropy irq_poll_softirq(void) 79 79 { 80 80 struct list_head *list = this_cpu_ptr(&blk_cpu_iopoll); 81 81 int rearm = 0, budget = irq_poll_budget;
+2 -2
net/core/dev.c
··· 5247 5247 } 5248 5248 EXPORT_SYMBOL(netif_rx); 5249 5249 5250 - static __latent_entropy void net_tx_action(struct softirq_action *h) 5250 + static __latent_entropy void net_tx_action(void) 5251 5251 { 5252 5252 struct softnet_data *sd = this_cpu_ptr(&softnet_data); 5253 5253 ··· 6920 6920 return 0; 6921 6921 } 6922 6922 6923 - static __latent_entropy void net_rx_action(struct softirq_action *h) 6923 + static __latent_entropy void net_rx_action(void) 6924 6924 { 6925 6925 struct softnet_data *sd = this_cpu_ptr(&softnet_data); 6926 6926 unsigned long time_limit = jiffies +