mbox series

[RFC,v6,0/7] Speed booting by sorting ORC unwind tables at build time

Message ID 20191204004633.88660-1-shile.zhang@linux.alibaba.com (mailing list archive)
Headers show
Series Speed booting by sorting ORC unwind tables at build time | expand

Message

Shile Zhang Dec. 4, 2019, 12:46 a.m. UTC
Hi,

Sorry, update for compile error fix, reported by Intel's kbuild test robot.
Any comments or suggestions are welcome!

Thanks!

Changelog:
==========
v5->v6:
- fix compile error reported by kbuild test robot;

v4->v5:
- replace sort with qsort, suggested by Andy Lutomirski <luto@amacapital.net>;
- add error handling in link scripts;
- fixed some review findings;
https://lore.kernel.org/lkml/20191128110206.2107-1-shile.zhang@linux.alibaba.com/

v3->v4:
- Code refactored for Peter's review findings and suggestions.
https://lore.kernel.org/lkml/20191115164539.57930-1-shile.zhang@linux.alibaba.com/

v2->v3:
- Discard new added sortorctable tool and related Kconfig changes.
- Refactored sortextable, makes it more readable and extendable.
- Rename 'sortextable' to 'sorttable', for more kernel tables extend.
- Add ORC unwind tables sort into sorttable.
- Remove the runtime ORC tables sort.
https://lore.kernel.org/lkml/20191115064750.47888-1-shile.zhang@linux.alibaba.com/

v1->v2:
- Removed new added Kconfig and runtime sort code, advised by Josh Poimboeuf.
- Some minor refactoring.
https://lore.kernel.org/lkml/20191108071108.72132-1-shile.zhang@linux.alibaba.com/

v1:
- Added a new sortorctable tool to sort ORC unwind tables at build time,
  same as sortextable.
- Add a new Kconfigure to control if ORC unwind tables sort at build
  time.
https://lore.kernel.org/lkml/20191107143205.206606-1-shile.zhang@linux.alibaba.com/

Shile Zhang (7):
  scripts/sortextable: Rewrite error/success handling
  scripts/sortextable: kernel coding style formating
  scripts/sortextable: Remove dead code
  scripts/sortextable: refactor do_func() function
  scripts/sorttable: rename sortextable to sorttable
  scripts/sorttable: Add ORC unwind tables sort concurrently
  x86/unwind/orc: remove run-time ORC unwind tables sort

 arch/arc/Kconfig                       |   2 +-
 arch/arm/Kconfig                       |   2 +-
 arch/arm64/Kconfig                     |   2 +-
 arch/microblaze/Kconfig                |   2 +-
 arch/mips/Kconfig                      |   2 +-
 arch/parisc/Kconfig                    |   2 +-
 arch/powerpc/Kconfig                   |   2 +-
 arch/s390/Kconfig                      |   2 +-
 arch/x86/Kconfig                       |   2 +-
 arch/x86/kernel/unwind_orc.c           |   8 +-
 arch/xtensa/Kconfig                    |   2 +-
 init/Kconfig                           |   2 +-
 scripts/.gitignore                     |   2 +-
 scripts/Makefile                       |  13 +-
 scripts/link-vmlinux.sh                |  13 +-
 scripts/sortextable.h                  | 209 --------------
 scripts/{sortextable.c => sorttable.c} | 305 +++++++++-----------
 scripts/sorttable.h                    | 380 +++++++++++++++++++++++++
 18 files changed, 557 insertions(+), 395 deletions(-)
 delete mode 100644 scripts/sortextable.h
 rename scripts/{sortextable.c => sorttable.c} (67%)
 create mode 100644 scripts/sorttable.h

Comments

Shile Zhang Dec. 13, 2019, 6:03 a.m. UTC | #1
Hi Peter, Ingo,

Sorry for ping,
but how about this series? or what can I do next?

Thanks!

On 2019/12/4 08:46, Shile Zhang wrote:
> Hi,
>
> Sorry, update for compile error fix, reported by Intel's kbuild test robot.
> Any comments or suggestions are welcome!
>
> Thanks!
>
> Changelog:
> ==========
> v5->v6:
> - fix compile error reported by kbuild test robot;
>
> v4->v5:
> - replace sort with qsort, suggested by Andy Lutomirski <luto@amacapital.net>;
> - add error handling in link scripts;
> - fixed some review findings;
> https://lore.kernel.org/lkml/20191128110206.2107-1-shile.zhang@linux.alibaba.com/
>
> v3->v4:
> - Code refactored for Peter's review findings and suggestions.
> https://lore.kernel.org/lkml/20191115164539.57930-1-shile.zhang@linux.alibaba.com/
>
> v2->v3:
> - Discard new added sortorctable tool and related Kconfig changes.
> - Refactored sortextable, makes it more readable and extendable.
> - Rename 'sortextable' to 'sorttable', for more kernel tables extend.
> - Add ORC unwind tables sort into sorttable.
> - Remove the runtime ORC tables sort.
> https://lore.kernel.org/lkml/20191115064750.47888-1-shile.zhang@linux.alibaba.com/
>
> v1->v2:
> - Removed new added Kconfig and runtime sort code, advised by Josh Poimboeuf.
> - Some minor refactoring.
> https://lore.kernel.org/lkml/20191108071108.72132-1-shile.zhang@linux.alibaba.com/
>
> v1:
> - Added a new sortorctable tool to sort ORC unwind tables at build time,
>    same as sortextable.
> - Add a new Kconfigure to control if ORC unwind tables sort at build
>    time.
> https://lore.kernel.org/lkml/20191107143205.206606-1-shile.zhang@linux.alibaba.com/
>
> Shile Zhang (7):
>    scripts/sortextable: Rewrite error/success handling
>    scripts/sortextable: kernel coding style formating
>    scripts/sortextable: Remove dead code
>    scripts/sortextable: refactor do_func() function
>    scripts/sorttable: rename sortextable to sorttable
>    scripts/sorttable: Add ORC unwind tables sort concurrently
>    x86/unwind/orc: remove run-time ORC unwind tables sort
>
>   arch/arc/Kconfig                       |   2 +-
>   arch/arm/Kconfig                       |   2 +-
>   arch/arm64/Kconfig                     |   2 +-
>   arch/microblaze/Kconfig                |   2 +-
>   arch/mips/Kconfig                      |   2 +-
>   arch/parisc/Kconfig                    |   2 +-
>   arch/powerpc/Kconfig                   |   2 +-
>   arch/s390/Kconfig                      |   2 +-
>   arch/x86/Kconfig                       |   2 +-
>   arch/x86/kernel/unwind_orc.c           |   8 +-
>   arch/xtensa/Kconfig                    |   2 +-
>   init/Kconfig                           |   2 +-
>   scripts/.gitignore                     |   2 +-
>   scripts/Makefile                       |  13 +-
>   scripts/link-vmlinux.sh                |  13 +-
>   scripts/sortextable.h                  | 209 --------------
>   scripts/{sortextable.c => sorttable.c} | 305 +++++++++-----------
>   scripts/sorttable.h                    | 380 +++++++++++++++++++++++++
>   18 files changed, 557 insertions(+), 395 deletions(-)
>   delete mode 100644 scripts/sortextable.h
>   rename scripts/{sortextable.c => sorttable.c} (67%)
>   create mode 100644 scripts/sorttable.h
>
Ingo Molnar Dec. 13, 2019, 10:02 a.m. UTC | #2
* Shile Zhang <shile.zhang@linux.alibaba.com> wrote:

> Hi,
> 
> Sorry, update for compile error fix, reported by Intel's kbuild test robot.
> Any comments or suggestions are welcome!

Could you please send a delta patch to fix these new build warnings on 
64-bit allnoconfig kernels:

  arch/x86/kernel/unwind_orc.c:210:12: warning: ‘orc_sort_cmp’ defined but not used [-Wunused-function]
  arch/x86/kernel/unwind_orc.c:190:13: warning: ‘orc_sort_swap’ defined but not used [-Wunused-function]

Thanks,

	Ingo
Shile Zhang Dec. 16, 2019, 3:07 a.m. UTC | #3
On 2019/12/13 18:02, Ingo Molnar wrote:
>    arch/x86/kernel/unwind_orc.c:210:12: warning: ‘orc_sort_cmp’ defined but not used [-Wunused-function]
>    arch/x86/kernel/unwind_orc.c:190:13: warning: ‘orc_sort_swap’ defined but not used [-Wunused-function]
Hi Ingo,

Sorry for trouble! please help to check the warning-fix patch.
Thanks!

---
 From b3d34213b4fe5a9cf2efcc1c758a5fb6c5f7676b Mon Sep 17 00:00:00 2001
From: Shile Zhang <shile.zhang@linux.alibaba.com>
Date: Mon, 16 Dec 2019 10:56:03 +0800
Subject: [PATCH] x86/unwind/orc: fix build warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

To fix follwowing warning due to ORC sort moved to build time:

arch/x86/kernel/unwind_orc.c:210:12: warning: ‘orc_sort_cmp’ defined but 
not used [-Wunused-function]
arch/x86/kernel/unwind_orc.c:190:13: warning: ‘orc_sort_swap’ defined 
but not used [-Wunused-function]

Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
---
  arch/x86/kernel/unwind_orc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index 280da6fa9922..2391874b724a 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -187,6 +187,7 @@ static struct orc_entry *orc_find(unsigned long ip)
         return orc_ftrace_find(ip);
  }

+#ifdef CONFIG_MODULES
  static void orc_sort_swap(void *_a, void *_b, int size)
  {
         struct orc_entry *orc_a, *orc_b;
@@ -229,7 +230,6 @@ static int orc_sort_cmp(const void *_a, const void *_b)
         return orc_a->sp_reg == ORC_REG_UNDEFINED && !orc_a->end ? -1 : 1;
  }

-#ifdef CONFIG_MODULES
  void unwind_module_init(struct module *mod, void *_orc_ip, size_t 
orc_ip_size,
                         void *_orc, size_t orc_size)
  {
--
2.24.0.rc2