1. 09 Feb, 2021 4 commits
  2. 04 Feb, 2021 9 commits
  3. 03 Feb, 2021 4 commits
  4. 27 Jan, 2021 6 commits
  5. 25 Jan, 2021 6 commits
  6. 22 Jan, 2021 7 commits
  7. 19 Jan, 2021 2 commits
  8. 18 Jan, 2021 2 commits
    • Alexander Lobakin's avatar
      MIPS: relocatable: optimize the relocation process · d9e84fb1
      Alexander Lobakin authored
      For now, vmlinux relocation functions for relocatable kernel are
      implemented as an array of handlers of a particular type.
      
      Convert that array into a single switch-case function to:
       - remove unused arguments;
       - change the return type of simple handlers to void;
       - remove the array and don't use any data at all;
       - avoid using indirect calls;
       - allow the compiler to inline and greatly optimize
         the relocation function[s];
      
      and also mark do_relocations() and show_kernel_relocation() static
      as they aren't used anywhere else.
      
      The result on MIPS32 R2 with GCC 10.2 -O2 is:
      
      scripts/bloat-o-meter -c arch/mips/kernel/__relocate.o arch/mips/kernel/relocate.o
      add/remove: 0/6 grow/shrink: 1/0 up/down: 356/-640 (-284)
      Function                                     old     new   delta
      relocate_kernel                              852    1208    +356
      apply_r_mips_32_rel                           20       -     -20
      apply_r_mips_hi16_rel                         40       -     -40
      apply_r_mips_64_rel                           44       -     -44
      apply_r_mips_26_rel                          144       -    -144
      show_kernel_relocation                       164       -    -164
      do_relocations                               228       -    -228
      Total: Before=1780, After=1496, chg -15.96%
      add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-76 (-76)
      Data                                         old     new   delta
      reloc_handlers_rel                            76       -     -76
      Total: Before=92, After=16, chg -82.61%
      add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0)
      RO Data                                      old     new   delta
      Total: Before=0, After=0, chg +0.00%
      
      All functions were collapsed into the main one, relocate_kernel().
      Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      d9e84fb1
    • Alexander Lobakin's avatar
      MIPS: module: optimize module relocations processing · 049a68ef
      Alexander Lobakin authored
      For now, module relocation functions are implemented as an array
      of handlers of type reloc_handler_t.
      
      Convert that array into a single switch-case function to:
       - remove unused arguments;
       - change the return type of simple handlers to void;
       - remove the array and don't use any data at all;
       - avoid using indirect calls;
       - allow the compiler to inline and greatly optimize
         the relocation function[s].
      
      The result on MIPS32 R2 with GCC 10.2 -O2 is:
      
      scripts/bloat-o-meter -c arch/mips/kernel/__module.o arch/mips/kernel/module.o
      add/remove: 1/11 grow/shrink: 1/0 up/down: 876/-1436 (-560)
      Function                                     old     new   delta
      apply_relocate                               456    1148    +692
      apply_r_mips_pc                                -     184    +184
      apply_r_mips_none                              8       -      -8
      apply_r_mips_32                               16       -     -16
      apply_r_mips_64                               76       -     -76
      apply_r_mips_highest                          88       -     -88
      apply_r_mips_higher                          108       -    -108
      apply_r_mips_26                              132       -    -132
      apply_r_mips_pc26                            160       -    -160
      apply_r_mips_pc21                            160       -    -160
      apply_r_mips_pc16                            160       -    -160
      apply_r_mips_hi16                            172       -    -172
      apply_r_mips_lo16                            356       -    -356
      Total: Before=2608, After=2048, chg -21.47%
      add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0)
      Data                                         old     new   delta
      Total: Before=12, After=12, chg +0.00%
      add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-248 (-248)
      RO Data                                      old     new   delta
      reloc_handlers                               248       -    -248
      Total: Before=248, After=0, chg -100.00%
      
      All functions were collapsed into a single one that is called
      directly by $(srctree)/kernel/module.c.
      Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
      Reviewed-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      049a68ef