The krc_this_cpu_unlock() function does a raw_spin_unlock() immediately followed by a local_irq_restore(). This commit saves a line of code by merging them into a raw_spin_unlock_irqrestore(). This transformation also reduces scheduling latency because raw_spin_unlock_irqrestore() responds immediately to a reschedule request. In contrast, local_irq_restore() does a scheduling-oblivious enabling of interrupts.
Unified · Split
| @@ -3229,8 +3229,7 @@ krc_this_cpu_lock(unsigned long *flags) · 3228 unmodified lines | ||
| 3229 | 3229 | static inline void |
| 3230 | 3230 | krc_this_cpu_unlock(struct kfree_rcu_cpu *krcp, unsigned long flags) |
| 3231 | 3231 | { |
| 3232 | − raw_spin_unlock(&krcp->lock); | |
| 3233 | − local_irq_restore(flags); | |
| 3232 | + raw_spin_unlock_irqrestore(&krcp->lock, flags); | |
| 3234 | 3233 | } |
| 3235 | 3234 | |
| 3236 | 3235 | static inline struct kvfree_rcu_bulk_data * |