open-power / skiboot

OPAL boot and runtime firmware for POWER
Apache License 2.0
100 stars 134 forks source link

if l->len == 16G,mem_clear_njobs will be added twice #274

Closed wongkq closed 1 year ago

wongkq commented 1 year ago

https://github.com/open-power/skiboot/blob/80e2b1dc7396d5a02d14b90cd6e86dfbacd85d1d/core/mem_region.c#L1317 if l->len == 16G, mem_clear_njobs will be added twice,but when assigned for job_args[i], it is only assigned once。Is this a bug?

rarbab commented 1 year ago

I haven't verified to be sure, but from examining the code I think it may be a bug. It should probably be something like

        mem_clear_njobs += (r->len - 1) / MEM_REGION_CLEAR_JOB_SIZE;

I don't think this causes any functional problem, it just means we allocate more than is needed here: https://github.com/open-power/skiboot/blob/80e2b1dc7396d5a02d14b90cd6e86dfbacd85d1d/core/mem_region.c#L1320-L1321

wongkq commented 1 year ago

thanks