proc-spread-likely-unlikely-a-bit.patch removed from -mm tree
The patch titled
Subject: proc: spread likely/unlikely a bit
has been removed from the -mm tree. Its filename was
proc-spread-likely-unlikely-a-bit.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Alexey Dobriyan <[email protected]>
Subject: proc: spread likely/unlikely a bit
use_pde() is used at every open/read/write/... of every random /proc file. Negative refcount happens only if PDE is being deleted by module (read: never). So it gets "likely".
unuse_pde() gets "unlikely" for the same reason.
close_pdeo() gets unlikely as the completion is filled only if there is a race between PDE removal and close() (read: never ever).
It even saves code on x86_64 defconfig:
add/remove: 0/0 grow/shrink: 1/2 up/down: 2/-20 (-18)
Function old new delta
close_pdeo 183 185 +2
proc_reg_get_unmapped_area 119 111 -8
proc_reg_poll 85 73 -12
---
fs/proc/inode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/proc/inode.c renamed from fs/proc/inode.c~proc-spread-likely-unlikely-a-bit +4 -4
@@ -129,12 +129,12 @@ enum {BIAS = -1U<<31};static inline int use_pde (struct proc_dir_entry *pde) { -return atomic_inc_unless_negative (&pde->in_use); +return likely (atomic_inc_unless_negative (&pde->in_use)); }static void unuse_pde (struct proc_dir_entry *pde) { -if (atomic_dec_return (&pde->in_use) ==BIAS ) +if (unlikely (atomic_dec_return (&pde->in_use) ==BIAS ))complete (pde->pde_unload_completion); }
@@ -167,7 +167,7 @@ static void close_pdeo(struct proc_dir_espin_lock (&pde->pde_unload_lock);/* After ->release. */ list_del (&pdeo->lh); -if (pdeo->c) +if (unlikely (pdeo->c))complete (pdeo->c);kfree (pdeo); }
@@ -421,7 +421,7 @@ static const char *proc_get_link(struct struct delayed_call *done) {struct proc_dir_entry *pde =PDE (inode); -if (unlikely (!use_pde (pde))) +if (!use_pde (pde))return ERR_PTR (-EINVAL );set_delayed_call (done, proc_put_link, pde);return pde->data;
_
Patches currently in -mm which might be from [email protected] are
seq_file-delete-small-value-optimization.patch