History

Remove argument from open_softirq which is always NULL

As git-grep shows, open_softirq() is always called with the last argument being NULL block/blk-core.c: open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL); kernel/hrtimer.c: open_softirq(HRTIMER_SOFTIRQ, run_hrtimer_softirq, NULL); kernel/rcuclassic.c: open_softirq(RCU_SOFTIRQ, rcu_process_callbacks, NULL); kernel/rcupreempt.c: open_softirq(RCU_SOFTIRQ, rcu_process_callbacks, NULL); kernel/sched.c: open_softirq(SCHED_SOFTIRQ, run_rebalance_domains, NULL); kernel/softirq.c: open_softirq(TASKLET_SOFTIRQ, tasklet_action, NULL); kernel/softirq.c: open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL); kernel/timer.c: open_softirq(TIMER_SOFTIRQ, run_timer_softirq, NULL); net/core/dev.c: open_softirq(NET_TX_SOFTIRQ, net_tx_action, NULL); net/core/dev.c: open_softirq(NET_RX_SOFTIRQ, net_rx_action, NULL); This observation has already been made by Matthew Wilcox in June 2002 (http://www.cs.helsinki.fi/linux/linux-kernel/2002-25/0687.html) "I notice that none of the current softirq routines use the data element passed to them." and the situation hasn't changed since them. So it appears we can safely remove that extra argument to save 128 (54) bytes of kernel data (text).

Carlos R. Mafra committed 18 years ago

Commit 962cf361 parent 75d3bce9 files · +12 −14Browse files

Unified · Split

9 files
  1. block/blk-core.c +1 −1
  2. include/linux/interrupt.h +1 −2
  3. kernel/hrtimer.c +1 −1
  4. kernel/rcuclassic.c +1 −1
  5. kernel/rcupreempt.c +1 −1
  6. kernel/sched.c +1 −1
  7. kernel/softirq.c +3 −4
  8. kernel/timer.c +1 −1
  9. net/core/dev.c +2 −2
block/blk-core.c+1−1
@@ -2048,7 +2048,7 @@ int __init blk_dev_init(void) · 2047 unmodified lines
20482048 for_each_possible_cpu(i)
20492049 INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i));
20502050
2051− open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL);
2051+ open_softirq(BLOCK_SOFTIRQ, blk_done_softirq);
20522052 register_hotcpu_notifier(&blk_cpu_notifier);
20532053
20542054 return 0;
include/linux/interrupt.h+1−2
@@ -285,12 +285,11 @@ enum · 284 unmodified lines
285285 struct softirq_action
286286 {
287287 void (*action)(struct softirq_action *);
288− void *data;
289288 };
290289
291290 asmlinkage void do_softirq(void);
292291 asmlinkage void __do_softirq(void);
293−extern void open_softirq(int nr, void (*action)(struct softirq_action*), void *data);
292+extern void open_softirq(int nr, void (*action)(struct softirq_action *));
294293 extern void softirq_init(void);
295294 #define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0)
296295 extern void raise_softirq_irqoff(unsigned int nr);
kernel/hrtimer.c+1−1
@@ -1669,7 +1669,7 @@ void __init hrtimers_init(void) · 1668 unmodified lines
16691669 (void *)(long)smp_processor_id());
16701670 register_cpu_notifier(&hrtimers_nb);
16711671 #ifdef CONFIG_HIGH_RES_TIMERS
1672− open_softirq(HRTIMER_SOFTIRQ, run_hrtimer_softirq, NULL);
1672+ open_softirq(HRTIMER_SOFTIRQ, run_hrtimer_softirq);
16731673 #endif
16741674 }
16751675
kernel/rcuclassic.c+1−1
@@ -529,7 +529,7 @@ static void __cpuinit rcu_online_cpu(int cpu) · 528 unmodified lines
529529
530530 rcu_init_percpu_data(cpu, &rcu_ctrlblk, rdp);
531531 rcu_init_percpu_data(cpu, &rcu_bh_ctrlblk, bh_rdp);
532− open_softirq(RCU_SOFTIRQ, rcu_process_callbacks, NULL);
532+ open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
533533 }
534534
535535 static int __cpuinit rcu_cpu_notify(struct notifier_block *self,
kernel/rcupreempt.c+1−1
@@ -1125,7 +1125,7 @@ void __init __rcu_init(void) · 1124 unmodified lines
11251125 for_each_online_cpu(cpu)
11261126 rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, (void *)(long) cpu);
11271127
1128− open_softirq(RCU_SOFTIRQ, rcu_process_callbacks, NULL);
1128+ open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
11291129 }
11301130
11311131 /*
kernel/sched.c+1−1
@@ -8154,7 +8154,7 @@ void __init sched_init(void) · 8153 unmodified lines
81548154 #endif
81558155
81568156 #ifdef CONFIG_SMP
8157− open_softirq(SCHED_SOFTIRQ, run_rebalance_domains, NULL);
8157+ open_softirq(SCHED_SOFTIRQ, run_rebalance_domains);
81588158 #endif
81598159
81608160 #ifdef CONFIG_RT_MUTEXES
kernel/softirq.c+3−4
@@ -347,9 +347,8 @@ void raise_softirq(unsigned int nr) · 346 unmodified lines
347347 local_irq_restore(flags);
348348 }
349349
350−void open_softirq(int nr, void (*action)(struct softirq_action*), void *data)
350+void open_softirq(int nr, void (*action)(struct softirq_action *))
351351 {
352− softirq_vec[nr].data = data;
353352 softirq_vec[nr].action = action;
354353 }
355354
@@ -503,8 +502,8 @@ void __init softirq_init(void) · 147 unmodified lines
503502 &per_cpu(tasklet_hi_vec, cpu).head;
504503 }
505504
506− open_softirq(TASKLET_SOFTIRQ, tasklet_action, NULL);
507− open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL);
505+ open_softirq(TASKLET_SOFTIRQ, tasklet_action);
506+ open_softirq(HI_SOFTIRQ, tasklet_hi_action);
508507 }
509508
510509 static int ksoftirqd(void * __bind_cpu)
kernel/timer.c+1−1
@@ -1502,7 +1502,7 @@ void __init init_timers(void) · 1501 unmodified lines
15021502
15031503 BUG_ON(err == NOTIFY_BAD);
15041504 register_cpu_notifier(&timers_nb);
1505− open_softirq(TIMER_SOFTIRQ, run_timer_softirq, NULL);
1505+ open_softirq(TIMER_SOFTIRQ, run_timer_softirq);
15061506 }
15071507
15081508 /**
net/core/dev.c+2−2
@@ -4563,8 +4563,8 @@ static int __init net_dev_init(void) · 4562 unmodified lines
45634563
45644564 dev_boot_phase = 0;
45654565
4566− open_softirq(NET_TX_SOFTIRQ, net_tx_action, NULL);
4567− open_softirq(NET_RX_SOFTIRQ, net_rx_action, NULL);
4566+ open_softirq(NET_TX_SOFTIRQ, net_tx_action);
4567+ open_softirq(NET_RX_SOFTIRQ, net_rx_action);
45684568
45694569 hotcpu_notifier(dev_cpu_callback, 0);
45704570 dst_init();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t