Hari Bathini <hbath...@linux.vnet.ibm.com> writes:

> Around 95% of memory is reserved by fadump/capture kernel. All this
> memory is freed, one page at a time, on writing '1' to the node
> /sys/kernel/fadump_release_mem. On systems with large memory, this
> can take a long time to complete, leading to soft lockup warning
> messages. To avoid this, add reschedule points at regular intervals.
>
> Suggested-by: Michael Ellerman <m...@ellerman.id.au>
> Signed-off-by: Hari Bathini <hbath...@linux.vnet.ibm.com>
> ---
>  arch/powerpc/kernel/fadump.c |   60 
> ++++++++++++++++++++++++++++++++++--------
>  1 file changed, 49 insertions(+), 11 deletions(-)

I'm not sure this needs to be this complicated?

Can we just do something like:

        for (i = 0, addr = begin; addr < end; addr += PAGE_SIZE, i++) {
                /*
                 * exclude the dump reserve area. Will reuse it for next
                 * fadump registration.
                 */
                if (addr <= ra_end && ((addr + PAGE_SIZE) > ra_start))
                        continue;

                free_reserved_page(pfn_to_page(addr >> PAGE_SHIFT));

                if (time_after(jiffies, time_limit)) {
                        cond_resched();
                        time_limit = jiffies + HZ;
                }
        }

cheers

Reply via email to