lkml.org 
[lkml]   [2022]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v8 4/9] kallsyms: Reduce the memory occupied by kallsyms_seqs_of_names[]
From
Date


On 2022/11/2 20:00, David Laight wrote:
> From: Zhen Lei
>> Sent: 02 November 2022 08:49
>>
>> kallsyms_seqs_of_names[] records the symbol index sorted by address, the
>> maximum value in kallsyms_seqs_of_names[] is the number of symbols. And
>> 2^24 = 16777216, which means that three bytes are enough to store the
>> index. This can help us save (1 * kallsyms_num_syms) bytes of memory.
>
> You can get the compiler to do the 'heavy lifting' for you.
>
> struct uint24 {
> unsigned int val24:24;
> } __attribute__((packed));

This method depends on byte order. If the byte order of the tool is
different from that of the kernel, it's a problem. For example,
cross-compile PowerPC kernel on x86.

>
> struct uint24 table[1024];
>
> works fine.
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
>
> .
>

--
Regards,
Zhen Lei

\
 
 \ /
  Last update: 2022-11-07 09:02    [W:0.068 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site