In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > IT Information >
Share
Shulou(Shulou.com)11/24 Report--
CTOnews.com reported on December 14 that Linux 6.2 today incorporated code from Huawei Zheng Lei (Zhen Lei), increasing the speed of core kernel functions 715 times.
In the introduction to the merge code module, it is written: "thanks to the code of Zhen Lei, Tux (the mascot of Linux, which means Linux) has improved its average lookup performance at kallsyms_lookup_name () by 715 times, upgrading our old implementation from O (n) to O (log (n)) while retaining the old implementation support on / proc / kallsyms."
CTOnews.com learned that the kallsyms_lookup_name () function is used to query the address of a symbol based on its name and can be used to query any symbol in the kernel symbol table.
Huawei's Zhen Lei described the optimization of kallsyms_lookup_name in a previous patch:
Currently, to search for a symbol, we need to expand the symbols in 'kallsyms_names' one by one, and then compare them using the expanded string. This is O (n).
If we sort names in ascending order like addresses, we can also use binary search. And this is O (log (n)).
In order not to change the implementation of "/ proc/ kallsyms", the table kallsyms_names [] is still stored in ascending order corresponding to the address one-to-one.
Add the array kallsyms_seqs_of_names [], which is indexed by the sequence number of the sorted name, and the corresponding content is the sequence number of the sorted address.
For example, suppose that the index of NameX in the array kallsyms_seqs_of_names [] is'I', and the content of NameX is'k', then the corresponding address of NameX is kallsyms_addresses [k]. The offset in kallsyms_names [] is get_symbol_offset (k).
Note that memory usage will increase by (4 * kallsyms_num_syms) bytes, and the next two patches will reduce (1 * kallsyms_num_syms) bytes and properly handle the case of CONFIG_LTO_CLANG=y.
Performance test results (on x86 platform):
Before:
Min=234, max=10364402, avg=5206926
Min=267, max=11168517, avg=5207587
After that:
Min=1016, max=90894, avg=7272
Min=1014, max=93470, avg=7293
The average query performance of kallsyms_lookup_name () is improved by 715 times. This is a major improvement for kallsyms_lookup_name and a Christmas present for Linux 6.2.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.