public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Moon Hee Lee <moonhee.lee.ca@gmail.com>, shuah@kernel.org
Cc: yifei.l.liu@oracle.com, zhujun2@cmss.chinamobile.com,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] selftests: breakpoints: use suspend_stats to reliably check suspend success
Date: Thu, 10 Jul 2025 14:25:38 -0600	[thread overview]
Message-ID: <78cd5960-ea18-4e18-9f13-fb3c513014f2@linuxfoundation.org> (raw)
In-Reply-To: <20250626191626.36794-1-moonhee.lee.ca@gmail.com>

On 6/26/25 13:16, Moon Hee Lee wrote:
> The step_after_suspend_test verifies that the system successfully
> suspended and resumed by setting a timerfd and checking whether the
> timer fully expired. However, this method is unreliable due to timing
> races.
> 
> In practice, the system may take time to enter suspend, during which the
> timer may expire just before or during the transition. As a result,
> the remaining time after resume may show non-zero nanoseconds, even if
> suspend/resume completed successfully. This leads to false test failures.
> 
> Replace the timer-based check with a read from
> /sys/power/suspend_stats/success. This counter is incremented only
> after a full suspend/resume cycle, providing a reliable and race-free
> indicator.
> 
> Also remove the unused file descriptor for /sys/power/state, which
> remained after switching to a system() call to trigger suspend [1].
> 
> [1] https://lore.kernel.org/all/20240930224025.2858767-1-yifei.l.liu@oracle.com/
> 
> Fixes: c66be905cda2 ("selftests: breakpoints: use remaining time to check if suspend succeed")
> Signed-off-by: Moon Hee Lee <moonhee.lee.ca@gmail.com>
> ---

Applied to linux-kselftest next branch for Linux 6.17-rc1

thanks,
-- Shuah

  reply	other threads:[~2025-07-10 20:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 19:16 [PATCH] selftests: breakpoints: use suspend_stats to reliably check suspend success Moon Hee Lee
2025-07-10 20:25 ` Shuah Khan [this message]
2025-08-01 12:39 ` Olivier Blin
2025-08-01 15:27   ` Moon Hee Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78cd5960-ea18-4e18-9f13-fb3c513014f2@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=moonhee.lee.ca@gmail.com \
    --cc=shuah@kernel.org \
    --cc=yifei.l.liu@oracle.com \
    --cc=zhujun2@cmss.chinamobile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox