fs/proc/internal.h: shuffle "struct pde_opener"
authorAlexey Dobriyan <adobriyan@gmail.com>
Thu, 5 Dec 2019 00:50:05 +0000 (16:50 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Dec 2019 03:44:11 +0000 (19:44 -0800)
List iteration takes more code than anything else which means embedded
list_head should be the first element of the structure.

Space savings:

add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-18 (-18)
Function                                     old     new   delta
close_pdeo                                   228     227      -1
proc_reg_release                              86      82      -4
proc_entry_rundown                           143     139      -4
proc_reg_open                                298     289      -9

Link: http://lkml.kernel.org/r/20191004234753.GB30246@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/internal.h

index cd0c8d5ce9a13a5b4f277a649413af1770b53938..0f3b557c9b7716b0ccd495eeaba92de4370d6981 100644 (file)
@@ -197,8 +197,8 @@ extern ssize_t proc_simple_write(struct file *, const char __user *, size_t, lof
  * inode.c
  */
 struct pde_opener {
-       struct file *file;
        struct list_head lh;
+       struct file *file;
        bool closing;
        struct completion *c;
 } __randomize_layout;