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

Petri Latvala petri.latvala at intel.com
Tue Nov 26 09:52:59 UTC 2019


On Mon, Nov 25, 2019 at 04:49:47PM -0800, Sujaritha wrote:
> 
> On 11/21/19 5:10 PM, don.hiatt at intel.com wrote:
> > From: Don Hiatt <don.hiatt at 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 at intel.com>
> > Cc: Chris Wilson <chris at chris-wilson.co.uk>
> > Signed-off-by: Don Hiatt <don.hiatt at 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.


-- 
Petri Latvala


More information about the igt-dev mailing list