Re: [PATCH 1/3] PM: hibernate: Print speed statistics of copy_data_pages()
From: F. R. A. Prado
Date: Mon Jun 01 2026 - 17:15:55 EST
On Tue, 2026-05-26 at 13:25 +0200, Rafael J. Wysocki wrote:
> On Mon, May 18, 2026 at 11:34 PM Nícolas F. R. A. Prado
> <nfraprado@xxxxxxxxxxxxx> wrote:
> >
> > copy_data_pages() can take a long (multi-second) time to finish,
> > and
> > currently the only indication of that is the timestamp difference
> > between print messages right before and right after. The timestamp
> > is
> > also immediately reset afterwards to the time before image
> > creation,
> > making it even harder to spot this delay. And this function runs in
> > a
> > critical section with a single CPU online and syscore suspended, so
> > it
> > should be kept as quick as possible to keep the system responsive.
> >
> > Call into swsusp_show_speed() to report the amount of data, time
> > taken,
> > and copy speed of copy_data_pages() to make it easier to spot
> > delays and
> > verify performance improvements. The current time is obtained
> > through
> > sched_clock() instead of ktime_get() since timekeeping is suspended
> > in
> > this region.
>
> Why not use local_clock() for this?
No particular reason. I'll switch to it for the next version.
Thanks,
Nícolas