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 9BA71803F7 for ; Fri, 13 Nov 2026 15:11:37 +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 6ADF9JnC018033; Fri, 13 Nov 2026 18:09:20 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ADF9JnC018033 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="COPd2xoO" Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6ADF9799017975 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Fri, 13 Nov 2026 18:09:08 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ADF9799017975 Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-3b17b31c3beso990663a91.2 for ; Fri, 13 Nov 2026 07:09:08 -0800 (PST) X-Gm-Message-State: APuU4Z/21iiBfJBpWp7HeGdsCly4JNaOLrQ+VQL0gd/Ynff44DIMN0YG ByHOIz8XIXPVrhFjH0p328NbfQgV5lTJUGh1bFCoasOr24dKeFn8MtyXhx/5Fn8VmNYcWPbPL2t egto4YGsASaZbIZ3hAgGcdsN+QMm9NgwtFDKQ1ir/kPdn8nzR/eY60w== X-Gm-Gg: AYBFou23k49TvfR+CJglzQgey/V/1Q8t9FX+Uz3DsmUklbNjkytfJS/Xr9D/Cc0PnKK FLVIFU/3xrFD4u+cx/bSQllyIl/stHBL5R/wB81eSf6pEtCs8THeWfHKSK6esreZhH+CM7J+hVi o19XAdspbAhe8D9X/SnMMASUwOfBs1whN3KFiBptuXNZca514IRUOJHJOy2PXjsrjZ5wmIgZk1X tmsZZUprknbmGifIBK5eEyez7QPYpPnUnF6MCXE2CFH69wpELRtnZN24iITjUiJT5gSuSWuEQ1o KwZEmrI+EOLRSbbPVstNwAjID/w+VwXlTdzSbLNXzCSjOjmS/NSeLF/dEDiONuzaQC+R6cihTn2 tDS7YnsvjMcKSt/XZHVNN358y7X45xETDIy6awAgMH9bhfWyaI5z9AEOM65HBk2FF0uj76+pxnU xKHshEJlhfuPASL4h5U+hgg0cdrA== X-Received: by 2002:a17:90b:1fc4:b0:3b1:647b:769e with SMTP id 98e67ed59e1d1-3b1b0b554a9mr2477111a91.57.1794582546987; Fri, 13 Nov 2026 07:09:06 -0800 (PST) X-Received: by 2002:a17:90b:1fc4:b0:3b1:647b:769e with SMTP id 98e67ed59e1d1-3b1b0b554a9mr2477085a91.57.1794582546401; Fri, 13 Nov 2026 07:09:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1794582546; cv=pass; d=google.com; s=arc-20260327; b=HDA82MotWSE+p4u0S7OYl75Y00Sc+yZyNVBJAC9eCs43vFnwh/RBzSCu0GYXonPvnQ 3cVLAN95PMVFcgOQUtZN1vjvlUOpIMs94PDv0ELnK3ZqAWStgmOmdRMN8ONSc3X75HVK HnGfoxQjdNpuo1TfZm3QmRfYCcbpHEg+Z2khdm57WLYfUvazNrq+QwFuGxKsK1ViuN+L f7O8IdN4VI8epXZr/vB8i7UqUnoIhGfhq8VIth2I64mmLbrS6quu/y7V/XlrUl7BOYx1 9ECH7ucLMUYhc7CVscNzsKbxZApauj2at/CyyvOQ1Um3fNGlqK4vJqEHNRrwIcTM7aZO sxtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=mime-version:cc:to:in-reply-to:references:message-id :content-transfer-encoding:subject:date:from:dkim-signature; bh=xr3sZ1CUB82U7aiREU7+Q62KOhNmkrJlw1NH/Z2se6g=; fh=TMBp1cYDjDJ6KUXnve18n42rOCdXEqpN/92m20IcUP4=; b=H/RBz3+dWccmmRWhG5Y2lb0hmmLB+K5VrxkViJTdWq6evR8yn4ozu4VGn9vs+QXmnh wLIjvBQ/QfVLrcsuhyv2WKGWmxH4FmQFIkvWlbK8mY1C137MYuHxfcB3Z+s1dif59ygd H2AX6HwitrCIW8BhBkn31KaE1tU13ilWixdy4C+X6O2Jo7yZl3oRLKvN5q+O3yjYa15R BZpH1aX7009ZrrBOyZucPioD1eBGudegGts+9qmKOXzaGr+iaDWJznuWOS+QkSBwlGgZ E1ejThqD/aEi6Z0QAvNfY3jKIJNraBDeZYIACFFdvsEnF2qm10V0Rz2pzm+M5NlOWy5J 3Cig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=COPd2xoO; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.com); spf=pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c207::3 as permitted sender) smtp.mailfrom=ptikhomirov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazlp170110003.outbound.protection.outlook.com. [2a01:111:f403:c207::3]) by mx.google.com with ESMTPS id 98e67ed59e1d1-3b1ae996238si8259081a91.9.2026.11.13.07.09.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2026 07:09:06 -0800 (PST) Received-SPF: pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c207::3 as permitted sender) client-ip=2a01:111:f403:c207::3; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=COPd2xoO; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.com); spf=pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c207::3 as permitted sender) smtp.mailfrom=ptikhomirov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tMvDjfv9XyFEXNd1w/5pJY7LXLH1wj+vakBlQMm5Oe5ZF8DkdHpGkiB2iktQRdqHArTt8F1vZdpiW9XXkiN2jo6Ily1T9GhRd2UY+BQ8zMetj214MjVtCkcKqF204b3Ql7PmLPtOPqPrGI1w7yvwtd/Zl28a9qA74gvso/NiUNNARTs3hLwcdu9GGIlzhEr0SbO6orh1fYk3ZZA6vwFYHge8dopayMJnNBSe/OzwsJkH7N9HIA1qpv8xF3WFAbkDTlSNhJevL4aJ/5jdVcaHCYuMci2B5hmZNo3RSQahTFFe+vVFNdYBCciloQF/8eujtpCaBxatu76pm+qihCT24A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xr3sZ1CUB82U7aiREU7+Q62KOhNmkrJlw1NH/Z2se6g=; b=eCxUDQJ9d22wTOisEiweK3dHf1Y4jMg5urK/ymrPoeqs/K4hr3hNcddV1ZNWUuDE9dUEOIRNdHdS+MnjaTNCZ4fluV058ZGV7hPGN2fdyn8Pvt/8av7YHFuNJEC/sP1JmSGae03DoWDGmvswFggpXv7+yPKBJINBuNGBHEmRXsV/nH2bLgUYNGRhFxwQErkVerptgHPYlbdyXAPEFbHxNSEWtjcSsvVgIqt4BllZprl7gKfjokVAhbd9oSeUCYWGkvxG5dMSEgtJA34WJw63qXeLwOsjXr9KLLm0mBGA221vRYapsYHdASyPjo8HV04rcImON12eddY0Q/p5z6hlcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xr3sZ1CUB82U7aiREU7+Q62KOhNmkrJlw1NH/Z2se6g=; b=COPd2xoO6ds0th8AaxsXKUhk9F0NoQFaht1VKgI1hhpE2qFh2zFAOaT2MkbNVRsupy7nzMFP60DdSWEeBvyR9J3EsyALIVL3/uMdHed6DA/imy9ugsVELu50nO2etzfyKvV4hupsU+8sJVP0rUq0TRxV1jTbUf41DCxaCNvuM900gLMAJqUJt5x5fxza8CiCqJ+f8T1niZu5Yz3aJB2l+evk4xjxFeVbKbOC4KtAoGc96pm4bNMYOlX5oJAi3TmKyfDcKK0pOdLkyw9BeaTJMkljesENUH3kzXJos7Ys/+BbbWHIWgjmDS0Ps3g1tqUVoJrwFetiNv5haiPz8/B66g== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM0PR08MB11804.eurprd08.prod.outlook.com (2603:10a6:20b:747::14) by AS8PR08MB6486.eurprd08.prod.outlook.com (2603:10a6:20b:33c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.615.10; Fri, 13 Nov 2026 15:09:02 +0000 Received: from AM0PR08MB11804.eurprd08.prod.outlook.com ([fe80::bf46:f137:f6d2:5b3a]) by AM0PR08MB11804.eurprd08.prod.outlook.com ([fe80::bf46:f137:f6d2:5b3a%7]) with mapi id 15.21.0615.009; Fri, 13 Nov 2026 15:09:02 +0000 From: Pavel Tikhomirov Date: Fri, 13 Nov 2026 16:08:45 +0100 Message-Id: <20261113-pr-ptikhomirov-vstor-154129-aio-pseudosuper-ring-v1-2-7d35d143fdc3@virtuozzo.com> References: <20261113-pr-ptikhomirov-vstor-154129-aio-pseudosuper-ring-v1-0-7d35d143fdc3@virtuozzo.com> In-Reply-To: <20261113-pr-ptikhomirov-vstor-154129-aio-pseudosuper-ring-v1-0-7d35d143fdc3@virtuozzo.com> To: Konstantin Khorenko X-Mailer: b4 0.16.0 X-ClientProxiedBy: BE1P281CA0242.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:8b::9) To AM0PR08MB11804.eurprd08.prod.outlook.com (2603:10a6:20b:747::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR08MB11804:EE_|AS8PR08MB6486:EE_ X-MS-Office365-Filtering-Correlation-Id: 992552d2-a19b-463e-1188-08df41980d24 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|23010399003|52116014|376014|366016|1800799024|38350700014|10067099003|5023799004|56012099006|261022075727099003|261022105027099003|261026140227099003|261022115727099003|261026121527099003|261021121427099003|261028144727099003|261102123227099003|261009223027099003|18002099003|22082099003|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: V6ikJGkjlmze3uR/3O7My5JV7a4Vt2PgLnMLwqKJALYEuBQSUSKmJHEn9AtoY+vbakSPBLqpGq9hUj3u3PnPeQb8S2DFYxLLP/WIyYcNFJhlSzuLOhbTjmclNpdixy0plD6mmpvgD1kMz7bcHg/HdEUQbGf1xLkqdL6N+3galdEv5UXS2YGe6m3OWHUFnDFV8QVvpMLVkq73jbkUOVhcBdYNQq9+eey2Xf/dbuOTSvaYB51FaojZEsoSc4h91J7qMbl9qih016u9PnL5Ju4uKBTxGC/z7AmGv0sg8qyvmOvdkmj2RD3MS1jGnoL6hhFqu6RfjuGFChaXXAz3iWXIZsvsGGC7RevQt+Qoe+pDBC1H0GkChQOtKQrsL9q2wxP/R/cC8GH4suu3cIPgWcUN5ysRmVWK9pOsRzO+wtaLg+SGLCbE188/7l3bm0QxKoqHrN21aswo8U/imG8RjW1w8/km+yka6UdHCc68THAZcVJeopTzUx1EWLtBoCXUgYbJr/HrJOHKk+oo5yZ5Uf7jvypkeAv5T9rgOoAEypo+L5T+pSNa3kmEcJjW9lQr4VIv4aWsGbwSbgS5pWVCMPtYlXIzI4lwGslLgEFzoJ46O+6gkalOWfQo/6+LZg89IXYzGTL/5SgxqUuoePkGg7CHYXNruqIA2LSxgO3HmllWN+c= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR08MB11804.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(23010399003)(52116014)(376014)(366016)(1800799024)(38350700014)(10067099003)(5023799004)(56012099006)(261022075727099003)(261022105027099003)(261026140227099003)(261022115727099003)(261026121527099003)(261021121427099003)(261028144727099003)(261102123227099003)(261009223027099003)(18002099003)(22082099003)(6133799003)(3023799007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?endZU3N1UVVMdE5BcWpjM3hPZndFMENaZkhwSmIwS0kvNWt3aUlDM2hmbGtJ?= =?utf-8?B?MjJLQ3p2VmhtNFhsMUZDRHFJeS80ZEE3T2hVSlJld0gyVWpIU3lid1luQm5N?= =?utf-8?B?V3d3Yk5vN1o4VUludVlsYityTWh2bFE4RUhNbHlZcW4zMDJ0T2lZTG9rdHYr?= =?utf-8?B?d0VNQm9NT3BJWUdGZ21uSEpvYXlqOCtPQ1ovaTE1bjF6SHdvNm8wVkRSVlFJ?= =?utf-8?B?L1llSnl6WWVQdE5NeGxPd1lma0tSdWhxdGVPR1VhbVdEcURMMG9JMkJiSVNJ?= =?utf-8?B?cVNnZzVBbWhveUhHZmJGZE1GVUpoVFJzTmdXejMxdStwYWpWM3YvQ0hKNkpz?= =?utf-8?B?RjMyUlZmdEFJU1VoUGFyYW9sWmVHTnNrYUx0bHVKVldOQ210d1l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?utf-8?B?NDljTHkyL0NQQmpzb0dUNlJPYzF0eElkTzA0VkJZSXlrQ3pMcjdXS0tGZHJC?= =?utf-8?B?VWpQaGY4UFZpd1FRRnRTZC9MVFJtU0t5enpWOU4vaWtTL2FZSlN3K01UZlpL?= =?utf-8?B?R2RraDlFRUhtOCtCV3NmSGNrWmN3TEtHZlBMenVsQ1BmeDdNV051dz09?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 992552d2-a19b-463e-1188-08df41980d24 X-MS-Exchange-CrossTenant-AuthSource: AM0PR08MB11804.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2026 15:09:02.1961 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SbZX1E7364ksSFmyl7OF1ekeuNG7FVlNuk+WxJWppXUFsndNMG7gUsbiXheqPzjxw0x4X0k4maeXPobhJN2zjTCIu84CosTwZC9Gv9HIDkE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6486 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 2/2] selftests/ve: check the AIO ring size in a pseudosuper VE 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 Check that the host and a VE keep the CPU heuristic of the io_setup() ring and a pseudosuper VE skips it, and that io_setup((nr - 2) / 2) there gives back a ring of nr events for rings of 1 to 4 pages. The rings differ only when the CPU heuristic makes a one-page ring bigger, e.g. with 16 possible CPUs and 4K pages, else the test is skipped. Before the fix the pseudosuper tests fail on 16 CPUs with a ring of 255 events instead of 127. https://virtuozzo.atlassian.net/browse/VSTOR-154129 Feature: ve: CRIU support Signed-off-by: Pavel Tikhomirov --- tools/testing/selftests/ve/.gitignore | 1 + tools/testing/selftests/ve/Makefile | 1 + tools/testing/selftests/ve/ve_aio_ring_test.c | 214 ++++++++++++++++++++++++++ 3 files changed, 216 insertions(+) diff --git a/tools/testing/selftests/ve/.gitignore b/tools/testing/selftests/ve/.gitignore index 3d1179bd2c5f4..2ff027048a6ae 100644 --- a/tools/testing/selftests/ve/.gitignore +++ b/tools/testing/selftests/ve/.gitignore @@ -4,3 +4,4 @@ ve_mount_accounting_test ve_cpuid_override_test ve_vtty_stress ve_numa_migrate_test +ve_aio_ring_test diff --git a/tools/testing/selftests/ve/Makefile b/tools/testing/selftests/ve/Makefile index e96320a183844..124b4a918016c 100644 --- a/tools/testing/selftests/ve/Makefile +++ b/tools/testing/selftests/ve/Makefile @@ -7,6 +7,7 @@ TEST_GEN_PROGS += ve_perms_test TEST_GEN_PROGS += ve_mount_accounting_test TEST_GEN_PROGS += ve_vtty_stress TEST_GEN_PROGS += ve_numa_migrate_test +TEST_GEN_PROGS += ve_aio_ring_test # CPUID faulting is x86-64 only. ARCH says "x86" for 32-bit too and lib.mk # picks the clang target by its emptiness, so decide by the compiler. diff --git a/tools/testing/selftests/ve/ve_aio_ring_test.c b/tools/testing/selftests/ve/ve_aio_ring_test.c new file mode 100644 index 0000000000000..c370941574224 --- /dev/null +++ b/tools/testing/selftests/ve/ve_aio_ring_test.c @@ -0,0 +1,214 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ve_aio_ring selftest + * + * io_setup() makes the ring at least 4 events per possible CPU. CRIU + * restores a ring with io_setup() and needs the size it had on dump, so + * a VE in pseudosuper mode (restore) gets the ring of exactly the size + * asked for. The tests check that: + * + * - the host keeps the CPU heuristic + * - a VE keeps the CPU heuristic + * - a VE in pseudosuper mode skips the CPU heuristic + * - a VE in pseudosuper mode gets a ring of nr events from + * io_setup((nr - 2) / 2), for rings of 1 to 4 pages + * + * The rings differ only when the CPU heuristic makes a small ring bigger, + * e.g. with 16 possible CPUs and 4K pages, else the test is skipped. + */ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../kselftest_harness.h" +#include "ve_selftest.h" + +/* The ring header mapped by io_setup(), a copy of the one in fs/aio.c. */ +struct aio_ring { + unsigned int id; + unsigned int nr; /* ring capacity in io_events */ + unsigned int head; + unsigned int tail; + unsigned int magic; + unsigned int compat_features; + unsigned int incompat_features; + unsigned int header_length; + struct io_event io_events[]; +}; + +#define PAGE_ALIGN(size, ps) (((size) + ((ps) - 1)) & ~((ps) - 1)) + +/* The biggest ring, in pages, the pseudosuper restore test covers. */ +#define RING_PAGES_MAX 4 + +struct aio_ring_arg { + unsigned int nr_events; /* in: io_setup() nr_events */ + unsigned int ring_nr; /* out: ring capacity, struct aio_ring::nr */ +}; + +FIXTURE(ve_aio_ring) +{ + int cgv2_fd; + int ctid; + struct namespace_ctx ns_ctx; + unsigned int cpus; + unsigned long page_size; + struct aio_ring_arg *arg; /* shared with the child in the VE */ +}; + +/* The ring capacity aio_setup_ring() makes for @nr_events. */ +static unsigned int calculate_ring_nr(FIXTURE_DATA(ve_aio_ring) * self, + unsigned int nr_events) +{ + unsigned long size; + + size = sizeof(struct aio_ring) + (nr_events + 2) * sizeof(struct io_event); + size = PAGE_ALIGN(size, self->page_size); + return (size - sizeof(struct aio_ring)) / sizeof(struct io_event); +} + +/* The ring capacity io_setup(@nr_events) makes. */ +static unsigned int ring_nr(FIXTURE_DATA(ve_aio_ring) * self, + unsigned int nr_events) +{ + unsigned int cpu_events = self->cpus * 4; + + if (nr_events < cpu_events) + nr_events = cpu_events; + return calculate_ring_nr(self, 2 * nr_events); +} + +/* The ring capacity io_setup(@nr_events) makes without the CPU heuristic. */ +static unsigned int ring_nr_pseudosuper(FIXTURE_DATA(ve_aio_ring) * self, + unsigned int nr_events) +{ + return calculate_ring_nr(self, 2 * nr_events); +} + +/* Create an AIO context of arg->nr_events, store its ring capacity. */ +static int aio_ring_nr(void *data) +{ + struct aio_ring_arg *arg = data; + aio_context_t ctx = 0; + + if (syscall(__NR_io_setup, arg->nr_events, &ctx)) { + fprintf(stderr, "%s: io_setup(%u): %s\n", __func__, + arg->nr_events, strerror(errno)); + return -1; + } + arg->ring_nr = ((struct aio_ring *)ctx)->nr; + + if (syscall(__NR_io_destroy, ctx)) { + fprintf(stderr, "%s: io_destroy: %s\n", __func__, + strerror(errno)); + return -1; + } + return 0; +} + +/* The ring capacity io_setup(@nr_events) makes in the VE, or 0. */ +static unsigned int ve_ring_nr(FIXTURE_DATA(ve_aio_ring) * self, + unsigned int nr_events) +{ + self->arg->nr_events = nr_events; + self->arg->ring_nr = 0; + if (run_in_ve(self->cgv2_fd, self->ctid, &self->ns_ctx, CLONE_NEWVE, + aio_ring_nr, self->arg)) + return 0; + return self->arg->ring_nr; +} + +static int set_pseudosuper(FIXTURE_DATA(ve_aio_ring) * self, int value) +{ + char path[64]; + + snprintf(path, sizeof(path), "%d/ve.pseudosuper", self->ctid); + return write_u64_at(self->cgv2_fd, path, value); +} + +FIXTURE_SETUP(ve_aio_ring) +{ + long cpus; + + self->ctid = -1; + self->arg = MAP_FAILED; + + self->page_size = sysconf(_SC_PAGESIZE); + cpus = sysconf(_SC_NPROCESSORS_CONF); + ASSERT_GT(cpus, 0); + self->cpus = cpus; + if (ring_nr(self, 1) == ring_nr_pseudosuper(self, 1)) + SKIP(return, "%u possible CPUs are too few for the CPU heuristic to matter", + self->cpus); + + self->arg = mmap(NULL, sizeof(*self->arg), PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, -1, 0); + ASSERT_NE(self->arg, MAP_FAILED); + + self->cgv2_fd = mount_cg2_fd(); + ASSERT_GE(self->cgv2_fd, 0); + + ASSERT_EQ(write_file_at(self->cgv2_fd, "cgroup.subtree_control", + VE_CONTROLLERS), 0); + + self->ctid = make_ve(self->cgv2_fd, CTID_MIN); + ASSERT_GE(self->ctid, 0); + + ASSERT_EQ(prepare_namespaces(&self->ns_ctx, CLONE_NEWVE, + self->cgv2_fd, self->ctid), 0); +} + +FIXTURE_TEARDOWN(ve_aio_ring) +{ + if (self->ctid >= 0) { + set_pseudosuper(self, 0); + close_namespace_fds(&self->ns_ctx); + destroy_ve(self->cgv2_fd, self->ctid); + close(self->cgv2_fd); + } + if (self->arg != MAP_FAILED) + munmap(self->arg, sizeof(*self->arg)); +} + +TEST_F(ve_aio_ring, host_keeps_cpu_heuristic) +{ + self->arg->nr_events = 1; + EXPECT_EQ(aio_ring_nr(self->arg), 0); + EXPECT_EQ(self->arg->ring_nr, ring_nr(self, 1)); +} + +TEST_F(ve_aio_ring, ve_keeps_cpu_heuristic) +{ + EXPECT_EQ(ve_ring_nr(self, 1), ring_nr(self, 1)); +} + +TEST_F(ve_aio_ring, pseudosuper_ve_skips_cpu_heuristic) +{ + EXPECT_EQ(set_pseudosuper(self, 1), 0); + EXPECT_EQ(ve_ring_nr(self, 1), ring_nr_pseudosuper(self, 1)); +} + +/* + * A ring of nr events is restored with io_setup((nr - 2) / 2), check + * it gives back a ring of nr events. + */ +TEST_F(ve_aio_ring, pseudosuper_ve_restores_ring_size) +{ + unsigned int pages, nr; + + EXPECT_EQ(set_pseudosuper(self, 1), 0); + for (pages = 1; pages <= RING_PAGES_MAX; pages++) { + nr = (pages * self->page_size - sizeof(struct aio_ring)) / + sizeof(struct io_event); + EXPECT_EQ(ve_ring_nr(self, (nr - 2) / 2), nr) + TH_LOG("ring of %u pages", pages); + } +} + +TEST_HARNESS_MAIN -- 2.56.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel