On 20/05/2024 15:11, Luca Fancellu wrote:
>
>
>>>
>>>>
>>>>> + struct shmem_membank_extra *bank_extra_info;
>>>>> +} alloc_heap_pages_cb_extra;
>>>>> +
>>>>> +static struct meminfo __initdata shm_heap_banks = {
>>>>> + .common.max_banks = NR_MEM_BANKS
>>>> Do we expect that many banks?
>>>
>>> Not really, but I was trying to don’t introduce another type, do you think
>>> it’s better instead to
>>> introduce a new type only here, with a lower amount of banks?
>> I'd be ok with meminfo provided you add a reasoning behind this being
>> meminfo and not shared_meminfo.
>>
>>>
>>> Because if we take struct shared_meminfo, we would waste mem for its
>>> ‘extra’ member.
>> Would it result in a smaller footprint overall?
>
> Well overall yes, meminfo now is 255 banks, shared_meminfo is 64 in total,
> even if we use 32 of them and
> 32 are wasted.
>
> Otherwise, as I said, I could do something like this in this module:
>
> static struct shared_heap_meminfo {
> struct membanks_hdr common;
> struct membank bank[NR_SHMEM_BANKS];
> } __initdata shm_heap_banks = {
> .common.max_banks = NR_SHMEM_BANKS
> };
If that's all it takes to avoid defining unnecessarily big variable, then I'd
be ok with it.
~Michal