Re: [PATCH v2] kbuild: Add inline-account tool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> > +    sym_sizes = [syms[x + 1] - syms[x] for x, _ in enumerate(syms[:-1])]
> > +    sym_total = sum(sym_sizes)
> 
> 
> This is equivalent to
> 
>       sym_total = syms[-1] - syms[0]
> 
> isn't it?

No it's not when there are gaps in the symbols, which always happens in
the kernel.  The previous version used the range but that led to inbalances.

> def get_ranges(syms, threads):
> 
>     ranges = []
>     prev = syms[0]
>     i = 1
> 
>     while threads > 0:
> 
>         boundary = prev + 1 + (syms[-1] - prev - 1) // threads
> 
>         while syms[i] < boundary:
>             i += 1


Note the boundary is not the address, but the sum of symbol sizes


-Andi




[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux