History

kvfree_rcu: Make krc_this_cpu_unlock() use raw_spin_unlock_irqrestore()

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.

Paul E. McKenney committed 5 years ago

Commit 7ffc9ec1 parent b01b4051 file · +1 −2Browse files

Unified · Split

kernel/rcu/tree.c+1−2
@@ -3229,8 +3229,7 @@ krc_this_cpu_lock(unsigned long *flags) · 3228 unmodified lines
32293229 static inline void
32303230 krc_this_cpu_unlock(struct kfree_rcu_cpu *krcp, unsigned long flags)
32313231 {
3232− raw_spin_unlock(&krcp->lock);
3233− local_irq_restore(flags);
3232+ raw_spin_unlock_irqrestore(&krcp->lock, flags);
32343233 }
32353234
32363235 static inline struct kvfree_rcu_bulk_data *

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