From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 6C4A4803BB for ; Fri, 13 Nov 2026 04:26:04 +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 6AD4NkFl014392; Fri, 13 Nov 2026 07:23:46 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AD4NkFl014392 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="KGQBF4DF" Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AD4NajV014370 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Fri, 13 Nov 2026 07:23:36 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AD4NajV014370 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4a17741243eso2248395e9.0 for ; Thu, 12 Nov 2026 20:23:36 -0800 (PST) X-Gm-Message-State: APuU4Z+1ptHZpCuMoNN5TE5/cE5BWKjOuDgrVbSXXbTp5M89e+NdTCuP ifYanOg7EsRESCklbnnmMsX8MIGMAwC69rfvGo4am+/hxD26SbtehxLtGKi1W1/d2lwGMZhZYTr vlsKkbpWnrvE3SozF2ml4EFJyMshVK3e/+ctj7AeYvBCxOC+fr3mVnQ== X-Gm-Gg: AYBFou3r2DuvGhIWwfRsUDSlwDPv4J+390P6tEoWjH4aYy8ck9eE60HJOFhX1Lq7izd qVkFHE6M1UiWa/hludbrvJTOvzj9HsBHQWhj98A2rO8O0KNKmlqH8f9t81K/nOXse1ZNUCmu/ng +kMdw6sHJFKCyLjrnvNgd+Sl2utDLkQb8ErBcqwQ2fGVS+Wo/k0SYVqeiYYdpMtpofdLrfkvYMX iRvBtk5bUB7mJ4EpFMsj9rtR/beoXJOo1qUFmJmvoEbt1R+p6SVSXNY93WFXMDseL/yy6suwpuw NcKkE3oQK7/ltsxPiah5MjED7kXtPOvsTaAaVmpAQLO/i/fohE0/bfrBWOO818PQRinKofMGUuV 1tlYd13LcQN4gdHmuM6wPVzesxQ== X-Received: by 2002:a05:600c:3487:b0:4a2:526b:d410 with SMTP id 5b1f17b1804b1-4bb55a4f1b4mr27799145e9.13.1794543816098; Thu, 12 Nov 2026 20:23:36 -0800 (PST) X-Received: by 2002:a05:600c:3487:b0:4a2:526b:d410 with SMTP id 5b1f17b1804b1-4bb55a4f1b4mr27798955e9.13.1794543815679; Thu, 12 Nov 2026 20:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794543815; cv=none; d=google.com; s=arc-20260327; b=PoG21pyjOYJNQSHsz5e1lxqCNVXK0d3nN46IcW7Iq3K8ToO2gLP1EGW7FfSrhiNsNH jFRYqhi7jXHWHkbwas9SeyXv1LBBLpIAzgY8WP/1AbOyWH28k8mLVae2I8ZR73EMbVTa F5v9qmV42M5WSI4GrQFOoDJTQhS4EvNIbZu1RYbsxZG1QtU/3B7Tb5bmcGEnMrASAQ14 QRUJt2tDAbYkbxYXjNGQ0v/403r6o3LTIX2ixsATtNtBQDhjYzsqR5BTA8WkJ3bvizvq nhG3szGnYRPKTLsGBlwHJ5jC9wD2TGGlsKMDM/mmVnI8G4gvCGPPLh1spFn9Y0DCumIr INkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=rVfNEAaF6TJ7kjZ1sDe0EmY/QOjaQ+y01SwMPV9By9k=; fh=WpT6aB7RBAGHZeWZzqAr71yzRFbPTYkPWKsRagLn48Q=; b=CjjZpVJx0xscM7pNp+pUnzT7zSDfe5rQ4kCBBjTNoNmTz17FnE0ECStVI6+dkloHmC dJRCvVQuYkh0XaHZU9UB53+ykr65ieqjbF+4i1td4f+wzgTM56a+49D3p1aSnWfg4wKo psbuBlez0zEjml7RvcsRjX2qlHcQQEuRyUCxYASSVK9/HYTYSq+D8HBibkbw/Y8EAYhZ 5Fytf9wQl3+nWdjNSE1fTImeo0jFI8S8rKfZzY+vLZdw8T87dNLzfqZlrumUEaGuptyj lsYkVLDhBc6dEm+7b9/RRrgU73PTy1luo57VPInoW4J8APa4hQxjLdsaDgQgdLfwcHXO e7vw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=KGQBF4DF; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@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-4bb55b0dba1si26678415e9.13.2026.11.12.20.23.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2026 20:23:35 -0800 (PST) Received-SPF: pass (google.com: domain of eva.kurchatova@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=KGQBF4DF; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@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=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=rVfNEAaF6TJ7kjZ1sDe0EmY/QOjaQ+y01SwMPV9By9k=; b=KGQBF4DFUZgc N+COygT+gCE1WejPRniewp+vB9CX2ifI3TOLFv2LWP84NbciEuoXbjfTyxWCsmeREMLBmBPxCD7VC 3gOlQ7wUBdx2oIJJO3SqbYhVpxVgxkTBVc/gYZMNzNFygxEs5ONiaTOyoPGtpdsYaK6nDhDkC83+W GknaGRA6CwiDQ2FdeAY4mEUjb7Q5om+/GZLhOuFegSMKlRs9wPpTR1hP3w2Ea5a0ozi1XD2twCKLy Gtbjw+qMAGZMYHjUngvaaL/Y6dVOoQOHi6p8oX8xFT5XOerVvQC6GzeXkvBx4houMyAqpjaROCN0x S4cKfNLE48Z5wP3fbS/7vQ==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=LekKit-T14) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xRikv-00GsIK-1P; Fri, 13 Nov 2026 05:23:32 +0100 From: Eva Kurchatova To: khorenko@virtuozzo.com Date: Fri, 13 Nov 2026 06:19:59 +0200 Message-ID: <20261113042331.517488-3-eva.kurchatova@virtuozzo.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261113042331.517488-1-eva.kurchatova@virtuozzo.com> References: <20261113042331.517488-1-eva.kurchatova@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 2/3] selftests: cgroup: mark the pages cold before numa_migrate starts 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 The inactive variants of test_numa_migrate report their pages populated before they madvise(MADV_COLD) them. The parent starts the migration as soon as 85% of the pages are inactive on the source node, while the rest are still being deactivated. memory.numa_migrate takes the size of each LRU list as its scan budget when it gets to the list, so the pages that become inactive later are not scanned, and up to the 15% that verify_stats() tolerates can stay behind. The slower a kernel deactivates the pages, the more often the test fails, which made inactive_disk_file fail often on coverage kernels. Call madvise(MADV_COLD) before reporting the pages populated. Fixes: 3842964f4497 ("selftests: cgroup: test numa migration of lruvecs") https://virtuozzo.atlassian.net/browse/VSTOR-154520 Feature: fix selftests Signed-off-by: Eva Kurchatova --- .../selftests/cgroup/test_numa_migrate.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/cgroup/test_numa_migrate.c b/tools/testing/selftests/cgroup/test_numa_migrate.c index 5f4a55684f61..12c9bab79d6e 100644 --- a/tools/testing/selftests/cgroup/test_numa_migrate.c +++ b/tools/testing/selftests/cgroup/test_numa_migrate.c @@ -587,12 +587,15 @@ static int touch_pages(const char *cgroup, void *arg) void *mmap_ptr; volatile uint8_t *ptr; enum memory_type mem_type; + bool inactive; char tmp = 's'; struct test_context *ctx = arg; int ret = EXIT_SUCCESS; EXPAND_CTX(ctx); mem_type = variant->mem_type; + inactive = mem_type == MEMORY_TYPE_INACTIVE_FILE || + mem_type == MEMORY_TYPE_INACTIVE_ANON; numa_bind(src_mask); @@ -627,6 +630,13 @@ static int touch_pages(const char *cgroup, void *arg) goto err_unmap; } + /* Deactivate all pages before the parent starts migrating them */ + if (inactive && madvise(mmap_ptr, file_size, MADV_COLD) < 0) { + ksft_perror("failed to mark test mapping cold\n"); + ret = EXIT_FAILURE; + goto err_unmap; + } + if (write(self->pipefd[1], &tmp, 1) != 1) { ksft_print_msg("failed to write to pipe\n"); close(self->pipefd[1]); @@ -640,15 +650,8 @@ static int touch_pages(const char *cgroup, void *arg) goto err_unmap; } - if (mem_type == MEMORY_TYPE_INACTIVE_FILE || - mem_type == MEMORY_TYPE_INACTIVE_ANON) { - if (madvise(mmap_ptr, file_size, MADV_COLD) < 0) { - ksft_perror("failed to mark test mapping cold\n"); - ret = EXIT_FAILURE; - goto err_unmap; - } + if (inactive) pause(); - } srand(getpid()); while (1) { -- 2.56.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel