lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <85abe498-f241-4752-81b5-6c0314f5a1e8@linux.alibaba.com>
Date:   Fri, 8 Nov 2019 09:42:55 +0800
From:   Shile Zhang <shile.zhang@...ux.alibaba.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Michal Marek <michal.lkml@...kovi.net>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Josh Poimboeuf <jpoimboe@...hat.com>, x86@...nel.org,
        "H . Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
        linux-kbuild@...r.kernel.org
Subject: Re: [RFC PATCH 0/4] Speed booting by sorting ORC unwind tables at
 build time



On 2019/11/7 23:22, Peter Zijlstra wrote:
> On Thu, Nov 07, 2019 at 10:32:01PM +0800, shile.zhang@...ux.alibaba.com wrote:
>> From: Shile Zhang <shile.zhang@...ux.alibaba.com>
>>
>> Hi,
>>
>> I found the unwind_init taken long time (more than 90ms) in kernel
>> booting, mainly spent on sorting the two ORC unwind tables, orc_unwind
>> and orc_unwind_ip.
>>
>> I also noticed that this issued has reported and discussed last year:
>> https://lkml.org/lkml/2018/10/8/342
>> But seems no final solution until now, I tried to sort the ORC tables at
>> build time, followed the helpful hints from Josh and Ingo in that thread.
>> And mainly referred the implementation of 'sortextable' tool:
>> https://lore.kernel.org/linux-mips/1334872799-14589-1-git-send-email-ddaney.cavm@gmail.com/
>>
>> What I did:
>>
>> - Add a Kconfig to control build-time sorting or runtime sorting;
>> - Referred 'sortextable', create a similar helper tool 'sortorctable',
>>    help to sort the ORC unwind tables at vmlinux link process.
> What is the build-time cost for doing this? The link phase is already a
> fairly big bottleneck for building a kernel.
Hi, Peter, Thanks for your kindly reply!
On my test env, the build-time sort spend about 100ms, which is similar 
to runtime sorting due to the same sorting code. Of course there are few 
compiling cost in sortorctable tool itself. I think the overall cost of 
this build-time sorting is not so much.

I agree with you that the link time of vmlinux shoud be optimized.
But IMHO, for one kernel product release, the kernel building is once 
for all. So put the sorting in build time can save boot time for 
customer, for each booting. I think this is significant for boot time 
sensitive products, such as embedded devices in IoT, or VM in Cloud.
> Can sort{ex,orc}table() be ran concurrently? Do they want to be the same
> (threaded) tool?
I think it is possible to do those sort work concurrently, likes 
deferred memory init which is big boot time speed up.
But I don't know if the exception table and ORC unwind tables can be 
deferred, due to those tables might be used in early boot time, for 
early exception handling and early debugging. I'm not familiar with that.

IMO, the init works in kernel boot time should do the necessary 
runtime-depends initialization, which cannot done out-of-bands. For 
exception, ORC unwind like tables, which does not depends on the runtime 
ENV. It can/should be ready in building time. IOW, this kind of "setup 
cost" should not put on customer.

Thanks again!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ