Re: [igt-dev] [PATCH i-g-t] lib/aux: Ensure swap space prior to suspend to disk

Hiatt, Don
2019-11-26T17:05:53Z

> From: Latvala, Petri <petri.latvala@intel.com>
> Sent: Tuesday, November 26, 2019 1:53 AM
> To: Sundaresan, Sujaritha <sujaritha.sundaresan@intel.com>
> Cc: Hiatt, Don <don.hiatt@intel.com>; igt-dev@lists.freedesktop.org
> Subject: Re: [igt-dev] [PATCH i-g-t] lib/aux: Ensure swap space prior to suspend
> to disk
>
> On Mon, Nov 25, 2019 at 04:49:47PM -0800, Sujaritha wrote:
> >
> > On 11/21/19 5:10 PM, don.hiatt@intel.com wrote:
> > > From: Don Hiatt <don.hiatt@intel.com>
> > >
> > > Suspending to disk requires swap space, make sure it exists
> > > before attempting to suspend to disk.
> > >
> > > v2: Use igt_skip() [Thanks, Chris!]
> > > v3: Use igt_skip_on_f()
> > >
> > > Cc: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
> > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > > Signed-off-by: Don Hiatt <don.hiatt@intel.com>
> > > ---
> > > lib/igt_aux.c | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> > > index 578f857933f0..a6b114ed7e65 100644
> > > --- a/lib/igt_aux.c
> > > +++ b/lib/igt_aux.c
> > > @@ -864,6 +864,10 @@ void igt_system_suspend_autoresume(enum
> igt_suspend_state state,
> > > igt_require(test == SUSPEND_TEST_NONE ||
> > > faccessat(power_dir, "pm_test", R_OK | W_OK, 0) == 0);
> > > + igt_skip_on_f(state == SUSPEND_STATE_DISK &&
> > > + !intel_get_total_swap_mb(),
> > > + "Suspend to disk requires swap space.\n");
> > > +
> > > orig_test = get_suspend_test(power_dir);
> > > set_suspend_test(power_dir, test);
> >
> >
> > This should help fix part of the reason for the suspend tests failing on CI.
>
>
> If your goal is to enable s4 tests on CI, you still have quite a bit
> of work ahead of you.
>
> CI uses swap _files_. Suspending to swap files does work, if your
> system is configured for the location of the swap space within the
> block device (the resume_offset command line parameter). That hasn't
> been configured at this time.
>
> Possible further complications can arise from CI not using an initrd,
> which presumably rules out using uswsusp to automate a lot of the
> resume setup.
>
>

Hi Petri,

That's not the current goal. I mostly want the warning on systems (e.g. RIL) that
don't have any swap at all setup as I keep getting stung by it. 😊

Thanks!

don

> --
> Petri Latvala