From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 6595D8015C for ; Fri, 18 Sep 2026 10:45:39 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68IAiOst032326; Fri, 18 Sep 2026 13:44:24 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68IAiOst032326 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="Ip4EKI1w" Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68IAiMEx032322 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Fri, 18 Sep 2026 13:44:23 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68IAiMEx032322 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49e635a6002so3819355e9.0 for ; Fri, 18 Sep 2026 03:44:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvByVYV4hcAQHtvb2TMxvW0vjE7Ix2U2AmcWFit68ycAp1rjzrSCaUTNRnE4Eg9zjQT8y9CgUKg==@openvz.org X-Gm-Message-State: AFuF++kZgoe2PmeeALZcWKLuSNU8Oobu87DgX+1129gvupYkelvyObD+ tbTUu5agfT1a3ezsqlMBSVfR6OqZ8aIORQ0g5wXxON3a+EgJQAi3D+95nxOW7KcOO/Qk8BR7p7g gzZrkmzcLE+UXWDNvQLvVj3WKQpb7KHCVaeOWe+WAOHniLCGOPvV01Q== X-Gm-Gg: AYBFou1XDgKqMn4hTJx071w16Mu28/eS9wNqGVu2AZ3luF34FuITO2QcHlWGowHcnGR O5dHjDMEitt+clHjk5l9saiQTql3wuPAM7nqP8e/MvyUYxMMsnnnTbpPKmiVtuo+OsWUvRw3zwG N8wJnKIhyyKhCNJ8tnZku+6CkrUEOJTmQMf3XdblahKkyLWE4GU3DIOVQJTQJSC/EEXpBrNXddh 4MlKkV2y0rpZBo/Zz93KpMtjPsXrNdypTMGXiIl2UNvMG92toSL1m7YXMzaYmU76P8r4zpm9hJ/ nIcbRzf2yjLkhT3rrcJywgqOUbeVde34JB5ZX/N/hY8xpCklnN0rO8kj0BI+Yxn7tyP7Od57P4S ygEib7kvKemVQ1hV8UJ01fEyYPTcZIw== X-Received: by 2002:a05:600c:8b35:b0:49c:fc6c:be0d with SMTP id 5b1f17b1804b1-49fc573602fmr22839555e9.19.1789728262709; Fri, 18 Sep 2026 03:44:22 -0700 (PDT) X-Received: by 2002:a05:600c:8b35:b0:49c:fc6c:be0d with SMTP id 5b1f17b1804b1-49fc573602fmr22839225e9.19.1789728262259; Fri, 18 Sep 2026 03:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1789728262; cv=none; d=google.com; s=arc-20260327; b=O3J97cdL40+jdrJpDzfL1hbi8BSYUq1PYQxXIQ/Zqq6Yt5PiYqxaG5JOT9s+/mBJtP vB3CpVAEaQimSP7MsDp3U7gcb9VqByTNUqFK6Ijh6AlPcBcrOiX2ZtcdOrn6uQ9hvAg2 T9PM+8YdAnLaiTB/ZyZvdVGB3jSFmuIc+FgWhgm8bTM2Zbp/ds2XLIykpHCcrUfC49vz OLQ7TonxoMjB/AkbA3KysyFWUK5WAqz1xSdRKv0/7ZwbPD9hqXhkQXvdjkOrGtPWtUa3 1pcYD67NFpca7k6y+SSqkHD8JlRPZYOkM4MDkDb85XdkssTjoKiMJ706rNY1/0/SO6No MmkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=TaThSajsWt3uDB2ztq8ukQal3bkyg1/4DokgH3Rw/UU=; fh=CTF2GHyV+XdzB5TROrdG4fdLri6JSHNOBC+LNuNq5bA=; b=PrVpH14LbLpThLu5o1T18GD7SL00tniUEXu0SDWZI32CSaNS/IjVvJgEMQnuX7G/Lu el48v6VIeV1o2WZOIVKZ+eup8h5HasOr582cD50IPd7zzYPqbCiZZQUa18kFJwEATkYI qYEWTHuVmsC7yygDp6NL7K2EBQZXMTK/iG2tUd/+lVoiRLCX02D1qaTQNwSz9XSG1fLF iEu1bPS3ZN+X6JGoEkFhAQ/jEkem8WXT6ZHpunPmRFBxX5n4rsu1Ndqtckntk4xv45gh ctDLZhZuqqxvGCIm/gi6EgQ8Bs40e2Y5oA8wd5fJvjpLT+tHQIQNJKF+jeDGI0BsorLp SxzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=Ip4EKI1w; spf=pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vasileios.almpanis@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id 5b1f17b1804b1-49fbd32d385si126273045e9.5.2026.09.18.03.44.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2026 03:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=Ip4EKI1w; spf=pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vasileios.almpanis@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=TaThSajsWt3uDB2ztq8ukQal3bkyg1/4DokgH3Rw/UU=; b=Ip4EKI1wPMPG 7ZXbH865zUoNXxEdIvOEtH0yAOSFNOJHGqBSBY2v1vPvQ//t0fW320IY9+fdJkHNxRtYoU7JGaEMl 12gChV8tCrtcIhjMSqpWGk0BqXkUhyaJsyk6zkguR26v9SrtDRPrwAeJqzDMT2vVJo4Lh0Vu5DE5q h9p0+BZ3y0stgX0cyLVMbHtyODl58kUd42wAmQDF9iG783vX9ZMNULssiYCqeu8cTm0XpArYHjBTE EYIXAoOZ2Nx8Avbbt0LM6rP5OiHuTCBbizMMBB1QfAH/u2xpEGtoL4YmBKQ3MExzjX2IyHXnPcX/o MKHP76QLk7Onw+X7XemYHw==; Received: from [130.117.225.5] (helo=dev010.ch-qa.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x7W24-003Yot-0z; Fri, 18 Sep 2026 12:44:18 +0200 MIME-Version: 1.0 From: Vasileios Almpanis To: Eva Kurchatova In-Reply-To: <20260831224603.1641737-3-eva.kurchatova@virtuozzo.com> References: <20260831224603.1641737-1-eva.kurchatova@virtuozzo.com> <20260831224603.1641737-3-eva.kurchatova@virtuozzo.com> Date: Fri, 18 Sep 2026 10:44:19 +0000 Message-Id: <178972825916.648180.13792516922333639549.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789728261; l=2219; i=vasileios.almpanis@virtuozzo.com; s=20260812; h=from:subject:message-id; bh=DOgE10ybQaJBWyctipNEQtVrT2/KsNmMdk8nmWmySqM=; b=K742SEbkIuL3hRqHI3xQNhBJq0TprlR2bR1tdiTYctkc/GjpK0XCP/d4+KHmEhKDKvPIFJNCp DzjmUSAS2v3C9HpCTQMb1l8y9z8MoD/QXTI13OTmGs8nBuG9sK+Wrrk X-Developer-Key: i=vasileios.almpanis@virtuozzo.com; a=ed25519; pk=HhuHDXAcPva9A8zccWEMRsb36reu+y4IVbBjXKxNUjw= X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH vz10 3/3] selftests: timers: measure the cpu timers on the clock they count X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org > Commit b00385b8d081 ("selftests/posix_timers: Use CLOCK_THREAD_CPUTIME_ID > for ITIMER_PROF measurements") gave ITIMER_PROF the clock it counts, > as measuring a cpu timer against the wall says nothing on a machine > where the task does not have a cpu to itself. The other cpu timers > are still measured against CLOCK_REALTIME and fail the same way. > With four busy loops on the two cpus of a test machine: > > not ok 2 ITIMER_VIRTUAL > not ok 5 timer_create() per CLOCK_THREAD_CPUTIME_ID > not ok 6 timer_create() per CLOCK_PROCESS_CPUTIME_ID > > ITIMER_VIRTUAL counts the time the task spends in userspace, so take > CLOCK_THREAD_CPUTIME_ID for it as well; the loop it runs stays in > userspace, so what that clock adds for system time is far inside the > half a second the check allows. check_timer_create() arms its timer on > the clock it is given, so measure on that one. > > The test then passes whole on that machine, 19 of 19, busy or idle. > > https://virtuozzo.atlassian.net/browse/VSTOR-143363 > Feature: fix selftests > Signed-off-by: Eva Kurchatova > > diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c > index 077a98fb1b1d..66993bd632ec 100644 > --- a/tools/testing/selftests/timers/posix_timers.c > +++ b/tools/testing/selftests/timers/posix_timers.c > @@ -112,9 +112,10 @@ static void check_itimer(int which, const char *name) > > done = 0; > > - if (which == ITIMER_VIRTUAL) > + if (which == ITIMER_VIRTUAL) { > + clock_id = CLOCK_THREAD_CPUTIME_ID; > signal(SIGVTALRM, sig_handler); > - else if (which == ITIMER_PROF) { > + } else if (which == ITIMER_PROF) { > clock_id = CLOCK_THREAD_CPUTIME_ID; > signal(SIGPROF, sig_handler); > } ITIMER_REAL is measured with CLOCK_REALTIME but the kernel arms it with CLOCK_MONOTONIC. hrtimer_setup(&sig->real_timer, it_real_fn, CLOCK_MONOTONIC, HRTIMER_MODE_REL) in kernel/fork.c Set it for this arm too. Since realtime will also get its own clock maybe it would read better to have a switch instead of an if/else if/else if. -- Vasileios Almpanis _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel