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 2150F8015B for ; Fri, 25 Sep 2026 16:54:54 +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 68PGrgi1027380; Fri, 25 Sep 2026 19:53:43 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68PGrgi1027380 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="UhXShVIN" Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68PGrbTW027336 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Fri, 25 Sep 2026 19:53:37 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68PGrbTW027336 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-49b0e6638e3so9354185e9.2 for ; Fri, 25 Sep 2026 09:53:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBzW9BX24vwSQlM+eBckcBLSwFirkCqhqaTQqW55o6Gv4Kf3JNwadFyVJX+6mfWH1zZ7Syb94w==@openvz.org X-Gm-Message-State: AFuF++kbZwTwhNqYLYSVt4nO5Lz3QMl1tN4aphcr/7uBl7l6XD0ASWoc Jh/51dL3Cq4VZ4KGoIKQCIQIvuw89NK0981utV/80Hj/UHRRb7Ts5sqgXS7RDyUcsCzxucFKDIQ g+O8VYRrOljeCwL2rT4cMxzEUsf6bcUisd+9TKh7sTPGiTVf4OTOWiw== X-Gm-Gg: AYBFou1jFbpgkNa5KdTIgWSpLAyQXYahEyEx9YMQBUSrn04T2sV55giOgO4f7mdDvsT ehqC6eJKDFO7fz9PqTOFT0Ce/EitIYbnNsfSNmb8zWUZw4pq0adH7rfV10ckYEVUIBNeRmccvpF t6+WEN6GFxmNuI5ccnWIbA57tkAl0VfC8ECUUwTZUPeLRmsn8t07ySKId0T5QFvs7eYQk9POglt gbwv6CMNO0SxHrNIntAU2jy0NWyTf9X1hPVAJII3Hrmn3B2+ZABFciZF46X7Kh7LzaDwEWLMNBf oal9XEM8MCFCbBbpsL9mK+oTcXHU3zDpkBNj6TSaqxRbyXfcLvc9GzN21NQ+4g8waPdhVDuhu9D D2rVqeqF+aR+f7P47 X-Received: by 2002:a05:600c:3514:b0:49c:fa21:e749 with SMTP id 5b1f17b1804b1-49fe67043a0mr109780445e9.31.1790355217107; Fri, 25 Sep 2026 09:53:37 -0700 (PDT) X-Received: by 2002:a05:600c:3514:b0:49c:fa21:e749 with SMTP id 5b1f17b1804b1-49fe67043a0mr109779685e9.31.1790355216373; Fri, 25 Sep 2026 09:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790355216; cv=none; d=google.com; s=arc-20260327; b=ZIczH3HKNIjaMeTlD89YFuvOCksIY9CrKjXNNOP8WoU7lNNbbLGQGDjuaiHshf5x3x Wf7aDncUAv/tncN3s9bwCnsbFR7boqXDOF/+1wG31o6S4/yIbKu7fkIj0HE4m7YWGlJc mm7J3j2XdmCBKKJjerHdab8+FMhZJmMxknvzmoU4iiUUJnpQKys/1uOrHHZ0wi1EgDZu qTZS3/HKJJ71y1vCzsCj/fcpgLnIo98prhOLbysHKACcDmeDoW9N59s3RbhmRPLyFlNV KwgfaNuGzLzRWd+Hj7Q+YbxsDmEZAHDuxwkHF3iXhGlDw7D5cNRYxo74COzRXaeSJ7YX 2mew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:dkim-signature; bh=rd/1IIoumjPT4Uv2YcqiCThdd4Z/N4rjoqOuJBRgIAg=; fh=zK/v/gHQ7GavWYhLJT8+SASJ7h8osfxqNHUzmzGkT+o=; b=Ehj6zPV+I3xXBQw8uJ4yG4E/LOzP9PwT0kegAU/nbWC6W10Ll+PZ+Pyu8LoJFd05pC y2blJKob3qGlOXxi1CWjsWdTfTBGpV8f+qc0pzIx3MNG7cAQjTK0jAQ/dlN72gcAIlcH s5onfcWr2cQ4Q2/T+5Hq7mKYcLszOVFqOCtWFb7WJao4zpg1QI9gpuAVkUQp3h4ycyVM V2+TeGScB9DZ/I0lCqvBA9oJlLgeSPK010VD+J/OZKTxr/oZVa+2pzLl8/xbMwuWSVP7 qcItQSqPWr1bNYrcreMcea4cNgxO29/FvrKkAl6ZTgvPmvA5COlabfgqrUc/0Tcqdcb3 h0IQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=UhXShVIN; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@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 ffacd0b85a97d-4887a35fb38si7287914f8f.112.2026.09.25.09.53.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2026 09:53:36 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@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=UhXShVIN; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@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=Content-Type:MIME-Version:Message-Id:Date:Subject :From; bh=rd/1IIoumjPT4Uv2YcqiCThdd4Z/N4rjoqOuJBRgIAg=; b=UhXShVIN+znW6DxKlSO aBxCyTkki35OeAjmftB/fGth3msZNHG6FhK6aeRoLa3H+HLXsmve1VM3WywclpLgLr3GeU6zUSPYu tFImTOl0fxt++kS3xEIpqW91q/6WzFfkvKqFGw8IccVntkiy08yQ9Car3K2bqXDf3Wj1tVydVe65Q QXGyU1MGdBd+Ty5BuZj/FOZ1V1V7QvlP4kjMIhPCbgweFzT8Yt1pQu12gBKneT7ifr3HLUGn7GTMo skXE8UpscOwga7HGejDQCgrvFiGqwlsu4hEePyONkF48Hs2BbuHpYNM7gQX4oBrGJe7+izH1FwOek 7EGl7+9tohI5Ibw==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xA983-00CFkL-1l; Fri, 25 Sep 2026 18:53:31 +0200 From: Konstantin Khorenko Date: Fri, 25 Sep 2026 18:53:21 +0200 Message-Id: <20260925-b4-kh-ve_fail-v10-0-77a6b6ea4205@virtuozzo.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAAGntmoC/yWM2wrCMBAFf6WcZ1eS7cXqr0iRJm7NqlRJahFK/ 92oj3OGMwuSRJWEQ7EgyqxJH2MGazYFfOjHi5Ce8wA23Jg91+QqugWa5TT0eqeGd7bm0ruyrZA /zyiDvn/BI4JXarcW3V+kl7uKn741rOsHOmjY13sAAAA= X-Change-ID: 20260925-b4-kh-ve_fail-6271523cb384 To: Vasileios Almpanis , Pavel Tikhomirov , cover.1789491989.git.vladimir.riabchun@virtuozzo.com, Konstantin Khorenko , devel@openvz.org X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5470; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=0MHGe3uLhgWN3zm2q0QEdoGARmW1YPTspNfCXa7k3N8=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqtqcKuq8mPn3sJZWquvR3DAaMhTJpyW6+urPFM IfDjAVJSeiJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCaranCgAKCRBRlgpH+WFc KvF7EACMWkaOgNwCywP+enk3S0CnnjnZjqomx/abqAA4LM8u/jz1YuSUAzA4Zc0G3s2jlJjkFmR GA1gCsjLM5QerV7x2FchW55PkpX7yXa5N7JVABhxFiOqIxfHzK6QWyMwhgqW56jD/gLs/s7kGCB 9kXDNzwagATnHtUJ0a1V8o+ZiaOyU14v5XCho2Qkw8gAVRWDHt87C1wIhmrU1fTvFxNtU0wvmpX eUwGcqTimhhMeN6BeziLZ0y8j+t5WoGODzgIx6J/Ja6UnakqOcuNd0CFCfWDp0equTlYuWJuShS Aar62bvnLpOTOwsCv+fJDTVfTw3Ziy0XuRyeUtaHfGCxgs3NxAXkkww6TwU9LZxTyNxJJrnBZkw HwEsrGVZAWOMZ0BNaIGwXmplHRON74RQe5VOu39t/8tv4HU/aPBO7CABEyzizDYvXVMRyLvfYt8 m0VOoLbzlMp4Dh5D1KDX1DBx1GKb0sxYsG8rf4kwYAg4OSE6u3Wv1cFg3bvIrwuR9juBrzKQ1II WnwN4AkTb9/BoAO1U5A3ZdjClgr7Rx05IR9jMZvwLRhLqZYv/znnikKRDEPX0KVQ75tBPCnsCMk OI7HXvgN3JCNoxgA3K7QpVrnRXJaFeWz0WGus4WT7K0W7E2OtuiGyFc0HhedbCis6FpPtuWlQu5 6/KcIsPIN1ciMYg== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Subject: [Devel] [PATCH hci-8.1 v10 00/13] Add per-VE failcount support 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 This patchset introduces per-VE failcount support. We have several resources that have per-VE limits, the users might want to know what limit hits make operations fail. - Patch 1 is cosmetic, nothing special. - Patches 2-4 change mount number and limit processing, unifying it with other resources. VE selftest is updated in patch 3. - Patch 5 removes copy-pasted resource accessors by generating them with macros. - Patch 6 is a split-out fix: ve0 was left without aio defaults when aio_nr/aio_max_nr moved into ve_struct. - Patch 7 adds the ve.failcount file and the helpers. - Patches 8-12 add one failcounter each: netns, mnt, netif, bpf_prog, aio. - Patch 13 introduces new VE selftest that checks mounts accounting, limits and failcount updates. NOTE: for running the new selftest this series should be applied on top of "[PATCH VZ10 v3 0/3] Improvements for ve selftests". https://virtuozzo.atlassian.net/browse/VSTOR-135520 v9: Changes since v9 (respin by khorenko@): - Dropped v9 patch 7 "ve/printk: Don't use ve log outside task context": get_exec_env() being unreliable in interrupt context is a pre-existing problem, it will be fixed properly in a separate series under VSTOR-146839. - Dropped the neigh_tbl failcounter: neigh_alloc() can run in softirq, and ve_failcount_inc() writes to the ve log, which must not be used outside task context. Without the dropped printk patch this would leak messages to an unrelated CT dmesg. The counter will be added together with the ve_printk fix. - Split "ve: Introduce per-VE failcount" into a patch adding the infrastructure and one patch per counter, so each counter can be reviewed and reverted on its own. - Made the ve0 aio initialization a separate fix with a Fixes tag: the host has been running with aio_max_nr == 0 since aio_nr/aio_max_nr became per-VE, so io_setup() on the host fails until fs.aio-max-nr is raised by hand. - Patch 1 no longer moves the umh_running_helpers/umh_helpers_waitq ve0 initializers under #ifdef CONFIG_X86: the fields and their users are arch-independent, and a whitespace patch must not change the generated code. - Dropped the old mount limit warning in alloc_vfsmnt(), otherwise every failed mount would be reported twice; the message printed by ve_failcount_inc() also names the counter to look at. - Fixed wait_on_mnt_avail() in the selftest: the delay was kept in tv_nsec, and nanosleep() rejects values of 1s and above with EINVAL, so the wait gave up early with a misleading error instead of using the whole timeout. The delay is now normalized into tv_sec/tv_nsec. - Moved ve_failcount_inc() in ioctx_alloc() out of aio_nr_lock: the counter is an atomic and does not need the lock, no point in printing to two log buffers under it. - Reworded several subjects and commit messages. Changes since v8: - Added new patch 7 to fix logs leakage from interrupts. We are fine if we miss some failure logs in container dmesg - CT can check failcounts anyway, and bringing new ratelimited printks with specified VE is too hard for such a small thing. - Selftest in patch 8 got major rework: 1. Correct mmap error handling. 2. Dropped mnt_cost value. Let's force 1, it is expected value in fresh mount+VE namespaces. 3. Proper solution for pending mount destructions. It used to be just sleep(1) which may not be enoght on loaded machines. Instead, issue rcu_barrier and wait on mnt_avail_nr. Since we forced mnt_cost == 1, it know precisely what the new value should be. Signed-off-by: Konstantin Khorenko --- Vladimir Riabchun (13): ve/ve.{h, c}: farewell to spaces as indents ve/fs: count available mounts instead of used ones selftests/ve: update ve_ns_owner_test ve: make mount limit configurable per VE ve/ve.c: generate VE resource accessors using macros ve/aio: initialize aio fields in ve0 ve: introduce per-VE failcounter infrastructure ve: add netns failcounter ve: add mnt failcounter ve: add netif failcounter ve: add bpf_prog failcounter ve: add aio failcounter selftests/ve: add mount accounting selftest fs/aio.c | 1 + fs/namespace.c | 82 +-- include/linux/ve.h | 34 +- kernel/bpf/syscall.c | 1 + kernel/ve/ve.c | 274 +++++----- kernel/ve/veowner.c | 19 - net/core/dev.c | 10 +- net/core/net_namespace.c | 4 +- tools/testing/selftests/ve/.gitignore | 1 + tools/testing/selftests/ve/Makefile | 1 + .../selftests/ve/ve_mount_accounting_test.c | 554 +++++++++++++++++++++ tools/testing/selftests/ve/ve_ns_owner_test.c | 37 +- tools/testing/selftests/ve/ve_selftest.h | 21 + 13 files changed, 816 insertions(+), 223 deletions(-) --- base-commit: 03a6f36081f7055a2e41f9b79306a3ab0103d883 change-id: 20260925-b4-kh-ve_fail-6271523cb384 Best regards, -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel