RE: [PATCH 1/2] makedumpfile: omit unnecessary calls to print_progress

2022-04-07 Thread 萩尾 一仁
Hi Philipp,

-Original Message-
> Check first if a page is dumpable before printing the process. Otherwise
> there is the chance that num_dumped % per == 0 at the beginning of the
> block of undampable pages. In that case num_dumped isn't updated before
> the next dumpable page and thus print_process is called for every page
> in that block.
> 
> This is especially annoying when the block is after the last dumpable
> page and thus num_dumped == info->num_dumpable. In that case
> print_process will bypass its check to only print the process once every
> second and thus flood the console with unnecessary prints. This can lead
> to a severe decrease in performance especially when the console is in
> line mode.

Good catch and improvement, will merge this.

Thanks,
Kazu

> 
> Signed-off-by: Philipp Rudo 
> ---
>  makedumpfile.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/makedumpfile.c b/makedumpfile.c
> index 14556db..2ef3458 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -8884,16 +8884,16 @@ write_kdump_pages_cyclic(struct cache_data 
> *cd_header, struct cache_data *cd_pag
> 
>   for (pfn = start_pfn; pfn < end_pfn; pfn++) {
> 
> - if ((num_dumped % per) == 0)
> - print_progress(PROGRESS_COPY, num_dumped, 
> info->num_dumpable, _start);
> -
>   /*
>* Check the excluded page.
>*/
>   if (!is_dumpable(info->bitmap2, pfn, cycle))
>   continue;
> 
> + if ((num_dumped % per) == 0)
> + print_progress(PROGRESS_COPY, num_dumped, 
> info->num_dumpable, _start);
>   num_dumped++;
> +
>   if (!read_pfn(pfn, buf))
>   goto out;
> 
> --
> 2.35.1

___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec


[PATCH 1/2] makedumpfile: omit unnecessary calls to print_progress

2022-04-04 Thread Philipp Rudo
Check first if a page is dumpable before printing the process. Otherwise
there is the chance that num_dumped % per == 0 at the beginning of the
block of undampable pages. In that case num_dumped isn't updated before
the next dumpable page and thus print_process is called for every page
in that block.

This is especially annoying when the block is after the last dumpable
page and thus num_dumped == info->num_dumpable. In that case
print_process will bypass its check to only print the process once every
second and thus flood the console with unnecessary prints. This can lead
to a severe decrease in performance especially when the console is in
line mode.

Signed-off-by: Philipp Rudo 
---
 makedumpfile.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 14556db..2ef3458 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -8884,16 +8884,16 @@ write_kdump_pages_cyclic(struct cache_data *cd_header, 
struct cache_data *cd_pag
 
for (pfn = start_pfn; pfn < end_pfn; pfn++) {
 
-   if ((num_dumped % per) == 0)
-   print_progress(PROGRESS_COPY, num_dumped, 
info->num_dumpable, _start);
-
/*
 * Check the excluded page.
 */
if (!is_dumpable(info->bitmap2, pfn, cycle))
continue;
 
+   if ((num_dumped % per) == 0)
+   print_progress(PROGRESS_COPY, num_dumped, 
info->num_dumpable, _start);
num_dumped++;
+
if (!read_pfn(pfn, buf))
goto out;
 
-- 
2.35.1


___
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec