OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: "Eva Kurchatova (Virtuozzo)" <eva.kurchatova@virtuozzo.com>
To: devel@openvz.org
Subject: Re: [Devel] [PATCH vz10] selftests/damon: wait for the merge to apply the new max_nr_regions
Date: Tue, 1 Sep 2026 02:22:52 +0300	[thread overview]
Message-ID: <ac714201-cb0b-45b1-ab99-5f9e2a98cdd8@virtuozzo.com> (raw)
In-Reply-To: <20260821151326.794546-1-eva.kurchatova@virtuozzo.com>


On 8/21/26 18:13, Eva Kurchatova wrote:
> damon_nr_regions sleeps 0.3s after committing max_nr_regions and then
> reads the number of regions back, which assumes the merge has happened
> by then.  On a machine that is not idle it has not, and the test fails
> on a region count that is still the old one.
>
> Poll until the count settles instead of sleeping for a fixed time.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-132453
> Feature: fix selftests
> Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
> ---
>   .../selftests/damon/damon_nr_regions.py       | 35 +++++++++++--------
>   1 file changed, 20 insertions(+), 15 deletions(-)
>
> diff --git a/tools/testing/selftests/damon/damon_nr_regions.py b/tools/testing/selftests/damon/damon_nr_regions.py
> index cb31cd140d22..39063ce5b27d 100755
> --- a/tools/testing/selftests/damon/damon_nr_regions.py
> +++ b/tools/testing/selftests/damon/damon_nr_regions.py
> @@ -4,6 +4,7 @@
>   import subprocess
>   import time
>   
> +
>   import _damon_sysfs
>   
>   def test_nr_regions(real_nr_regions, min_nr_regions, max_nr_regions):
> @@ -114,27 +115,31 @@ def main():
>           proc.terminate()
>           print('commit failed: %s' % err)
>           exit(1)
> -    # wait for next merge operation is executed
> -    time.sleep(0.3)
> +    # wait for the merge operations to apply the new max_nr_regions
> +    nr_tried_regions = 0
> +    for _ in range(50):
> +        time.sleep(0.1)
>   
> -    err = kdamonds.kdamonds[0].update_schemes_tried_regions()
> -    if err is not None:
> -        proc.terminate()
> -        print('tried regions update failed: %s' % err)
> -        exit(1)
> +        err = kdamonds.kdamonds[0].update_schemes_tried_regions()
> +        if err is not None:
> +            proc.terminate()
> +            print('tried regions update failed: %s' % err)
> +            exit(1)
>   
> -    scheme = kdamonds.kdamonds[0].contexts[0].schemes[0]
> -    if scheme.tried_regions is None:
> -        proc.terminate()
> -        print('tried regions is not collected')
> -        exit(1)
> +        scheme = kdamonds.kdamonds[0].contexts[0].schemes[0]
> +        if scheme.tried_regions is None:
> +            proc.terminate()
> +            print('tried regions is not collected')
> +            exit(1)
> +
> +        nr_tried_regions = len(scheme.tried_regions)
> +        if 0 < nr_tried_regions <= 7:
> +            break
> +    proc.terminate()
>   
> -    nr_tried_regions = len(scheme.tried_regions)
>       if nr_tried_regions <= 0:
> -        proc.terminate()
>           print('tried regions is not created')
>           exit(1)
> -    proc.terminate()
>   
>       if nr_tried_regions > 7:
>           print('fail online-tuned max_nr_regions: %d > 7' % nr_tried_regions)

Sent v2, replacing this commit with two upstream backports: 
https://lists.openvz.org/pipermail/devel/2026-September/084959.html

Verification: 
https://bitbucket.org/virtuozzocore/vzkernel.vzspecs/pipelines/results/609


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

      reply	other threads:[~2026-08-31 23:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 15:13 Eva Kurchatova
2026-08-31 23:22 ` Eva Kurchatova (Virtuozzo) [this message]

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=ac714201-cb0b-45b1-ab99-5f9e2a98cdd8@virtuozzo.com \
    --to=eva.kurchatova@virtuozzo.com \
    --cc=devel@openvz.org \
    /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